The detection of all of our cube sides is working now. Let's add MQTT to our code base:
- Open the MQTT example code from this book's repository:Â general/arduino/mqtt_shiftr_send_receive_example.
As we did in the other projects, let's run this test-code first before we integrate it into our main sketch to make sure the Wi-Fi, as well as the MQTT connection, is working.
- Enter your Wi-Fi name (WIFI_SSID) and Wi-Fi password (WIFI_PASSWORD). You can also customize MQTT_DEVICE_NAME. You will see it on shiftr.io when you look at the network graph.
- Pick any name you like here, but stick to the characters a-z, 0-9, and dash (-). Other characters might work as well but might also lead to problems with certain MQTT clients or servers.
- Try to make your device name unique (for example, by appending a few random numbers). The device name...