Source file for Arduino MQQT client, part of eMan IoT workshop apps stack (see Related).
- Connects to the local WiFi and MQTT broker
- Subscribes to all related topics, lights up LEDs according to received messages
- Supports both switching on/off for each LED separately via Arduino Hacking - iOS and watchOS and lighting up a longer color sequence using Arduino Hacking - Web
Communication with the MQTT broker takes place via following topics:
arduino/:id/:color
– :color is one ofred
,green
,blue
oryellow
arduino/:id/stream
– expects a sequence composed ofRGBY
characters. Any other character shuts all the LEDs off.arduino/:id/status
– online state of the device. Sends0x01
on connect and0x00
on disconnect (last will message)
- Requires Arduino compatible device (demo runs on Arduino Uno) with installed WiFi shield.
- PubSubClient installed in your IDE
- Download the IDE of your choice: [Arduino IDE](Download the Arduino Software) / PlatformIO
- Make sure you have the latest versions of all the included libraries and your WiFi shield's firmware
- Open
led.ino
file. - Fill in all the required credentials/details in the config section (WiFi SSID & password, MQQT server address, login etc.)
- Upload the file to your Arduino.
The app expects your RGBY
LEDs to be connected to PINs 5
, 4
, 3
and 2
, however this is customizable within the code.
Arduino Hacking Arduino is released under the MIT License.