Summary

In this chapter, we analyzed the requirements to control a vehicle with MQTT messages. We defined the topics that we would use and the commands that would be part of the messages’ payloads to control a vehicle. 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 callbacks worked and we wrote code to subscribe to topic filters as well as to receive and process messages.

We wrote code that processed commands for a vehicle with Python. The code is able to run on different IoT platforms, including Raspberry Pi 3 family boards, Qualcomm DragonBoard, BeagleBone Black, MinnowBoard Turbot, LattePanda, UP squared, and also on any computer that is capable of executing Python 3.6.x code. We worked with the network loop for the MQTT client in Python.

Now that we have understood the basics to use Python to work with MQTT, we will use and improve our vehicle control solution with MQTT messages and Python code and we will take advantage of additional MQTT features, which are the topics we are going to discuss in Chapter 5Testing and Improving our Vehicle Control Solution in Python.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.147.215