Networking with MQTT, Python, and the Mosquitto MQTT Broker

In the previous chapter, we created two Python servers and accompanying web pages using both a RESTful API and Web Socket approach to networking. In this chapter, we will cover another networking topology that is common in the IoT world, known as MQTT or Message Queue Telemetry Transport.

We will commence by setting up your development environment and installing the Mosquitto MQTT broker service on your Raspberry Pi. Then, we will learn about MQTT features using command-line tools that come with Mosquitto to help you to understand the core concepts in isolation. After that, we'll proceed to a Python IoT application that uses MQTT for its messaging layer—and yes, it'll be all about ...

Get Practical Python Programming for IoT 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.