If you have ever wanted to create an Internet of Things (IoT) project, then you’ve probably run into the problem of making it communicate what it senses, or talking to other sensors in a different location. One of the bigger drawbacks of the “standard” Arduino Uno is that it doesn’t have any built-in networking capability, short of direct serial communication. That’s not really handy for a project that’s in another room, or even outside. That’s actually why I tend to favor the ESP8266 (or maybe the ESP32, once I get my hands on one), since it comes with WiFi on board, and it’s easy to get started. Sure, there are lots of fixes, from adding a pre-built shield to your Arduino, upgrading to a Yun or something similar, or even using an ESP8266 as a WiFi broker for the board. But once you have communication, how do you manage to actually communicate anything? Especially if you have multiple projects, they don’t just start sharing all those ones and zeroes. There are some things that Arduino (and microcontrollers in general) do poorly…like tell actual time. So you hook up a Raspberry Pi, and put that into the mix so that you can pull from NTP (Network Time Protocol). And there’s also your communications solution. An MQTT server: one of the building blocks of IoT. There are other solutions around that do the same thing, but this is the one that I tend to use. Setting up Mosquitto (The MQTT server that I use) is super-simple on the Pi.
I’m linking to a great article on the basics of MQTT, and how it’s good to use for your DIY projects over on Henry’s Bench below. Check out some of his other content while you’re there. He’s done a lot with Arduino. I just discovered him myself, and it’s definitely become one of my bookmarks for future reading!
MQTT Basics for the DIY Maker of Things | Henry’s Bench
A Very Simple Overview for the DIY Thing Maker The neat thing about IoT (the Internet of Things) is that its possible for hobbyist to create a high tech solution using readily available low cost de…