So what does it do?
MqttCogs maintains a persistent (well semi persistent) connection to an Mqtt Broker. When a message arrives on a subscribed topic, it persists it to a custom database table in wordpress.
So that you can ‘see’ the data in your blog it provides a number shortcodes for visualizing your data.
Err, why?
I’ve been mucking around with IoT (internet of things) projects for over a year now. I started with Arduino & the MySensors project. Annoyingly, it really isn’t as easy as you think! My #1 gripe after working out how to run my sensors on batteries for a long time was actually trying to look at the data that they were generating.
I eventually got my sensors to spew their data to an MQTT broker (cloudmqtt). I could then run a client like (mqttspy) on my PC to take a peak at what I was generating. As the MQTT protocol is open and stable and there are multiple (free) choices for brokers. I prefer that my sensors publish to an MQTT broker as I don’t have to commit to a controller. I’m not good at commitment.
I went for sending my data to an MQTT Broker and using mqttspy to visualize my data and be my simple controller. This was good for testing but to work well mqttspy needs to be on 24/7. I’m not good at this either.
I didn’t want my PC to be always on. I also didn’t want to rent a server and then have to install the controller software. What I do have though is a wordpress blog. This costs me $1.50 per month to rent. So I started wondering about getting MQTT data into the WordPress database and visualizing the data on my blog.
This is how MqttCogs started.