Chapter 6. Interacting with Actuators in Swift
In this chapter, we will write an iOS app in Swift 3 to control actuators with MQTT messages. In addition, we will use Node.js to write code that runs on IoT boards, receives MQTT messages, and controls motors wired to the boards. We will:
- Understand the requirements to interact with actuators in Swift
- Define the topics and commands to control actuators
- Install the CocoaMQTT client library
- Understand the CocoaMQTT client in Swift 3
- Connect to the MQTT server and subscribe to topics in Swift
- Publish messages to target actuators in Swift
- Process commands that interact with actuators in Node.js
- Run the iOS app that controls an actuator with MQTT
- Run the home automation web application
- Debug events in Swift