1. Raspberry Pi running MQTT Broker (connected to LAN via WIFI)
2. Arduino Uno With Wifi and a breakout board with LED
3. Linux Mint with:
Node-RED
MQTT Explorer
Python3 MQTT subscribe and publish scripts
4. Windows PC with Arduino IDE
Note:
1. The applications on Linux and the PC can be combined and run on either machine.
2. An ESP32 (microcontroller) can be used instead of an Arduino.
Initially run the tests with one IoT device. Next, use multiple IoT devices (servo motors, LEDs, ...).
MQTT Topic | MQTT Message | Action |
---|---|---|
test/wifi/iot-01 | on | turn on LED |
test/wifi/iot-01 | off | turn off LED |
test/wifi/iot-01 | blink | blink LED on and off |
test/wifi/iot-01 | blink on-duration [off-duration] |
turn LED on for on-duration seconds and off for off-duration seconds
if no off-duration is specified, it defaults to on-duration |
Step | Equipment | Action |
---|---|---|
1 | Linux Mint | run Python MQTT publish and subscribe scripts |
2 | Linux Mint | verify published messages |
3 | Linux Mint | verify subscriptions with MQTT Explorer |
Note: Node-RED can also be used as MQTT publisher and subscriber.
Step | Equipment | Action |
---|---|---|
1 | Arduino | connect Arduino to a PC USB port |
2 | PC | start Arduino IDE and its serial monitor |
3 | Arduino | load appropriate sketch |
4 | Linux Mint | check serial monitor for Arduino MAC address |
Step | Equipment | Action |
---|---|---|
1 | Arduino |
load appropriate sketch (Arduino connected to PC USB port)
(then disconnect from USB) |
2 | Arduino | connect Arduino to independent power supply (no USB connection) |
3 | LAN Router | check LAN router for device connections |
Step | Equipment | Action |
---|---|---|
1 | Arduino |
load appropriate Arduino sketch (publish to MQTT topic)
(then disconnect from USB) |
2 | Linux Mint | run Python3 MQTT subscriber |
3 | Arduino | connect Arduino to independent power supply (no USB connection) |
4 | Arduino | publish messages MQTT on a loop |
5 | Linux Mint | verify subscriber receives messages |
Note: Node-RED can also be used as MQTT subscriber for this test.
Note: the Arduino should be connected to the LED on the breakout board
Step | Equipment | Action |
---|---|---|
1 | Arduino |
load appropriate Arduino sketch (subscribe to MQTT topic)
(then disconnect from USB) |
2 | Arduino | connect Arduino to independent power supply (no USB connection) |
3 | Linux Mint | run Python3 MQTT publisher |
4 | Arduino |
when MQTT messages received, blink the LED in various patterns
specified by the message |
Note: Node-RED can also be used as MQTT publisher for this test.