In this chapter, we analyzed the requirements for controlling a drone with MQTT messages. We defined the topics that we will use and the commands that will be part of the messages' payloads to control a drone. Then, we worked with the Paho Python Client to write Python code that connected an MQTT client to the MQTT server.
We understood the methods we needed to call for the Paho Python Client and their parameters. We analyzed how callback worked and we were able to publish messages to topics, subscribe to topic filters, and receive and process messages.
We wrote code that processed commands for a drone with Python. The code is able to run on different IoT platforms, including Intel Joule boards and Raspberry Pi 3, and also on any computer that is capable of executing Python 2.7.x or Python 3.x. We worked with the network loop for the MQTT client in Python. We worked with a GUI utility, command-line based utilities, and, finally, with Python code to control the drone and display the...