Node in small places

Node in small places

A look at using NodeJS on $5 Raspberry Pi Zeros. Form my talk at NYCNode Nov 2016

E2e942d05d5ea93ad2eddd3394ffcd96?s=128

Carlos Justiniano

November 16, 2016
Tweet

Transcript

  1. Node in small places Carlos Justiniano (@cjus - github/twitter)

  2. About me • Carlos Justiniano (@cjus - github/twitter) • First

    IoT project in 2001 • Ten years later I learned about NodeJS • Deployed Node applications in production since 2011 • Chief Architect at Flywheel Sports - Note: we're hiring!
  3. Best tweet wins a RaspberryPi kit! #node-loves-pi #nycnode

  4. #node-loves-pi #nycnode

  5. Why SBCs?

  6. How SBCs differ from other computers

  7. None
  8. None
  9. Choosing an SBC

  10. None
  11. No Wifi, no Ethernet Raspberry Pi Zero Raspberry Pi 3

    Uses USB based networking Has Ethernet, Wifi and Bluetooth and 4 USB ports Has two microUSB ports
  12. None
  13. Setup!

  14. A bit more hardware… +

  15. Linux for SBCs

  16. None
  17. None
  18. Linux Setup • $ diskutil list • $ diskutil unmountDisk

    /dev/disk2 • $ sudo dd if=./2016-05-27-raspbian- jessie-lite.img of=/dev/disk2 https://goo.gl/hhJJRE
  19. Boot time!

  20. Networking • $ ping raspberrypi.local • $ ssh pi@raspberrypi.local •

    $ scp ftw pi@raspberrpi.local/home/pi https://goo.gl/hhJJRE
  21. NodeJS Setup https://goo.gl/hhJJRE

  22. None
  23. $ mkdir nodejs $ cd nodejs/ $ wget https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux- armv6l.tar.xz

    $ tar -xvf node-v6.9.1-linux-armv6l.tar.xz $ cd node-v6.9.1-linux-armv6l/ $ sudo cp ./bin/* /usr/local/bin
  24. $ cd ~ $ node --version v6.9.1

  25. None
  26. So what’s next?

  27. Hello World!

  28. None
  29. –@cjus “Playing with single board computers is really cool. Getting

    them to communicate with one another is even cooler!”
  30. Connecting SBCs! • $sudo apt-get install {cool-app-name} • Install servers:

    nginx, redis, apache etc… • Create bots and connect with anything with a public API • Build messaging applications using rabbitmq, zeromq, MQTT
  31. None
  32. None
  33. None
  34. It’s demo time!

  35. So what else can it do?

  36. None
  37. None
  38. None
  39. None
  40. We’re ready for another demo!

  41. None
  42. The Hydra-Cluster is open sourced! https://github.com/cjus

  43. #node-loves-pi #nycnode @cjus