This sample app shows how to connect with mosquitto to CloudMQTT and both publish and subscribe messages.
Here this is a combination of Arduino Uno, sketch on one end and a client at the other end running on the laptop where the user can turn on and off a simple LED by publishing the commands.
This is an end to end solution -where the pub sub goes to the broker from Arduino board or the laptop and comes back to the laptop or the smartphone at the other end.
$ pip install -r requirements.txt
I got the definitions from this page. https://pypi.python.org/pypi/paho-mqtt/0.9
This was tested against cloudmqtt.com
https://api.cloudmqtt.com/sso/cloudmqtt/websocket
-
Create an account on cloudmqtt.com ( in my case it was Kute Cat )
-
Start Arduino IDE and upload the sketch - to Arduino Uno board.
-
Start the app.py so publish data.
-
Wait for it to appear on the Cloudmqtt websockets console.
-
See that it appears on the Arduino IDE Serial monitor as well.