Subscribing to topics with a command-line tool

A drone is an IoT device that interacts with many sensors and actuators, including digital electronic speed controllers linked to engines, propellers, and servomotors. A drone is also known as an unmanned aerial vehicle (UAV), but we will definitely refer to it as a drone. Let's imagine that we have to monitor many drones. Specifically, we have to display their altitude and the speed for each of their servomotors. Not all of the drones have the same number of engines, propellers, and servomotors. We have to monitor the following types of drone:

Name Number of propellers
Quadcopter 4
Hexacopter 6
Octocopter 8

Each drone will publish its altitude every 2 seconds to the following topic: ...

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.