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/+/json to receive the following types of commands:
    • cmd/toggle/json to enable or disable the periodic publishing.
    • cmd/interval/json to set the publishing interval in seconds.
To simulate in Cooja:
  1. Add one gateway node and several sensor nodes in a mesh network.
  2. Open a Serial Socket (SERVER) on the gateway node and start listening on port 60001.
  3. Connect to that serial socket from the host using tunslip6: $PATH_TO_TUNSLIP6$/tunslip6 -a 127.0.0.1 fd00::1/64
  4. Start a mosquitto broker on the host: mosquitto -v
  5. Start the mqtt subscriber on the host: python3 subscriber.py (Requires paho-mqtt)
  6. Start the simulation.
S
Description
No description provided
Readme
47 KiB
Languages
C 94.3%
Makefile 3.1%
Python 2.6%