Creating a class to represent a drone

Now, we will write Python code that will run on the different IoT boards. Remember to copy the files we have created in the previous chapter to a directory in the computer or device that will represent the board that controls a drone and that we will use to run a Python script. We saved the files in a directory called certificates. Create a python_certificates directory in the computer or board you are going to use as the MQTT client for this example. Copy the following three files to this new directory:

  • ca.crt: Certificate authority certificate file
  • device001.crt: Client certificate file
  • device001.key: Client key

We will create the following two classes:

  • Drone: This class will represent a drone and provides methods ...

Get MQTT Essentials - A Lightweight IoT Protocol now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.