Send and receive messages to the control node. Should be used with the code from the iot-lab-gateway repository. Receive measures packets and errors messages from the control node.
Interactions are done through stdin and stdout.
Current received measures types are deducted from commands sent before. Handles packets decoding.
Each output is optional, they can be used together:
-
-c <oml_config_file>: OML files (liboml2), configured by an OML XML file -
-j <stream>=<path>: JSON lines file of a stream, one object per measure. Repeat it for each stream:consumption,radio,event,sniffer. A measure not done (power, voltage or current) is left out of its line.{"timestamp_s":1712345678,"timestamp_us":42,"power":0.25,"voltage":3.25} -
-s <host:port>: JSON lines sent to a TCP socket (a local Fluent Bit), with astreamkey and atimekey (<s>.<us>, the record time) instead oftimestamp_sandtimestamp_us. The socket is non blocking: lines are dropped when it can't take them, the measures and the files are not delayed, the connection is retried every second. Sniffer packets are not streamed.{"stream":"radio","time":"1712345678.000042","channel":21,"rssi":-42} -
-p <period_ms>: downsample the streamed consumption, mean over windows ofperiod_ms(aligned on the epoch, line time: window start). The files keep all the measures, radio and events are streamed as they come. -
-d: print the measures on stderr
The sniffed packets (ZEP v2: header with channel, RSSI, LQI and NTP time, then the 802.15.4 frame) are sent to a TCP client on port 30000. One client at a time, as the serial redirection: while a client is connected, the other connections are refused; the port accepts again when it leaves.
The files are flushed every second, and closed on exit, SIGTERM and SIGINT included.
config_gpio start <gpios> (pps, gpio1, gpio2, comma separated) and
config_gpio stop configure the events of the control node GPIOs. Each event
gives a value (pin level, 1 for the PPS) and a name (pps, gpio1,
gpio2) in the event stream.
Install 'oml' as described in OML.md
Run make test coverage, in the development image:
docker build -t control-node-serial .
docker run --rm --ulimit nofile=1024:1024 -u $(id -u):$(id -g) \
-v $(pwd):/shared control-node-serial make test
Valgrind refuses the default open files limit of Docker: set --ulimit.