master
Small IoT-Gateway/Sensor example
MQTT communication overview
- All nodes periodically publish their data to the topic
evt/status/json - All nodes subscribe to the wildcard topic
cmd/+/jsonto receive the following types of commands:cmd/toggle/jsonto enable or disable the periodic publishing.cmd/interval/jsonto set the publishing interval in seconds.
To simulate in Cooja:
- Add one gateway node and several sensor nodes in a mesh network.
- Open a Serial Socket (SERVER) on the gateway node and start listening on port 60001.
- Connect to that serial socket from the host using tunslip6:
$PATH_TO_TUNSLIP6$/tunslip6 -a 127.0.0.1 fd00::1/64 - Start a mosquitto broker on the host:
mosquitto -v - Start the mqtt subscriber on the host:
python3 subscriber.py(Requirespaho-mqtt) - Start the simulation.
Languages
C
94.3%
Makefile
3.1%
Python
2.6%