Publishing messages to a Mosquitto broker with a Python client
We have the code that is going to be running in the Intel Galileo Gen 2 board to process the command messages received from the Mosquitto message broker. Now, we are going to code a Python client that will publish messages to the "iot-python-gaston-hillar/temperature"
channel. This way, we will be able to design applications that can talk to IoT devices with MQTT messages. Specifically, the applications will be able to communicate through a Mosquitto message broker with Python code in the publisher and in the subscriber devices.
We can run the Python client on another Intel Galileo Gen 2 board or in any device that has Python 2.7.x installed. In addition, the code will run with Python 3.x. For example, we can run the Python client in our computer. We just need to make sure that we install the pubnub
module we have previously installed with pip in the Python version that is running in the Yocto Linux for the board.
We will create...