Before we integrate the MQTT code into our sketch, we first need to check our MQTT connection by following these steps:
- Please open the mqtt_shiftr_send_receive_example example, which you will find in the general | arduino folder inside the downloaded source code repository.Â
The example, as well as all other MQTT code running on the Arduino MKR WiFi 1010, depends on two libraries:
-
- WiFiNINA: This provides network functionality to the Arduino MKR WiFi 1010.
- MQTT (by Joel Gaehwiler): This enables your Arduino to communicate with other devices and servers via MQTT.
You should have these installed already. If not, install them via the Arduino Library Manager. I am using WiFiNINA v1.30 and MQTT v2.4.3.
Before you can upload the code, you need to set your Wi-Fi name and password, which can often...