Config File Format

Format

The config file is written in YAML syntax.

The file contains a YAML-dictionary with two predefined keywords:

  • mqtt
  • database

MQTT Section

This section starts with the YAML-key mqtt and contains a list of MQTT-Brokers:

mqtt:
 - host: iot.eclipse.org
   port: 1883
   prefix: 'clt2020/thlog'
   info_topic: 'clt2020/thlog/+/info'
   data_topic: 'clt2020/thlog/+/data'
 - host: test.mosquitto.org
   port: 1883
   prefix: 'aw/thlog'
   info_topic: 'aw/thlog/+/info'
   data_topic: 'aw/thlog/+/data'

Each configured MQTT broker requires a YAML structure with the following keys:

host:

hostname or IP address of the broker

port:

portnumber of the mqtt service (1883 unencrypted, 3883 TLS secured)

info_topic:

the topic where the nodes publish their description information

data_topic:

the topic where the nodes publish their sensor data

prefix:

Todo

check if still used.

Database section

This section starts with the YAML-key database and requires the dbtype key:

database:
    dbtype: {sqlite|mysql}

The rest of the data-structure depends on the database type used.

SQLITE Database

The SQLITE DB is configured as follows:

database:
    dbtype: sqlite
    dbname:  /tmp/rsensor/rsensor.sqlitedb
dbtype:sqlite
dbname:the path and name of the SQLITE-file

If dbname refers to a file that not exists, the file, including a none existing directory, is created and initialized as sqlite database.

The data in the sqlite database can be accessed with the command:

sqlite3  /tmp/rsensor/rsensor.sqlitedb
sqlite> .tables
locations   nodes       sensors     timeseries

More details about how to work with this DB refer to section SQlite Commands.

MySQL Database