MQTT on Raspberry Pi with node.js

3,959 views

Published on

Talk I gave at LNUG. Forgot to explain pub/sub vs. polling. never mind. You can look that up. This is about a research project around a new-build ecoHome.

Published in: Technology, Business

MQTT on Raspberry Pi with node.js

  1. 1. 28th August '13 LNUG 1 LNUG August 2013 IoT with node.js on Raspberry Pi @paul_tanner
  2. 2. 28th August '13 LNUG 2 IoT with node.js on RPi ● “Internet of Things” ● System approach ● Distributed system ● Protocols ● Current project ● Node goodness
  3. 3. 28th August '13 LNUG 3 Internet of Things ● Real-time control systems: ● Input Sensors; ● (Stateful) processing; ● Control actuators ● Internet connectivity
  4. 4. 28th August '13 LNUG 4 System approach out = in > T || out && in > -T
  5. 5. 28th August '13 LNUG 5 Distributed System
  6. 6. 28th August '13 LNUG 6 Distributed System
  7. 7. 28th August '13 LNUG 7 The Hardware RFM12Pi Arduino with Ethernet
  8. 8. 28th August '13 LNUG 8 Protocols ● MQTT for data transfer ● one standard pub/ sub ● lightweight :-) ● numerous implementations ● application-specific semantics ● REST for logging (and/ or puts but not gets) ● HTTP for remote control via browser
  9. 9. 28th August '13 LNUG 9 Current Project ecoHome demonstrator ● mostly autonomous ● numerous sensors ● controls heating, ventilation, shutters, lights ● RPi + Arduinos, talking MQTT ● Logging to Xively (for analysis) ● Local rules engine ● Admin app on local web server ● modules: MQTT.js; node-serialport, arduino client etc
  10. 10. 28th August '13 LNUG 10 Node.js goodness ● runs great on Rpi (after 6 hour build) ● support for sockets and REST ● node-mqtt works fine with mosquitto server ● node-serial enables device attachment ● ease of implementing engine, rules etc ● removes heavy lifting from Arduinos
  11. 11. 28th August '13 LNUG 11 Contact Thanks for Listening Paul Tanner @paul_tanner paul@virtual-techno.com www.slideshare.com/paul_tanner 01494 581979

×