I currently have a simple temperature monitor (https://github.com/m00dawg/SolarStats/tree/master/particle) which sends data back to my local server via a crafted HTTP request. It works but I don’t find it particularly elegant - making deep sleep work took the better part of the day - and was already looking at using something like rabbitMQ to distribute data from my temperature sensor as well as from my home energy monitor to various sources (like a local DB, Weather Underground, etc.).
So MQTT seems like a natural fit as an all around better option. I found the MQTT library on the web IDE, but I’m curious about the callback:
MQTT client(“server_name”, 1883, callback);
I wasn’t planning on sending data to the Core. Instead I was going to have to just have it wake up, check temp, send temp data to the queue, and then go back into a deep sleep. As a result, do I need a callback here? I tried omitting it entirely and using a null value. It works if I provide an empty function, but that seems a little ugly?
Thoughts? Also I’m open to suggestions if folks have suggestions other than MQTT. I noticed there is a Redis library available as well so was pondering that.