diff --git a/dev/test_2_mux_2024.py b/dev/test_2_mux_2024.py index eb7a95fedf700ded8bf8228e50c92c0cf7fb368e..9451657acff8d8e189aff87e8ed8563b16eaa86e 100644 --- a/dev/test_2_mux_2024.py +++ b/dev/test_2_mux_2024.py @@ -4,7 +4,7 @@ from ohmpi.plots import plot_exec_log import logging change_config('../configs/config_mb_2023_2_mux_2024.py', verbose=False) from ohmpi.hardware_components.mux_2024_rev_0_0 import Mux, MUX_CONFIG -from ohmpi.hardware_components import raspberry_pi_i2c as ctl_module +from ohmpi.hardware_components import raspberry_pi as ctl_module # from ohmpi.config import HARDWARE_CONFIG stand_alone_mux = False diff --git a/dev/test_3_mux_2024.py b/dev/test_3_mux_2024.py index 21e6496c1b03b09d7167b2c821692e4d578dce28..a6430ec5236e2e02fb5fd7e5bd3a18e982a4d729 100644 --- a/dev/test_3_mux_2024.py +++ b/dev/test_3_mux_2024.py @@ -4,7 +4,7 @@ from ohmpi.plots import plot_exec_log import logging change_config('../configs/config_mb_2023_3_mux_2024.py', verbose=False) from ohmpi.hardware_components.mux_2024_rev_0_0 import Mux, MUX_CONFIG -from ohmpi.hardware_components import raspberry_pi_i2c as ctl_module +from ohmpi.hardware_components import raspberry_pi as ctl_module from ohmpi.config import HARDWARE_CONFIG stand_alone_mux = False diff --git a/dev/test_4_mux_2024.py b/dev/test_4_mux_2024.py index 394898715cd370db29b169e1490e2bdcb73a3cab..98f93e891ff989b49315a49840420a947b19bd17 100644 --- a/dev/test_4_mux_2024.py +++ b/dev/test_4_mux_2024.py @@ -4,7 +4,7 @@ from ohmpi.plots import plot_exec_log import logging change_config('../configs/config_mb_2023_4_mux_2024.py', verbose=False) from ohmpi.hardware_components.mux_2024_rev_0_0 import Mux, MUX_CONFIG -from ohmpi.hardware_components import raspberry_pi_i2c as ctl_module +from ohmpi.hardware_components import raspberry_pi as ctl_module from ohmpi.config import HARDWARE_CONFIG stand_alone_mux = False diff --git a/dev/test_mux_2024.py b/dev/test_mux_2024.py index 0d57749c756bf04417745a5db74a41878fb2e256..93fb74ea68a5124a2c07c433ab7434a9e75e9ae5 100644 --- a/dev/test_mux_2024.py +++ b/dev/test_mux_2024.py @@ -3,7 +3,7 @@ from ohmpi.utils import change_config import logging change_config('../configs/config_mb_2023_mux_2024.py', verbose=False) from ohmpi.hardware_components.mux_2024_rev_0_0 import Mux, MUX_CONFIG -from ohmpi.hardware_components import raspberry_pi_i2c as ctl_module +from ohmpi.hardware_components import raspberry_pi as ctl_module # from ohmpi.config import HARDWARE_CONFIG stand_alone_mux = False # Testing hardware component alone diff --git a/dev/test_mux_2024_2_roles_AB.py b/dev/test_mux_2024_2_roles_AB.py index b4548b64b656c56d74ef3440ac0eb3ddbc079e2a..d946fe5c02ec4698e7c2b3ef6550d5a499e9a500 100644 --- a/dev/test_mux_2024_2_roles_AB.py +++ b/dev/test_mux_2024_2_roles_AB.py @@ -3,7 +3,7 @@ from ohmpi.utils import change_config import logging change_config('../configs/config_mb_2023_mux_2024_2_roles_AB.py', verbose=False) from ohmpi.hardware_components.mux_2024_rev_0_0 import Mux, MUX_CONFIG -from ohmpi.hardware_components import raspberry_pi_i2c as ctl_module +from ohmpi.hardware_components import raspberry_pi as ctl_module # from ohmpi.config import HARDWARE_CONFIG stand_alone_mux = True # Testing hardware component alone diff --git a/ohmpi/hardware_components/raspberry_pi_i2c.py b/ohmpi/hardware_components/raspberry_pi_i2c.py deleted file mode 100644 index f2e8632a65928ecedc0bb54748545ba0cfe29d05..0000000000000000000000000000000000000000 --- a/ohmpi/hardware_components/raspberry_pi_i2c.py +++ /dev/null @@ -1,22 +0,0 @@ -from ohmpi.hardware_components import CtlAbstract -import board # noqa -import busio # noqa -import os -from ohmpi.utils import get_platform -from gpiozero import CPUTemperature # noqa - - -class Ctl(CtlAbstract): - def __init__(self, **kwargs): - kwargs.update({'board_name': os.path.basename(__file__).rstrip('.py')}) - super().__init__(**kwargs) - self.bus = busio.I2C(board.SCL, board.SDA) # noqa - platform, on_pi = get_platform() - assert on_pi - self.board_name = platform - self._cpu_temp_available = True - self.max_cpu_temp = 85. # °C - - @property - def _cpu_temp(self): - return CPUTemperature().temperature \ No newline at end of file diff --git a/ohmpi/hardware_components/raspberry_pi_modbus.py b/ohmpi/hardware_components/raspberry_pi_modbus.py deleted file mode 100644 index b6e4fb0ef28da2e9f258132bd8345ff1e5e9355b..0000000000000000000000000000000000000000 --- a/ohmpi/hardware_components/raspberry_pi_modbus.py +++ /dev/null @@ -1,38 +0,0 @@ -from ohmpi.hardware_components import CtlAbstract -from ohmpi.config import HARDWARE_CONFIG -import board # noqa -import busio # noqa -import os -from ohmpi.utils import get_platform -from gpiozero import CPUTemperature # noqa -import minimalmodbus # noqa - - -class Ctl(CtlAbstract): - def __init__(self, **kwargs): - kwargs.update({'board_name': os.path.basename(__file__).rstrip('.py')}) - baudrate = kwargs.pop('baudrate', 9600) - bitesize = kwargs.pop('bitesize', 8) - timeout = kwargs.pop('timeout', 1) - debug = kwargs.pop('debug', False) - parity = kwargs.pop('parity', 'N') - mode = kwargs.pop('mode', minimalmodbus.MODE_RTU) - port = kwargs.pop('port', '/dev/ttyUSB0') - slave_address = kwargs.pop('slave_address', 1) - super().__init__(**kwargs) - self.bus = minimalmodbus.Instrument(port=port, slaveaddress=slave_address) # port name, address (decimal) - self.bus.serial.baudrate = baudrate # Baud rate 9600 as listed in doc - self.bus.serial.bytesize = bitesize # - self.bus.serial.timeout = timeout # greater than 0.5 for it to work - self.bus.debug = debug # - self.bus.serial.parity = parity # No parity - self.bus.mode = mode # RTU mode - platform, on_pi = get_platform() - assert on_pi - self.board_name = platform - self._cpu_temp_available = True - self.max_cpu_temp = 85. # °C - - @property - def _cpu_temp(self): - return CPUTemperature().temperature