Get started with MQTT
MQ Telemetry Transport (MQTT) is a messaging protocol that is ideal for the Internet of Things (IoT) due to a light footprint and its use of the publish-subscribe model. In this model, a client connects to a broker, a server machine responsible for receiving all messages, filtering them, and then sending messages to the appropriate clients.
The first two MQTT examples do not involve the XBee Cellular Modem. They demonstrate using the MQTT libraries because those libraries are required for Use MQTT over the XBee Cellular Modem with a PC.
The examples in this guide assume:
- Some knowledge of Python.
- An integrated development environment (IDE) such as PyCharm, IDLE or something similar.
The examples require:
- An XBee Cellular Modem.
- A compatible development board.
- XCTU. See Install and upgrade XCTU.
- That you install Python on your computer. You can download Python from: https://www.python.org/downloads/.
- That you install the pyserial and paho-mqtt libraries to the Python environment. If you use Python 2, install these libraries from the command line with pip install pyserial and pip install paho-mqtt. If you use Python 3, use pip3 install pyserial and pip3 install paho-mqtt.
- The full MQTT library source code, which includes examples and tests, which is available in the paho-mqtt github repository at https://github.com/eclipse/paho.mqtt.python. To download this repository you must have Git installed.