In TDM Edge Gateway Reference Architecture the handler of the remote weather station is named Feinstaub Publisher after the name of the weather and air quality station adopted.
Since this station sends its data via WiFi in a format and protocol suitable for ingestion in an InfluxDB database, the handler simulates a listening InfluxDB server and intercepts the incoming data.
These data are then entered into the local InfluxDB database for subsequent consultation by the other microservices and at the same time converted into a standard message that is sent to the local MQTT broker for event management or forwarding to the outside.
Settings are retrieved from both configuration file and command line. Values are applied in the following order, the last overwriting the previous:
- configuration file section 'GENERAL' for the common options (logging, local MQTT broker...);
- configuration file section 'FEINSTAUB_publisher' for both common and specific options;
- command line options.
The options mqtt_host and mqtt_port now are deprecated and no longer recognized. mqtt_local_host and mqtt_local_port must be used instead.
-
mqtt_local_host
hostname or address of the local broker (default: localhost)
-
mqtt_local_port
port of the local broker (default: 1883)
-
logging_level
threshold level for log messages (default: 20)
-
influxdb_host
hostname or address of the influx database (default: localhost)
-
influxdb_port
port of the influx database (default: 8086)
-
influxdb_db
the name of the influx database to use (default: luftdaten)
-
gps_location
GPS coordinates of the sensor as latitude,longitude (default: 0.0,0.0)
When a settings is present both in the GENERAL and application specific section, the application specific is applied to the specific handler.
- mqtt_local_host
- mqtt_local_port
- influxdb_host
- influxdb_port
- logging_level
- gps_location
In this example, the logging_level settings is overwritten to 1 only for this handler, while other handlers use 0 from the section GENERAL:
[GENERAL]
mqtt_local_host = mosquitto
mqtt_local_port = 1883
influxdb_host = influxdb
influxdb_port = 8086
gps_location=0.0,0.0
logging_level = 0
[FEINSTAUB_publisher]
logging_level = 1
-
-h, --help
show this help message and exit
-
-c FILE, --config-file FILE
specify the config file
-
-l LOGGING_LEVEL, --logging-level LOGGING_LEVEL
threshold level for log messages (default: 20)
-
--mqtt-host MQTT_HOST
hostname or address of the local broker (default: localhost)
-
--mqtt-port MQTT_PORT
port of the local broker (default: 1883)
-
--i2c-bus I2C_BUS
I2C bus number to which the sensor is attached (default: 1)
-
--interval INTERVAL
interval in seconds for data acquisition and publication (default: 60 secs)
-
--influxdb-host INFLUXDB_HOST
hostname or address of the influx database (default: localhost)
-
--influxdb-port INFLUXDB_PORT
port of the influx database (default: 8086)
-
--influxdb-db INFLUXDB_DB
name of the database to use (default: luftdaten)
-
--gps-location GPS_LOCATION
GPS coordinates of the sensor as latitude,longitude (default: 0.0,0.0)