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, ...

Get Hands-On MQTT Programming with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.