bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
sudo systemctl enable nodered.service
node-red-start
install pigpio:
sudo apt update
sudo apt install pigpio
sudo apt install onoff
install npm packages:
cd ~/.node-red
npm install pigpio
install node-red packages
node-red-dashboard
node-red-contrib-loop-processing
node-red-simple-gate
git:villagekit/node-red-contrib-countdown
With Node.js > 12 installed (using nvm
),
npm install -g node-red
node-red
cd ~/.node-red
npm install node-red-dashboard
npm install node-red-contrib-loop-processing
npm install node-red-simple-gate
npm install git:villagekit/node-red-contrib-countdown
Click top right menu > Import > Select a file to import > Import "flows.json"
The machine code expects the files in ./scripts
to be in the pi
user's home directory.
cd
mkdir scripts
scp -P 14131 ./scripts/*.(js|json) pi@machine:scripts
cd ./scripts
npm install
- limit switches:
- gnd: Pin 9
- x min (right switch from front): Pin 11 / GPIO 17
- x max: Pin 13 / GPIO 27
- y min (bottom switch): Pin 15 / GPIO 22
- 3.3v: Pin 17
- y max: Pin 19 / GPIO 10
- x motor:
- pulse +: GPIO 5
- dir +: GPIO 6
- y motor:
- up relay: GPIO 23
- down relay: GPIO 24
- spindle motor:
- speed up relay: GPIO 8
- speed down relay: GPIO 25
- speed off: GPIO 7