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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access