In the previous article about LampESP, I’ve described how to subscribe ESP8266 to MQTT at Bluemix cloud. The remaining question is how to publish data.
Let’s define simple scenario for server monitoring: Server is sending every minute it’s average load to Bluemix for further processing. How to solve it?
You’ll need to create a new device type at Bluemix, let’s call it “server”. Then create new device using the same step like in the previous article.
Then you can run a simple shell script which will push all the data to Bluemix:
If you need more detailed information about communication just add option “-d” to mosquitto command.
Then you can check also logs from the device at Bluemix. You should see something like this:
Please keep in mind that Bluemix requires certain format of topic name.
In the next article, we will take a closer look how to transport event from a server to ESP8266 by Node-RED.