Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

Carlos Justiniano

November 16, 2016
Tweet

More Decks by Carlos Justiniano

Other Decks in Technology

Transcript

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

    View Slide

  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!

    View Slide

  3. Best tweet wins a RaspberryPi kit!
    #node-loves-pi
    #nycnode

    View Slide

  4. #node-loves-pi
    #nycnode

    View Slide

  5. Why SBCs?

    View Slide

  6. How SBCs differ from
    other computers

    View Slide

  7. View Slide

  8. View Slide

  9. Choosing an SBC

    View Slide

  10. View Slide

  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

    View Slide

  12. View Slide

  13. Setup!

    View Slide

  14. A bit more hardware…
    +

    View Slide

  15. Linux for SBCs

    View Slide

  16. View Slide

  17. View Slide

  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

    View Slide

  19. Boot time!

    View Slide

  20. Networking
    • $ ping raspberrypi.local
    • $ ssh [email protected]
    • $ scp ftw [email protected]/home/pi
    https://goo.gl/hhJJRE

    View Slide

  21. NodeJS Setup
    https://goo.gl/hhJJRE

    View Slide

  22. View Slide

  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

    View Slide

  24. $ cd ~
    $ node --version
    v6.9.1

    View Slide

  25. View Slide

  26. So what’s next?

    View Slide

  27. Hello World!

    View Slide

  28. View Slide

  29. –@cjus
    “Playing with single board computers is really
    cool. Getting them to communicate with one
    another is even cooler!”

    View Slide

  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

    View Slide

  31. View Slide

  32. View Slide

  33. View Slide

  34. It’s demo time!

    View Slide

  35. So what else
    can it do?

    View Slide

  36. View Slide

  37. View Slide

  38. View Slide

  39. View Slide

  40. We’re ready for
    another demo!

    View Slide

  41. View Slide

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

    View Slide

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

    View Slide