Skip to content

Commit

Permalink
v1.1.3.0 - Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kaufmanno committed Jan 19, 2018
1 parent c8b6c24 commit c0c926d
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 16 deletions.
2 changes: 1 addition & 1 deletion ardas/commodore64_sensors_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
s.save()
print('reload sensor...')
s = st.load_sensor('0001')
print(s.sensor_id + ' - ' + s.quantity + ' : ' + s.output_repr(10000) + ' Log:' + str(s.log))
print(s.sensor_id + ' - ' + s.quantity + ' : ' + s.output_repr(10000) + ' Log:' + str(s.log))
2 changes: 1 addition & 1 deletion ardas/raspardas.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@


def init_logging():
global msg_logger, data_logger, logging_level, data_log_filename, debug, client, slave_io
global msg_logger, logging_level, data_log_filename, debug, client, slave_io
""" This is the init sequence for the logging system """

init_logging_status = True
Expand Down
104 changes: 91 additions & 13 deletions docs/source/settings.rst
Original file line number Diff line number Diff line change
@@ -1,42 +1,120 @@
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``
------------

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

::

# connexion to InfluxDB
DATABASE = {
'HOST': '127.0.0.1',
'PORT': 8086,
'USER': 'mydatabaseuser',
'PASSWORD': 'mypassword',
'NAME': 'mydatabase'
'host': '*hostname.domain*',
'port': 8086,
'user': '*user_name*',
'password': '*password*',
'dbname': '*database_name*'
}

``ARDAS``
---------

In this section the settings of the ArDAS are given.

::

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

``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': '127.0.0.1',
'username': 'pi',
'password': '',
'local_path':'/home/username/test.txt',
'remote_path': '/home/pi/remote/test.txt'
'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*'
}

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyserial
pandas
pysftp
ntplib
influxdb

0 comments on commit c0c926d

Please sign in to comment.