This iPhone (iOS 9+) and watchOS 2 demo app for eMan IoT workshop.
- Control state of diods via MQTT broker (RabbitMQ)
- Show online/offline state of the edge device (Arduino)
The app communicates with MQTT broker via these topics:
arduino/:id/:color– setting diod state where :color is one ofred,greenorblue(publish/subscribe)arduino/:id/status– online state of the edge device (subscribe)
Payload is always 0x0 (off) or 0x1 (on), QoS is 1 fo publish and subscribe and keep alive timer is 1s. Messages are published with a retain flag set to 1.
Constants.swift– Configuration options, MQTT host, username and password need to be configuredClient.swift– Client for diod controlling, uses MQTT
Dependencies (only CocoaMQTT library at this moment) are handled by carthage and are bundled in the git repo. Carthage needs to be installed at /usr/local/bin/carthage to build the product.
Arduino Hacking for iOS and watchOS is released under the MIT License.