MikeHouston.net

Honorary member of the Shaolin

Using node.js on a Raspberry Pi Zero W for ‘remote control’ of GPIO–part 1/3

Setting up node.js on Raspberry Pi Zero W:

1) SSH to your Raspberry Pi Zero W, execute :
      ssh raspberryhostname –l pi

2) Find the latest version of node.js for the armv61 architecture
       search https://nodejs.org/dist/ for node-v[XX.X.X]-linux-armv6l.tar.gz
       copy the complete url of the latest version (https://nodejs.org/dist/latest/node-v11.9.0-linux-armv6l.tar.xz is the latest as of this document)

3) Download node.js archive file
       using the SSH session established in step 1, execute :
       curl -o node-v11.9.0-linux-armv6l.tar.gz https://nodejs.org/dist/latest/node-v11.9.0-linux-armv6l.tar.gz

4) Extract node.js archive file
       using the SSH session established in step 1, execute :
       tar -xzf node-v11.9.0-linux-armv6l.tar.gz

5) Install/copy files to $path
        using the SSH session established in step 1, execute :
       sudo cp -r node-v11.9.0-linux-armv6l/* /usr/local/

6) Install git to fully enable use of node.js and npm
       using the SSH session established in step 1, execute :
      sudo apt-get install git


part 1/3 : setting up node.js on Raspberry Pi Zero W

part 2/3 : creating api with access to GPIO

part 3/3 : securing node.js APIs

Comments are closed