Summary
In this chapter, we analyzed the requirements to control actuators wired to different IoT boards with MQTT messages. We defined the topics we would use and the commands that would be a part of the message's payloads to turn the motors on and off.
Then, we created an iOS app with Xcode and Swift 3, combined with the CocoaMQTT client, to control a motor. We wrote code to publish messages to target remote devices in Swift 3, and we were able to process the received messages to provide feedback to the user.
We worked with MQTT.js to write a Node.js script to process commands that simulated the interaction with motors on different IoT boards. We were able to run the iOS app and the Node.js script and understand how all the pieces worked together by exchanging MQTT messages.
We understood how MQTT works in detail and we worked with direct MQTT and MQTT over WebSockets. We worked with unsecured and secured communications. We worked with this protocol in Python, Java, JavaScript, Node.js, and...