Settings

The acquisition settings are given in a the python file settings.py that must be present in the same folder as raspardas.py.

IMPORTS

A typical settings.py will start with an import section.

from ardas import sensor_tools as st

SENSORS

The next section is a tuple of sensors objects named SENSORS. The recommended way is to save the sensor object as a sensor####.ssr file where #### stands for the sensor id (usually a four digit number). Then the load_sensor method is used to create the sensor objects.

# ArDAS sensors objects connected to the ArDAS channels
SENSORS = (st.load_sensor('0001'), st.load_sensor('0002'), st.load_sensor('0003'), st.load_sensor('0004'))

Then several dictionaries define the settings :

DATABASE

This section gives the settings of the InfluxDB where the output of the sensors will be stored.

# connexion to InfluxDB
DATABASE = {
    'host': '*hostname.domain*',
    'port': 8086,
    'user': '*user_name*',
    'password': '*password*',
    'dbname': '*database_name*',
    'series': '*series_name*'
}

ARDAS

In this section the settings of the ArDAS are given.

# ArDAS configuration
ARDAS_CONFIG = {
    'station': '0001',
    'net_id': '001',
    'shield_id': '001',
    'integration_period': '0001',
    'tty': '/dev/ttyACM0',
    'raw_data_on_disk': False
}

MASTER

This section lists the settings used to setup a remote connection (i.e. over a telnet connection)

# connection to master
MASTER_CONFIG = {
    'local_host': '0.0.0.0',
    'local_port': *port_number*

MESSAGES LOGGING

These settings control how the messages generated by raspardas.py are logged.

# messages logging configuration
LOGGING_CONFIG ={
    'debug_mode': False,
    'logging_to_console': False,
    'file_name': 'raspardas_log',
    'max_bytes': 262144,
    'backup_count': 30,
    'when': 'd',
    'interval': 1
}

DATA LOGGING

These settings control how the data are logged locally.

# data logging configuration
DATA_LOGGING_CONFIG ={
    'file_name': 'data_log',
    'max_bytes': 1048576,
    'backup_count': 1024,
    'when': 'd',
    'interval': 1,
    'influxdb_logging': True
}

SFTP

These settings are used to define how to transfer updates of raspardas.py to the raspberry_pi (remote).

# parameters to push code to raspberry via sftp_transfer.py
SFTP = {
    'host': '*name_of_the_raspberry_pi',
    'username': '*username_for_raspberry_pi_login*',
    'password': '*password_for_raspberry_pi_login*',
    'local_path': '*path_to_local_file*',
    'remote_path': '*path_to_remote_file*'
}