From b10470370dc3c6aa0b2b339bfb98043b31f21b69 Mon Sep 17 00:00:00 2001 From: su530201 <olivier.kaufmann@umons.ac.be> Date: Thu, 27 Oct 2022 14:42:23 +0200 Subject: [PATCH] Fixes small glitches --- README.md | 2 +- deploy_virtual_env.sh | 7 +++++++ logging_setup.py | 1 + ohmpi.py | 6 +++++- requirements_not_on_pi.txt | 5 +++++ 5 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 deploy_virtual_env.sh create mode 100644 requirements_not_on_pi.txt diff --git a/README.md b/README.md index 1fd24228..f4be390a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # OhmPi -Development of a low-cost multi-electrodes resistivimeter for electrical resistivity mesaurement for lab applications, based on raspberry board +Development of a low-cost multi-electrodes resistivity meter for electrical resistivity mesaurement for lab applications, based on raspberry board ## Installation diff --git a/deploy_virtual_env.sh b/deploy_virtual_env.sh new file mode 100644 index 00000000..65905363 --- /dev/null +++ b/deploy_virtual_env.sh @@ -0,0 +1,7 @@ +#!/bin/bash +sudo apt-get install -y libatlas-base-dev +python -m venv ohmpy +source ohmpy/bin/activate || exit 1 # NOTE: Added || exit to avoid installing requirements in system python +export CFLAGS=-fcommon +pip install -r requirements.txt + diff --git a/logging_setup.py b/logging_setup.py index 2dc30f81..5f6d3b6d 100644 --- a/logging_setup.py +++ b/logging_setup.py @@ -43,6 +43,7 @@ def setup_loggers(mqtt=True): exec_logger.setLevel(EXEC_LOGGING_CONFIG['logging_level']) if logging_to_console: + print(f'logging exec ? {logging_to_console}') # TODO: delete this line console_exec_handler = logging.StreamHandler(sys.stdout) console_exec_handler.setLevel(EXEC_LOGGING_CONFIG['logging_level']) console_exec_handler.setFormatter(exec_formatter) diff --git a/ohmpi.py b/ohmpi.py index 238d7ef1..357dd5e2 100644 --- a/ohmpi.py +++ b/ohmpi.py @@ -578,7 +578,7 @@ class OhmPi(object): self.ads_voltage = ads.ADS1115(self.i2c, gain=2 / 3, data_rate=860, address=0x49) pin1.value = True # inject from pin1 to pin0 pin0.value = False - time.sleep(0.2) + # time.sleep(0.2) # measure current and voltage current = AnalogIn(self.ads_current, ads.P0).voltage / (50 * self.r_shunt) @@ -670,6 +670,10 @@ class OhmPi(object): if cmd == 'update_settings' and args is not None: self._update_acquisition_settings(args) status = True + elif cmd == 'set_sequence' and args is not None: + self.sequence = np.array_str + self._update_acquisition_settings(args) + status = True elif cmd == 'start': self.measure(cmd_id) while not self.status == 'idle': diff --git a/requirements_not_on_pi.txt b/requirements_not_on_pi.txt new file mode 100644 index 00000000..d26aec97 --- /dev/null +++ b/requirements_not_on_pi.txt @@ -0,0 +1,5 @@ +numpy +paho-mqtt +termcolor +pandas +pyzmq -- GitLab