Skip to Main Content
Hands-On Internet of Things with MQTT
book

Hands-On Internet of Things with MQTT

by Tim Pulver
October 2019
Intermediate to advanced content levelIntermediate to advanced
350 pages
9h 5m
English
Packt Publishing
Content preview from Hands-On Internet of Things with MQTT

Testing Arduino MQTT connectivity

Now, it's time to make sure MQTT works on your Arduino MKR WiFi 1010.

As of writing this, there is no official example of the MQTT-Arduino library for the Arduino MKR WiFi 1010. This is because the Arduino MKR WiFi 1010 uses a wireless module that is relatively new.

  1. Create a new sketch, save it as ch5_mqtt_test, and paste the following code.
Feel free to just copy and paste the code for this sketch. You can find it in this book's repository (https://github.com/PacktPublishing/Hands-On-Internet-of-Things-with-MQTT) in the folder.
  1. First, there are the include statements and variables:
#include <WiFiNINA.h>#include <MQTT.h>const char WIFI_SSID[] = "YOUR_WIFI_NAME_HERE";const char WIFI_PASS[] = "YOUR_WIFI_PASSWORD_HERE"; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical IoT Hacking

Practical IoT Hacking

Fotios Chantzis, Ioannis Stais, Paulino Calderon
Internet of Things (IoT) Fundamentals

Internet of Things (IoT) Fundamentals

Jerome Henry / Rob Barton

Publisher Resources

ISBN: 9781789341782Supplemental Content