Executing the commands

Let's now start sending the commands from MQTT.fx client and see our car in motion.

To move forward, we publish the message forward on topic controlPi/cmd as shown in Figure 8.12.

Command:

Figure 8.12

On the Subscribe tab we will see the message move forward as acknowledgment sent back from the car as a confirmation that the car is moving forward now. Refer to the following screenshot:

Acknowledgment:

Figure 8.13

To move backward/reverse we publish command reverse; the car will start moving in a backward direction, the ...

Get Internet of Things with Raspberry Pi 3 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.