@@ -23,38 +23,185 @@ The helper will ask you a few questions and will select the right configuration
...
@@ -23,38 +23,185 @@ The helper will ask you a few questions and will select the right configuration
Still, it is best practice to open the configuration file and check that the parameters are correctly configured.
Still, it is best practice to open the configuration file and check that the parameters are correctly configured.
Updating the configuration file manually is mandatory for custom systems combining different versions of the measurement and MUX boards.
Updating the configuration file manually is mandatory for custom systems combining different versions of the measurement and MUX boards.
.. warning::
One should make sure to understand the parameters before altering them. It is also recommended to keep a copy of the default configuration.
Configuration file structure
Configuration file structure
----------------------------
----------------------------
.. code-block:: python
:caption: Config file 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 = ''
The configuration is written in a python file structured in a series of dictionnaries related to:
The configuration is written in a python file structured in a series of dictionnaries related to:
#. OHMPI_CONFIG: the OhmPi instrument information (id of the instrument and default settings).
#. OHMPI_CONFIG: the OhmPi instrument information (id of the instrument and default settings).
.. code-block:: python
:caption: OhmPi config
# OhmPi configuration
OHMPI_CONFIG = {
'id': ohmpi_id, # Unique identifier of the OhmPi board (string), default = '0001'
'settings': 'ohmpi_settings.json', # INSERT YOUR FAVORITE SETTINGS FILE HERE
}
#. HARDWARE_CONFIG: the hardware system in which the five different modules 'ctl' (controller), 'tx' (transmitter), 'rx' (receiver), 'mux' (multiplexers), 'pwr' (power).
#. HARDWARE_CONFIG: the hardware system in which the five different modules 'ctl' (controller), 'tx' (transmitter), 'rx' (receiver), 'mux' (multiplexers), 'pwr' (power).
.. code-block:: python
:caption: Dictionnary containing the configuration of the hardware system.
r_shunt = 2.
HARDWARE_CONFIG = {
'ctl': {'model': 'raspberry_pi'}, # contains informations related to controller unit, 'raspberry_pi' only implemented so far