From e287e03feda2f626c9bd5e44e3f7924e26290738 Mon Sep 17 00:00:00 2001 From: su530201 <olivier.kaufmann@umons.ac.be> Date: Thu, 1 Feb 2024 10:01:06 +0100 Subject: [PATCH] Adds auto-generated configs --- configs/config_mb_2023.py | 22 +- configs/config_mb_2023__1_mux_2024_4roles.py | 40 +-- configs/config_mb_2023__2_mux_2024_2roles.py | 60 ++-- configs/config_mb_2023__2_mux_2024_4roles.py | 54 ++-- configs/config_mb_2023__3_mux_2024_4roles.py | 68 ++-- configs/config_mb_2023__4_mux_2023.py | 68 ++-- configs/config_mb_2023__4_mux_2024_2roles.py | 90 +++--- configs/config_mb_2023__4_mux_2024_4roles.py | 82 ++--- configs/config_mb_2024_0_2.py | 24 +- .../config_mb_2024_0_2__1_mux_2024_4roles.py | 42 +-- ..._mb_2024_0_2__1_mux_2024_4roles_dps5005.py | 42 +-- .../config_mb_2024_0_2__2_mux_2024_2roles.py | 62 ++-- ..._mb_2024_0_2__2_mux_2024_2roles_dps5005.py | 62 ++-- .../config_mb_2024_0_2__2_mux_2024_4roles.py | 56 ++-- ..._mb_2024_0_2__2_mux_2024_4roles_dps5005.py | 56 ++-- .../config_mb_2024_0_2__3_mux_2024_4roles.py | 70 ++-- ..._mb_2024_0_2__3_mux_2024_4roles_dps5005.py | 70 ++-- configs/config_mb_2024_0_2__4_mux_2023.py | 70 ++-- .../config_mb_2024_0_2__4_mux_2023_dps5005.py | 70 ++-- .../config_mb_2024_0_2__4_mux_2024_2roles.py | 92 +++--- ..._mb_2024_0_2__4_mux_2024_2roles_dps5005.py | 92 +++--- .../config_mb_2024_0_2__4_mux_2024_4roles.py | 84 ++--- ..._mb_2024_0_2__4_mux_2024_4roles_dps5005.py | 84 ++--- configs/config_mb_2024_0_2_dps5005.py | 24 +- ohmpi/utils.py | 305 +++++++++++++++++- 25 files changed, 1046 insertions(+), 743 deletions(-) diff --git a/configs/config_mb_2023.py b/configs/config_mb_2023.py index 8c239051..b083d845 100644 --- a/configs/config_mb_2023.py +++ b/configs/config_mb_2023.py @@ -27,19 +27,19 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2023_0_X', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c' - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c' + }, 'rx': {'model': 'mb_2023_0_X', - 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V - 'sampling_rate': 50., # number of samples per second - 'interface_name': 'i2c', - }, + 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V + 'sampling_rate': 50., # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {}, - 'default': {} - } + 'default': {} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2023__1_mux_2024_4roles.py b/configs/config_mb_2023__1_mux_2024_4roles.py index c680e787..fe490e09 100644 --- a/configs/config_mb_2023__1_mux_2024_4roles.py +++ b/configs/config_mb_2023__1_mux_2024_4roles.py @@ -27,30 +27,30 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2023_0_X', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c' - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c' + }, 'rx': {'model': 'mb_2023_0_X', - 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V - 'sampling_rate': 50., # number of samples per second - 'interface_name': 'i2c', - }, + 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V + 'sampling_rate': 50., # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {'mux_01': - {'model': 'mux_2024_0_X', - 'electrodes': range(1, 9), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, }, - 'default': {'interface_name': 'i2c', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2023__2_mux_2024_2roles.py b/configs/config_mb_2023__2_mux_2024_2roles.py index dfe1e8f5..744b4037 100644 --- a/configs/config_mb_2023__2_mux_2024_2roles.py +++ b/configs/config_mb_2023__2_mux_2024_2roles.py @@ -27,40 +27,40 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2023_0_X', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c' - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c' + }, 'rx': {'model': 'mb_2023_0_X', - 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V - 'sampling_rate': 50., # number of samples per second - 'interface_name': 'i2c', - }, + 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V + 'sampling_rate': 50., # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': - 'mux_01': - {'model': 'mux_2024_0_X', - 'roles': ['A', 'B'], - 'electrodes': range(1, 17), - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0, - }, + {'mux_01': + {'model': 'mux_2024_0_X', + 'roles': ['A', 'B'], + 'electrodes': range(1, 17), + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0, + }, 'mux_02': - {'model': 'mux_2024_0_X', - 'roles': ['M', 'N'], - 'electrodes': range(1, 17), - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0, - }, + {'model': 'mux_2024_0_X', + 'roles': ['M', 'N'], + 'electrodes': range(1, 17), + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0, + }, }, - 'default': {'interface_name': 'i2c', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2023__2_mux_2024_4roles.py b/configs/config_mb_2023__2_mux_2024_4roles.py index d017474d..ffa2f336 100644 --- a/configs/config_mb_2023__2_mux_2024_4roles.py +++ b/configs/config_mb_2023__2_mux_2024_4roles.py @@ -27,38 +27,38 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2023_0_X', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c' - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c' + }, 'rx': {'model': 'mb_2023_0_X', - 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V - 'sampling_rate': 50., # number of samples per second - 'interface_name': 'i2c', - }, + 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V + 'sampling_rate': 50., # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {'mux_01': - {'model': 'mux_2024_0_X', - 'electrodes': range(1, 9), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_02': - {'model': 'mux_2024_0_X', - 'electrodes': range(9, 17), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(9, 17), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, }, - 'default': {'interface_name': 'i2c', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2023__3_mux_2024_4roles.py b/configs/config_mb_2023__3_mux_2024_4roles.py index 8ddcb1fd..1d4415c4 100644 --- a/configs/config_mb_2023__3_mux_2024_4roles.py +++ b/configs/config_mb_2023__3_mux_2024_4roles.py @@ -27,46 +27,46 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2023_0_X', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c' - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c' + }, 'rx': {'model': 'mb_2023_0_X', - 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V - 'sampling_rate': 50., # number of samples per second - 'interface_name': 'i2c', - }, + 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V + 'sampling_rate': 50., # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {'mux_01': - {'model': 'mux_2024_0_X', - 'electrodes': range(1, 9), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_02': - {'model': 'mux_2024_0_X', - 'electrodes': range(9, 17), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(9, 17), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_03': - {'model': 'mux_2024_0_X', - 'electrodes': range(17, 25), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(17, 25), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,}, }, - 'default': {'interface_name': 'i2c', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2023__4_mux_2023.py b/configs/config_mb_2023__4_mux_2023.py index 1cdb3337..d087bc46 100644 --- a/configs/config_mb_2023__4_mux_2023.py +++ b/configs/config_mb_2023__4_mux_2023.py @@ -27,46 +27,46 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2023_0_X', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c' - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c' + }, 'rx': {'model': 'mb_2023_0_X', - 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V - 'sampling_rate': 50., # number of samples per second - 'interface_name': 'i2c', - }, + 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V + 'sampling_rate': 50., # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': - 'mux_A': - {'model': 'mux_2023_0_X', - 'mux_tca_address': 0x70, - 'roles': 'A', - 'electrodes': range(1, 65), - }, + {'mux_A': + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x70, + 'roles': 'A', + 'electrodes': range(1, 65), + }, 'mux_B': - {'model': 'mux_2023_0_X', - 'mux_tca_address': 0x71, - 'roles': 'B', - 'electrodes': range(1, 65), - }, + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x71, + 'roles': 'B', + 'electrodes': range(1, 65), + }, 'mux_M': - {'model': 'mux_2023_0_X', - 'mux_tca_address': 0x72, - 'roles': 'M', - 'electrodes': range(1, 65), - }, + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x72, + 'roles': 'M', + 'electrodes': range(1, 65), + }, 'mux_N': - {'model': 'mux_2023_0_X', - 'mux_tca_address': 0x73, - 'roles': 'N', - 'electrodes': range(1, 65), - } + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x73, + 'roles': 'N', + 'electrodes': range(1, 65), + } }, - 'default': {'interface_name': 'i2c', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2023__4_mux_2024_2roles.py b/configs/config_mb_2023__4_mux_2024_2roles.py index 41a3821a..ef9c9955 100644 --- a/configs/config_mb_2023__4_mux_2024_2roles.py +++ b/configs/config_mb_2023__4_mux_2024_2roles.py @@ -27,57 +27,57 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2023_0_X', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c' - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c' + }, 'rx': {'model': 'mb_2023_0_X', - 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V - 'sampling_rate': 50., # number of samples per second - 'interface_name': 'i2c', - }, + 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V + 'sampling_rate': 50., # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': - 'mux_01': - {'model': 'mux_2024_0_X', - 'roles': ['A', 'B'], - 'electrodes': range(1, 17), - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0, - }, + {'mux_01': + {'model': 'mux_2024_0_X', + 'roles': ['A', 'B'], + 'electrodes': range(1, 17), + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0, + }, 'mux_02': - {'model': 'mux_2024_0_X', - 'roles': ['M', 'N'], - 'electrodes': range(1, 17), - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0, - }, + {'model': 'mux_2024_0_X', + 'roles': ['M', 'N'], + 'electrodes': range(1, 17), + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0, + }, 'mux_03': - {'model': 'mux_2024_0_X', - 'roles': ['A', 'B'], - 'electrodes': range(17, 33), - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'roles': ['A', 'B'], + 'electrodes': range(17, 33), + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_04': - {'model': 'mux_2024_0_X', - 'roles': ['M', 'N'], - 'electrodes': range(17, 33), - 'addr1': 'down', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0, - } + {'model': 'mux_2024_0_X', + 'roles': ['M', 'N'], + 'electrodes': range(17, 33), + 'addr1': 'down', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0, + } }, - 'default': {'interface_name': 'i2c', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2023__4_mux_2024_4roles.py b/configs/config_mb_2023__4_mux_2024_4roles.py index 9b7811cb..3275eaca 100644 --- a/configs/config_mb_2023__4_mux_2024_4roles.py +++ b/configs/config_mb_2023__4_mux_2024_4roles.py @@ -27,54 +27,54 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2023_0_X', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c' - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c' + }, 'rx': {'model': 'mb_2023_0_X', - 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V - 'sampling_rate': 50., # number of samples per second - 'interface_name': 'i2c', - }, + 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V + 'sampling_rate': 50., # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {'mux_01': - {'model': 'mux_2024_0_X', - 'electrodes': range(1, 9), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_02': - {'model': 'mux_2024_0_X', - 'electrodes': range(9, 17), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(9, 17), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_03': - {'model': 'mux_2024_0_X', - 'electrodes': range(17, 25), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(17, 25), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_04': - {'model': 'mux_2024_0_X', - 'electrodes': range(25, 33), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'down', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(25, 33), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,}, }, - 'default': {'interface_name': 'i2c', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2.py b/configs/config_mb_2024_0_2.py index c50c780b..fe49f9aa 100644 --- a/configs/config_mb_2024_0_2.py +++ b/configs/config_mb_2024_0_2.py @@ -27,20 +27,20 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {}, - 'default': {} - } + 'default': {} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__1_mux_2024_4roles.py b/configs/config_mb_2024_0_2__1_mux_2024_4roles.py index 0cea418e..15260595 100644 --- a/configs/config_mb_2024_0_2__1_mux_2024_4roles.py +++ b/configs/config_mb_2024_0_2__1_mux_2024_4roles.py @@ -27,31 +27,31 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {'mux_01': - {'model': 'mux_2024_0_X', - 'electrodes': range(1, 9), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__1_mux_2024_4roles_dps5005.py b/configs/config_mb_2024_0_2__1_mux_2024_4roles_dps5005.py index 5f5e892c..9b243ab8 100644 --- a/configs/config_mb_2024_0_2__1_mux_2024_4roles_dps5005.py +++ b/configs/config_mb_2024_0_2__1_mux_2024_4roles_dps5005.py @@ -27,31 +27,31 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_dps5005', 'voltage': 3., 'interface_name': 'modbus'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {'mux_01': - {'model': 'mux_2024_0_X', - 'electrodes': range(1, 9), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__2_mux_2024_2roles.py b/configs/config_mb_2024_0_2__2_mux_2024_2roles.py index 4f20345a..3d7154c2 100644 --- a/configs/config_mb_2024_0_2__2_mux_2024_2roles.py +++ b/configs/config_mb_2024_0_2__2_mux_2024_2roles.py @@ -27,41 +27,41 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': - 'mux_01': - {'model': 'mux_2024_0_X', - 'roles': ['A', 'B'], - 'electrodes': range(1, 17), - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0, - }, + {'mux_01': + {'model': 'mux_2024_0_X', + 'roles': ['A', 'B'], + 'electrodes': range(1, 17), + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0, + }, 'mux_02': - {'model': 'mux_2024_0_X', - 'roles': ['M', 'N'], - 'electrodes': range(1, 17), - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0, - }, + {'model': 'mux_2024_0_X', + 'roles': ['M', 'N'], + 'electrodes': range(1, 17), + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0, + }, }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__2_mux_2024_2roles_dps5005.py b/configs/config_mb_2024_0_2__2_mux_2024_2roles_dps5005.py index d676bf13..ce6606bf 100644 --- a/configs/config_mb_2024_0_2__2_mux_2024_2roles_dps5005.py +++ b/configs/config_mb_2024_0_2__2_mux_2024_2roles_dps5005.py @@ -27,41 +27,41 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_dps5005', 'voltage': 3., 'interface_name': 'modbus'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': - 'mux_01': - {'model': 'mux_2024_0_X', - 'roles': ['A', 'B'], - 'electrodes': range(1, 17), - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0, - }, + {'mux_01': + {'model': 'mux_2024_0_X', + 'roles': ['A', 'B'], + 'electrodes': range(1, 17), + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0, + }, 'mux_02': - {'model': 'mux_2024_0_X', - 'roles': ['M', 'N'], - 'electrodes': range(1, 17), - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0, - }, + {'model': 'mux_2024_0_X', + 'roles': ['M', 'N'], + 'electrodes': range(1, 17), + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0, + }, }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__2_mux_2024_4roles.py b/configs/config_mb_2024_0_2__2_mux_2024_4roles.py index e762d930..78903cd0 100644 --- a/configs/config_mb_2024_0_2__2_mux_2024_4roles.py +++ b/configs/config_mb_2024_0_2__2_mux_2024_4roles.py @@ -27,39 +27,39 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {'mux_01': - {'model': 'mux_2024_0_X', - 'electrodes': range(1, 9), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_02': - {'model': 'mux_2024_0_X', - 'electrodes': range(9, 17), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(9, 17), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__2_mux_2024_4roles_dps5005.py b/configs/config_mb_2024_0_2__2_mux_2024_4roles_dps5005.py index 0c87093c..308cf8f1 100644 --- a/configs/config_mb_2024_0_2__2_mux_2024_4roles_dps5005.py +++ b/configs/config_mb_2024_0_2__2_mux_2024_4roles_dps5005.py @@ -27,39 +27,39 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_dps5005', 'voltage': 3., 'interface_name': 'modbus'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {'mux_01': - {'model': 'mux_2024_0_X', - 'electrodes': range(1, 9), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_02': - {'model': 'mux_2024_0_X', - 'electrodes': range(9, 17), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(9, 17), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__3_mux_2024_4roles.py b/configs/config_mb_2024_0_2__3_mux_2024_4roles.py index 76b13766..038e010e 100644 --- a/configs/config_mb_2024_0_2__3_mux_2024_4roles.py +++ b/configs/config_mb_2024_0_2__3_mux_2024_4roles.py @@ -27,47 +27,47 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {'mux_01': - {'model': 'mux_2024_0_X', - 'electrodes': range(1, 9), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_02': - {'model': 'mux_2024_0_X', - 'electrodes': range(9, 17), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(9, 17), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_03': - {'model': 'mux_2024_0_X', - 'electrodes': range(17, 25), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(17, 25), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,}, }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__3_mux_2024_4roles_dps5005.py b/configs/config_mb_2024_0_2__3_mux_2024_4roles_dps5005.py index c18fd070..bf36420f 100644 --- a/configs/config_mb_2024_0_2__3_mux_2024_4roles_dps5005.py +++ b/configs/config_mb_2024_0_2__3_mux_2024_4roles_dps5005.py @@ -27,47 +27,47 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_dps5005', 'voltage': 3., 'interface_name': 'modbus'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {'mux_01': - {'model': 'mux_2024_0_X', - 'electrodes': range(1, 9), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_02': - {'model': 'mux_2024_0_X', - 'electrodes': range(9, 17), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(9, 17), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_03': - {'model': 'mux_2024_0_X', - 'electrodes': range(17, 25), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(17, 25), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,}, }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__4_mux_2023.py b/configs/config_mb_2024_0_2__4_mux_2023.py index a6605872..9d226ec5 100644 --- a/configs/config_mb_2024_0_2__4_mux_2023.py +++ b/configs/config_mb_2024_0_2__4_mux_2023.py @@ -27,47 +27,47 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': - 'mux_A': - {'model': 'mux_2023_0_X', - 'mux_tca_address': 0x70, - 'roles': 'A', - 'electrodes': range(1, 65), - }, + {'mux_A': + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x70, + 'roles': 'A', + 'electrodes': range(1, 65), + }, 'mux_B': - {'model': 'mux_2023_0_X', - 'mux_tca_address': 0x71, - 'roles': 'B', - 'electrodes': range(1, 65), - }, + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x71, + 'roles': 'B', + 'electrodes': range(1, 65), + }, 'mux_M': - {'model': 'mux_2023_0_X', - 'mux_tca_address': 0x72, - 'roles': 'M', - 'electrodes': range(1, 65), - }, + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x72, + 'roles': 'M', + 'electrodes': range(1, 65), + }, 'mux_N': - {'model': 'mux_2023_0_X', - 'mux_tca_address': 0x73, - 'roles': 'N', - 'electrodes': range(1, 65), - } + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x73, + 'roles': 'N', + 'electrodes': range(1, 65), + } }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__4_mux_2023_dps5005.py b/configs/config_mb_2024_0_2__4_mux_2023_dps5005.py index 16a2af4b..f4117794 100644 --- a/configs/config_mb_2024_0_2__4_mux_2023_dps5005.py +++ b/configs/config_mb_2024_0_2__4_mux_2023_dps5005.py @@ -27,47 +27,47 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_dps5005', 'voltage': 3., 'interface_name': 'modbus'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': - 'mux_A': - {'model': 'mux_2023_0_X', - 'mux_tca_address': 0x70, - 'roles': 'A', - 'electrodes': range(1, 65), - }, + {'mux_A': + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x70, + 'roles': 'A', + 'electrodes': range(1, 65), + }, 'mux_B': - {'model': 'mux_2023_0_X', - 'mux_tca_address': 0x71, - 'roles': 'B', - 'electrodes': range(1, 65), - }, + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x71, + 'roles': 'B', + 'electrodes': range(1, 65), + }, 'mux_M': - {'model': 'mux_2023_0_X', - 'mux_tca_address': 0x72, - 'roles': 'M', - 'electrodes': range(1, 65), - }, + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x72, + 'roles': 'M', + 'electrodes': range(1, 65), + }, 'mux_N': - {'model': 'mux_2023_0_X', - 'mux_tca_address': 0x73, - 'roles': 'N', - 'electrodes': range(1, 65), - } + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x73, + 'roles': 'N', + 'electrodes': range(1, 65), + } }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__4_mux_2024_2roles.py b/configs/config_mb_2024_0_2__4_mux_2024_2roles.py index c7b42fd4..3964999e 100644 --- a/configs/config_mb_2024_0_2__4_mux_2024_2roles.py +++ b/configs/config_mb_2024_0_2__4_mux_2024_2roles.py @@ -27,58 +27,58 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': - 'mux_01': - {'model': 'mux_2024_0_X', - 'roles': ['A', 'B'], - 'electrodes': range(1, 17), - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0, - }, + {'mux_01': + {'model': 'mux_2024_0_X', + 'roles': ['A', 'B'], + 'electrodes': range(1, 17), + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0, + }, 'mux_02': - {'model': 'mux_2024_0_X', - 'roles': ['M', 'N'], - 'electrodes': range(1, 17), - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0, - }, + {'model': 'mux_2024_0_X', + 'roles': ['M', 'N'], + 'electrodes': range(1, 17), + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0, + }, 'mux_03': - {'model': 'mux_2024_0_X', - 'roles': ['A', 'B'], - 'electrodes': range(17, 33), - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'roles': ['A', 'B'], + 'electrodes': range(17, 33), + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_04': - {'model': 'mux_2024_0_X', - 'roles': ['M', 'N'], - 'electrodes': range(17, 33), - 'addr1': 'down', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0, - } + {'model': 'mux_2024_0_X', + 'roles': ['M', 'N'], + 'electrodes': range(17, 33), + 'addr1': 'down', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0, + } }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__4_mux_2024_2roles_dps5005.py b/configs/config_mb_2024_0_2__4_mux_2024_2roles_dps5005.py index 01e6f769..ca363d44 100644 --- a/configs/config_mb_2024_0_2__4_mux_2024_2roles_dps5005.py +++ b/configs/config_mb_2024_0_2__4_mux_2024_2roles_dps5005.py @@ -27,58 +27,58 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_dps5005', 'voltage': 3., 'interface_name': 'modbus'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': - 'mux_01': - {'model': 'mux_2024_0_X', - 'roles': ['A', 'B'], - 'electrodes': range(1, 17), - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0, - }, + {'mux_01': + {'model': 'mux_2024_0_X', + 'roles': ['A', 'B'], + 'electrodes': range(1, 17), + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0, + }, 'mux_02': - {'model': 'mux_2024_0_X', - 'roles': ['M', 'N'], - 'electrodes': range(1, 17), - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0, - }, + {'model': 'mux_2024_0_X', + 'roles': ['M', 'N'], + 'electrodes': range(1, 17), + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0, + }, 'mux_03': - {'model': 'mux_2024_0_X', - 'roles': ['A', 'B'], - 'electrodes': range(17, 33), - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'roles': ['A', 'B'], + 'electrodes': range(17, 33), + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_04': - {'model': 'mux_2024_0_X', - 'roles': ['M', 'N'], - 'electrodes': range(17, 33), - 'addr1': 'down', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0, - } + {'model': 'mux_2024_0_X', + 'roles': ['M', 'N'], + 'electrodes': range(17, 33), + 'addr1': 'down', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0, + } }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__4_mux_2024_4roles.py b/configs/config_mb_2024_0_2__4_mux_2024_4roles.py index ffbca77a..e2610c36 100644 --- a/configs/config_mb_2024_0_2__4_mux_2024_4roles.py +++ b/configs/config_mb_2024_0_2__4_mux_2024_4roles.py @@ -27,55 +27,55 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {'mux_01': - {'model': 'mux_2024_0_X', - 'electrodes': range(1, 9), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_02': - {'model': 'mux_2024_0_X', - 'electrodes': range(9, 17), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(9, 17), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_03': - {'model': 'mux_2024_0_X', - 'electrodes': range(17, 25), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(17, 25), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_04': - {'model': 'mux_2024_0_X', - 'electrodes': range(25, 33), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'down', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(25, 33), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,}, }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2__4_mux_2024_4roles_dps5005.py b/configs/config_mb_2024_0_2__4_mux_2024_4roles_dps5005.py index 7eaa1a72..0e152d39 100644 --- a/configs/config_mb_2024_0_2__4_mux_2024_4roles_dps5005.py +++ b/configs/config_mb_2024_0_2__4_mux_2024_4roles_dps5005.py @@ -27,55 +27,55 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_dps5005', 'voltage': 3., 'interface_name': 'modbus'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {'mux_01': - {'model': 'mux_2024_0_X', - 'electrodes': range(1, 9), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_02': - {'model': 'mux_2024_0_X', - 'electrodes': range(9, 17), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'down', - 'addr2': 'up', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(9, 17), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_03': - {'model': 'mux_2024_0_X', - 'electrodes': range(17, 25), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'up', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(17, 25), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,}, 'mux_04': - {'model': 'mux_2024_0_X', - 'electrodes': range(25, 33), - 'roles': ['A', 'B', 'M', 'N'], - 'addr1': 'down', - 'addr2': 'down', - 'tca_address': None, - 'tca_channel': 0,}, + {'model': 'mux_2024_0_X', + 'electrodes': range(25, 33), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,}, }, - 'default': {'interface_name': 'i2c_ext', - 'voltage_max': 50., - 'current_max': 3.} - } + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/configs/config_mb_2024_0_2_dps5005.py b/configs/config_mb_2024_0_2_dps5005.py index 157e35b0..53975cc4 100644 --- a/configs/config_mb_2024_0_2_dps5005.py +++ b/configs/config_mb_2024_0_2_dps5005.py @@ -27,20 +27,20 @@ HARDWARE_CONFIG = { 'ctl': {'model': 'raspberry_pi'}, 'pwr': {'model': 'pwr_dps5005', 'voltage': 3., 'interface_name': 'modbus'}, 'tx': {'model': 'mb_2024_0_2', - 'voltage_max': 50., # Maximum voltage supported by the TX board [V] - 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] - 'r_shunt': r_shunt, # Shunt resistance in Ohms - 'interface_name': 'i2c', - 'vmn_hardware_offset': 2500. - }, + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }, 'rx': {'model': 'mb_2024_0_2', - 'latency': 0.010, # latency in seconds in continuous mode - 'sampling_rate': 50, # number of samples per second - 'interface_name': 'i2c', - }, + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }, 'mux': {'boards': {}, - 'default': {} - } + 'default': {} + } } # SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS # Execution logging configuration diff --git a/ohmpi/utils.py b/ohmpi/utils.py index c1c45595..6b3d4eb1 100644 --- a/ohmpi/utils.py +++ b/ohmpi/utils.py @@ -130,6 +130,7 @@ def mux_2024_to_mux_2023_takeouts(elec_list): return np.vectorize(mapper.get)(elec_list) + def mux_2023_to_mux_2024_takeouts(elec_list): """ Updates cabling for mux v2023 so that takeouts are similar to takeouts from mux v2024. This is only useful when replacing mux v2023 installations or re-using old test circuits. @@ -143,4 +144,306 @@ def mux_2023_to_mux_2024_takeouts(elec_list): mapper = { 1: 2, 2: 4, 3: 6, 4: 8, 5: 10, 6: 12, 7: 14, 8: 16, 9: 15, 10: 13, 11: 11, 12: 9, 13: 7, 14: 5, 15: 3, 16: 1,} - return np.vectorize(mapper.get)(elec_list) \ No newline at end of file + return np.vectorize(mapper.get)(elec_list) + + +def generate_preset_configs(configs_to_generate=None): + """ Generates preset configuration files + + Parameters + ---------- + configs_to_generate: list, None default: None + list of configuration names following the standard pattern + """ + + if configs_to_generate is None: + configs_to_generate = ['config_mb_2023.py', 'config_mb_2023__4_mux_2023.py', + 'config_mb_2023__1_mux_2024_4roles.py', 'config_mb_2023__2_mux_2024_4roles.py', + 'config_mb_2023__3_mux_2024_4roles.py', 'config_mb_2023__4_mux_2024_4roles.py', + 'config_mb_2023__2_mux_2024_2roles.py', 'config_mb_2023__4_mux_2024_2roles.py', + 'config_mb_2024_0_2.py', 'config_mb_2024_0_2_dps5005.py', + 'config_mb_2024_0_2__4_mux_2023.py', 'config_mb_2024_0_2__4_mux_2023_dps5005.py', + 'config_mb_2024_0_2__1_mux_2024_4roles.py', + 'config_mb_2024_0_2__1_mux_2024_4roles_dps5005.py', + 'config_mb_2024_0_2__2_mux_2024_4roles.py', + 'config_mb_2024_0_2__2_mux_2024_4roles_dps5005.py', + 'config_mb_2024_0_2__2_mux_2024_2roles.py', + 'config_mb_2024_0_2__2_mux_2024_2roles_dps5005.py', + 'config_mb_2024_0_2__3_mux_2024_4roles.py', + 'config_mb_2024_0_2__3_mux_2024_4roles_dps5005.py', + 'config_mb_2024_0_2__4_mux_2024_4roles.py', + 'config_mb_2024_0_2__4_mux_2024_4roles_dps5005.py', + 'config_mb_2024_0_2__4_mux_2024_2roles.py', + 'config_mb_2024_0_2__4_mux_2024_2roles_dps5005.py' + ] + + header = """import logging +from ohmpi.utils import get_platform +from paho.mqtt.client import MQTTv31 # noqa + +_, on_pi = get_platform() +# DEFINE THE ID OF YOUR OhmPi +ohmpi_id = '0001' if on_pi else 'XXXX' +# DEFINE YOUR MQTT BROKER (DEFAULT: 'localhost') +mqtt_broker = 'localhost' if on_pi else 'NAME_YOUR_BROKER_WHEN_IN_SIMULATION_MODE_HERE' +# DEFINE THE SUFFIX TO ADD TO YOUR LOGS FILES +logging_suffix = '' + +# OhmPi configuration +OHMPI_CONFIG = { + 'id': ohmpi_id, # Unique identifier of the OhmPi board (string) + 'settings': 'ohmpi_settings.json', # INSERT YOUR FAVORITE SETTINGS FILE HERE +} + +r_shunt = 2. + +# default properties of system components that will be +# overwritten by properties defined in each the board dict below. +# if bounds are defined in board specs, values out of specs will be bounded to remain in specs +# omitted properties in config will be set to board specs default values if they exist + +HARDWARE_CONFIG = { + 'ctl': {'model': 'raspberry_pi'}, + 'pwr': """ + + r_shunt = 2. + options = {'pwr': {'battery': """{'model': 'pwr_batt', 'voltage': 12., 'interface_name': 'none'},""", + 'dps5005': """{'model': 'pwr_dps5005', 'voltage': 3., 'interface_name': 'modbus'},""" + }, + 'mb': {'mb_2024_0_2': {'tx': """{'model': 'mb_2024_0_2', + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c', + 'vmn_hardware_offset': 2500. + }""", + 'rx': """{'model': 'mb_2024_0_2', + 'latency': 0.010, # latency in seconds in continuous mode + 'sampling_rate': 50, # number of samples per second + 'interface_name': 'i2c', + }"""}, + 'mb_2023': {'tx': """{'model': 'mb_2023_0_X', + 'voltage_max': 50., # Maximum voltage supported by the TX board [V] + 'current_max': 4.80/(50*r_shunt), # Maximum voltage read by the current ADC on the TX board [A] + 'r_shunt': r_shunt, # Shunt resistance in Ohms + 'interface_name': 'i2c' + }""", + 'rx': """{'model': 'mb_2023_0_X', + 'coef_p2': 2.50, # slope for conversion for ADS, measurement in V/V + 'sampling_rate': 50., # number of samples per second + 'interface_name': 'i2c', + }"""} + }, + 'mux': {'mux_2023': + [""" {'mux_A': + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x70, + 'roles': 'A', + 'electrodes': range(1, 65), + },""", + """\n 'mux_B': + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x71, + 'roles': 'B', + 'electrodes': range(1, 65), + },""", + """\n 'mux_M': + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x72, + 'roles': 'M', + 'electrodes': range(1, 65), + },""", + """\n 'mux_N': + {'model': 'mux_2023_0_X', + 'mux_tca_address': 0x73, + 'roles': 'N', + 'electrodes': range(1, 65), + }"""], + 'mux_2024_2roles': + [""" {'mux_01': + {'model': 'mux_2024_0_X', + 'roles': ['A', 'B'], + 'electrodes': range(1, 17), + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0, + },""", + """\n 'mux_02': + {'model': 'mux_2024_0_X', + 'roles': ['M', 'N'], + 'electrodes': range(1, 17), + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0, + },""", + """\n 'mux_03': + {'model': 'mux_2024_0_X', + 'roles': ['A', 'B'], + 'electrodes': range(17, 33), + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,},""", + """\n 'mux_04': + {'model': 'mux_2024_0_X', + 'roles': ['M', 'N'], + 'electrodes': range(17, 33), + 'addr1': 'down', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0, + }"""], + 'mux_2024_4roles': [ + """ {'mux_01': + {'model': 'mux_2024_0_X', + 'electrodes': range(1, 9), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,},""", + """\n 'mux_02': + {'model': 'mux_2024_0_X', + 'electrodes': range(9, 17), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'up', + 'tca_address': None, + 'tca_channel': 0,},""", + """\n 'mux_03': + {'model': 'mux_2024_0_X', + 'electrodes': range(17, 25), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'up', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,},""", + """\n 'mux_04': + {'model': 'mux_2024_0_X', + 'electrodes': range(25, 33), + 'roles': ['A', 'B', 'M', 'N'], + 'addr1': 'down', + 'addr2': 'down', + 'tca_address': None, + 'tca_channel': 0,},"""] + } + } + mux_footer = {'mb_2023': """\n }, + 'default': {'interface_name': 'i2c', + 'voltage_max': 50., + 'current_max': 3.} + }\n}\n""", + 'mb_2024_0_2': """\n }, + 'default': {'interface_name': 'i2c_ext', + 'voltage_max': 50., + 'current_max': 3.} + }\n}\n"""} + + footer = """# SET THE LOGGING LEVELS, MQTT BROKERS AND MQTT OPTIONS ACCORDING TO YOUR NEEDS +# Execution logging configuration +EXEC_LOGGING_CONFIG = { + 'logging_level': logging.INFO, + 'log_file_logging_level': logging.DEBUG, + 'logging_to_console': True, + 'file_name': f'exec{logging_suffix}.log', + 'max_bytes': 262144, + 'backup_count': 30, + 'when': 'd', + 'interval': 1 +} + +# Data logging configuration +DATA_LOGGING_CONFIG = { + 'logging_level': logging.INFO, + 'logging_to_console': True, + 'file_name': f'data{logging_suffix}.log', + 'max_bytes': 16777216, + 'backup_count': 1024, + 'when': 'd', + 'interval': 1 +} + +# State of Health logging configuration (For a future release) +SOH_LOGGING_CONFIG = { + 'logging_level': logging.INFO, + 'logging_to_console': True, + 'log_file_logging_level': logging.DEBUG, + 'file_name': f'soh{logging_suffix}.log', + 'max_bytes': 16777216, + 'backup_count': 1024, + 'when': 'd', + 'interval': 1 +} + +# MQTT logging configuration parameters +MQTT_LOGGING_CONFIG = { + 'hostname': mqtt_broker, + 'port': 1883, + 'qos': 2, + 'retain': False, + 'keepalive': 60, + 'will': None, + 'auth': {'username': 'mqtt_user', 'password': 'mqtt_password'}, + 'tls': None, + 'protocol': MQTTv31, + 'transport': 'tcp', + 'client_id': f'{OHMPI_CONFIG["id"]}', + 'exec_topic': f'ohmpi_{OHMPI_CONFIG["id"]}/exec', + 'exec_logging_level': logging.DEBUG, + 'data_topic': f'ohmpi_{OHMPI_CONFIG["id"]}/data', + 'data_logging_level': DATA_LOGGING_CONFIG['logging_level'], + 'soh_topic': f'ohmpi_{OHMPI_CONFIG["id"]}/soh', + 'soh_logging_level': SOH_LOGGING_CONFIG['logging_level'] +} + +# MQTT control configuration parameters +MQTT_CONTROL_CONFIG = { + 'hostname': mqtt_broker, + 'port': 1883, + 'qos': 2, + 'retain': False, + 'keepalive': 60, + 'will': None, + 'auth': {'username': 'mqtt_user', 'password': 'mqtt_password'}, + 'tls': None, + 'protocol': MQTTv31, + 'transport': 'tcp', + 'client_id': f'{OHMPI_CONFIG["id"]}', + 'ctrl_topic': f'ohmpi_{OHMPI_CONFIG["id"]}/ctrl' +} +""" + + for mb, v_mb in options['mb'].items(): + for n in range(0, 5): + for mux, v_mux in options['mux'].items(): + for pwr, v_pwr in options['pwr'].items(): + config_filename = f'config_{mb}' + if n > 0: + config_filename += f'__{n}_{mux}' + if pwr != 'battery': + config_filename += f'_{pwr}' + config_filename += '.py' + if config_filename in configs_to_generate: + s = header + s += v_pwr + s += f"\n 'tx': {v_mb['tx']},\n 'rx': {v_mb['rx']},\n" + if n > 0: + s += """ 'mux': {'boards':\n""" + for i in range(n): + print(n, i) + s += v_mux[i] + s += mux_footer[mb] + else: + s = s + """ 'mux': {'boards': {}, + 'default': {} + }\n}""" + '\n' + + s += footer + print(f'*** Preparing {config_filename} ***') + print(f'\n{s}') + with open(f'configs/{config_filename}', mode='wt') as config_file: # TODO: check how to set the path so that this is not dependent of the current directory + config_file.write(s) + else: + print(f'### skipping {config_filename} ###') -- GitLab