MQTT and Wireless Sensors
Recently I was discovered a couple of new topics that I wanted to explore with my massive computing infrastructure.
- Bluetooth Sensors
At a high level it is a light weight message platform that implements the publish / subscribe pattern. Pretty simple huh? Actually, it really was pretty simple. More info here: https://www.mqtt.com/ and the implementation I used on my Raspberry PIs: https://mosquitto.org/
If you have not read about MQTT or know about it, let me try briefly.
So, here are the players:
For my first project I wanted to find something that would generate random, yet useful data that I could feed into MQTT — enter the wireless sensor. The sensor that I’m using is the “SensorBug” from BleHome. They are only $25 at Amazon. http://www.blehome.com/sensorbug-PC.html
Raspberry PIs ( 2 RPi 3b+ )
MsgPi = Raspberry Pi with the MQTT broker software installed
SensorPi = Raspberry Pi that will be the catcher of the sensor data and publishing it to the subscriber.
CatcherPi = Raspberry Pi with the subscriber process running on it that catches the data and then adds it to the mysql db.
Three wireless sensors to generate data that are scattered around my house. This setup has been collecting data for a while now and has accumulated well over half million records now.
This is just step one for now. If you have any suggestions on what I might be able to predict with this information … put it in the comments below.
Oh and in case you are wondering what data is being collected: Temp, Light Level, Sensor Orientation ( vertical or horizontal ). I want to add humidity into my collection when I can find a sensor. I’m sure there are lots I just haven’t spent enough time looking yet.