Defining the topics and commands
We will use the following topic name to publish the commands for a drone: commands/dronename
, where dronename
must be replaced with a unique name assigned to a drone. For example, if we assign drone01
as the name for a drone that is powered by an Intel Joule 570x board, we will have to publish commands to the commands/drone01
topic and the code that runs on this board will subscribe to this topic to receive messages with commands and react to them.
We will use the following topic name to make the drones publish details about the successfully executed commands: processedcommands/dronename
, where dronename
must be replaced with a unique name assigned to a drone. For example, if we assign dronepi03
as the name for a drone that is powered by a Raspberry Pi 3 board, the client that wants to receive information about successfully processed commands has to subscribe to the processedcommands/dronepi03
topic.
The commands will be sent in a JSON string with a key-value...