Talk about choices of protocals given at Wuthering Bytes 2013. I started with the premise that pub/sub should be the default choice. After further consideration I admitted that there are exceptions to the rule. Praise for MQTT and node.js
2. 14th
September '13 Wuthering Bytes 2013 2
Polling is for Wimps
● “Internet of Things”
● System approach
● Protocols and choices
● Security and availability
● Current project
● Workshop tomorrow
3. 14th
September '13 Wuthering Bytes 2013 3
Internet of Things
● Real-time control
systems:
● Input Sensors;
● (Stateful)
processing;
● Control actuators
● Internet connectivity
6. 14th
September '13 Wuthering Bytes 2013 6
Why Rules Engine?
● IoT installations will often evolve
● System owners may be domain experts
● Best not to build the business rules in code
● Rules-based approach best
● Must be extendable (nodes, processing)
● Needs usable interface (e.g drag 'n drop)
● Engines typically needed at > 1 level
9. 14th
September '13 Wuthering Bytes 2013 9
Protocols
● XMPP – messaging/ pub/ sub
● Bayeux – pub/ sub over http
● MQTT – a lightweight pub/ sub
● numerous implementations
● REST for gets and puts
● HTTP for remote control
● In all cases: application-specific semantics :-(
10. 14th
September '13 Wuthering Bytes 2013 10
Which to Use?
Criteria:
● Bandwidth efficiency?
● Power consumption?
● Security?
● Standardisation?
● Interoperability (local and global)?
11. 14th
September '13 Wuthering Bytes 2013 11
Comparison
Polling Pub/ Sub
Bandwidth Efficiency 4.4M 46K*
Power consumption +10%** +10%**
Security SSL/ Cert Auth DIY
* Using MQTT (Bayeux figure was 490K)
** 3W-2.7W estimates (no real-time energy monitor available)
Test condition: download of 8 channel Xively data format every 10
minutes (download latency 1 minute)
12. 14th
September '13 Wuthering Bytes 2013 12
Security (CI) models
● Installation firewalls: no open incoming ports
● SSL across the net (performance overhead)
● OAuth to authenticate installation access to
central services (as Twitter API)
● OAuth to authenticate admin access to
installations
13. 14th
September '13 Wuthering Bytes 2013 13
Availability Models
Central Services:
● External monitor (on standby m/c)
● Checkpointing to data store
● Automatic restart
Installations:
● Hardware watchdog
● Cache to handle Internet outage
● Checkpointing to central service
●
Automatic restart
14. 14th
September '13 Wuthering Bytes 2013 14
When Wimps Rule OK
● With pub/sub you may need DIY security
● The above availability model is quite complex
● Pub/sub justified if bandwidth is at a premium
● On cheap connections you can afford to be
more profligate:
● use polling for data transfers
● save on need for auto restart on central services
15. 14th
September '13 Wuthering Bytes 2013 15
Node.js goodness
● runs great on Rpi (after 6 hour build)
● support for sockets and REST
● node MQTT.js works fine with mosquitto server
● node-serialport enables device attachment
● ease of implementing engine, rules etc
● removes heavy lifting from low-power devices
like Arduinos
17. 14th
September '13 Wuthering Bytes 2013 17
But this need to be
● Local conventions may not need it
● Globally:
● Distributed approach to discovery
● Needs to go to end-point level
● DNS-like network of discovery nodes
● Needs investment and collaboration
18. 14th
September '13 Wuthering Bytes 2013 18
Current Project
ecoHome demonstrator
● mostly autonomous
● numerous sensors
● controls heating, ventilation,
shutters, lights etc.
● RPi + Arduinos, talking MQTT
● Logging to Xively (for analysis)
● Local rules engine
● Admin app on local web server
19. 14th
September '13 Wuthering Bytes 2013 19
Workshop plug
● Get hands dirty with MQTT
● Need laptop and Arduino, RPi or equivalent
● Some kind of sensor and/ or actuator
● I have MQTT microbroker and rules engine
Ethernet
20. 14th
September '13 Wuthering Bytes 2013 20
Contact
Paul Tanner
@paul_tanner
www.slideshare.net/paul_tanner
paul@virtual-techno.com
01494 581979
?