I’ve primarily been using a mysql database for my home intelligent management system along with some system messages to communicate between Raspberry Pis. This has been a simple enough arrangement but to really get into more of the low power internet of things, I need a way to send messages amongst several hardware platforms. From looking online, MQTT, seems to be a decent IOT protocol that can accomplish my goals for the home intelligent management system.
This post will look at setting up the basics to support MQTT and get the basics working utilizing information available on the internet.
With the above introduction in mind. I plan on using a Raspberry Pi as the MQTT broker. I’ll likely migrate this function over to my CENTOS box running Apache/mysql but for now, I want to wait become more familiar with MQTT. In addition to using the Raspberry Pi as the broker, it looks like there’s quite a bit of instructions out there for using Mosquitto as the broker code so I’m going to start there.
After following the guide above, I have confirmed the broker and client are installed and functioning on the Raspberry Pi. Next step, to get the client installed on my Feather Huzzah.
I had to get things setup to use the Arduino IDE for the Feather Huzzah. I followed the Adafruit guide found here. After following the guide, I was able to connect to the Huzzah using the Arduino IDE and successfully uploaded one of the Adafruit sketches to test my Wifi connectivity.
Next I followed the guide found here.
As I followed this guide. I kept getting connection refused when I went to test things. I discovered that when I rebooted the service stopped and I had to start it again by entering mosquitto -d. I still need to figure out how to get mosquitto to load on startup but at least it’s testing correctly now. I confirmed the username and password seem to work and if I try to publish to the broker I get connection refused unless the credentials are correct. This may not be the best security but it’s something so good enough for home use.
Next I set out to test using the Huzzah as the publisher.