Commit 023c38b3 authored by Guillaume Blanchy's avatar Guillaume Blanchy
Browse files

update to UI

Showing with 605 additions and 556 deletions
+605 -556
doc/source/Ohmpi_V2_00/step_n_3/a/MUX_07.jpg

4.34 MB | W: | H:

doc/source/Ohmpi_V2_00/step_n_3/a/MUX_07.jpg

3.56 MB | W: | H:

doc/source/Ohmpi_V2_00/step_n_3/a/MUX_07.jpg
doc/source/Ohmpi_V2_00/step_n_3/a/MUX_07.jpg
doc/source/Ohmpi_V2_00/step_n_3/a/MUX_07.jpg
doc/source/Ohmpi_V2_00/step_n_3/a/MUX_07.jpg
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
......@@ -54,7 +54,7 @@ class OhmPi(object):
sequence: 1, 2, 3, 4 is used.
"""
def __init__(self, config=None, sequence=None, mqtt=True, on_pi=None):
def __init__(self, config=None, sequence=None, mqtt=False, on_pi=None):
# flags and attributes
if on_pi is None:
_, on_pi = OhmPi.get_platform()
......@@ -558,12 +558,14 @@ class OhmPi(object):
current = AnalogIn(self.ads_current, ads.P0).voltage / (50 * self.r_shunt)
voltage = -AnalogIn(self.ads_voltage, ads.P0, ads.P1).voltage * 2.5
resistance = voltage / current
print('I: {:>10.3f} mA, V: {:>10.3f} mV, R: {:>10.3f} Ohm'.format(
current*1000, voltage*1000, resistance))
# compute resistance measured (= contact resistance)
resist = abs(resistance / 1000)
msg = 'Contact resistance {:s}: {:.3f} kOhm'.format(
str(quad), resist)
print(msg)
#print(msg)
self.exec_logger.debug(msg)
......@@ -727,6 +729,9 @@ print(current_time.strftime("%Y-%m-%d %H:%M:%S"))
# for testing
if __name__ == "__main__":
ohmpi = OhmPi(config='ohmpi_param.json')
#ohmpi.measure()
ohmpi.read_quad('breadboard.txt')
ohmpi.rs_check()
ohmpi.measure()
time.sleep(4)
ohmpi.stop()
#!bin/bash
source ./ohmpy/bin/activate
python webserver.py
echo "# start OhmPi web interface" >> $HOME/.bashrc
echo "(cd $HOME/OhmPi; ./run.sh)" >> $HOME/.bashrc
# to automatically start the webserver on start, you need to place the
# following line just before the line with 'exit 0' in the /etc/rc.local.
(cd /home/jkl/OhmPi; bash run.sh > startup.log) &
......@@ -7,9 +7,9 @@ import threading
import pandas as pd
import shutil
hostName = "raspberrypi.local" # works for AP-STA
#hostName = "raspberrypi.local" # works for AP-STA
#hostName = "192.168.50.1" # fixed IP in AP-STA mode
#hostName = "0.0.0.0" # for AP mode (not AP-STA)
hostName = "0.0.0.0" # for AP mode (not AP-STA)
serverPort = 8080
# https://gist.github.com/MichaelCurrie/19394abc19abd0de4473b595c0e37a3a
......@@ -17,7 +17,7 @@ serverPort = 8080
with open('ohmpi_param.json') as json_file:
pardict = json.load(json_file)
ohmpi = OhmPi(pardict, sequence='breadboard.txt')
ohmpi = OhmPi(pardict, sequence='dd.txt')
#ohmpi = OhmPi(pardict, sequence='dd16s0no8.txt')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment