Regular reader will know about the script that Aidan Ruff and I originally developed to put Node-Red and several other packages onto the Raspberry Pi for our own home control purposes. This has been developed with help from several people and in particular my friend Antonio “Mr Shark”.
WELL – here is the script which is intended to help set up certain Raspbian, Debian or similarly-based SBCs which now includes logging and handling Raspbian Stretch (tested on Raspberry Pi 2 and 3, 3B+). As well as it's original purpose of setting up a Raspberry Pi, the script also runs well with several other boards. See right hand side of the above image for what the script does, given a basic operating system install. We currently suggest NOT using this with DIET PI or the Raspberry Pi Zero as we are no longer testing either and the latter is just TOO SLOW.
February 18 2019
Raspbian and Pi Zero Wireless – users have reported success with latest update but we’ve not tested.
The local Blynk server is not installed in the script – see this blog entry, note that I now use all lowercase for the blynk directory name.
Still using Apache but soon will change to NGINX – also whichever web server you use – if you plan to use node-red-contrib-amazon-echo – you might want to shift the working port for Apache (or NGINX) from 80 to 86. Do this in /etc/apache2/sites-enabled/000-default.conf (one reference to change) or if you ARE using nginx change /etc/nginx/sites-available/default – two references to 80 change to 86 (my choice). The Amazon echo hub in NR I then set to 8980 and rebooted. The next para is taken from “A Good Day for Alexa” blog entry:
I am using port 8980 to avoid being the hated Linux ROOT user and so now, on my Raspberry Pi 3, I moved the web server to port 86 and using “iptables” have redirected port 8980 traffic to port 80 to keep Amazon happy while continuing to use port 8980 to keep Linux happy as PI user. All of this of course only matters if you want to use that particular node in Node-Red- with generation 3 DOT and similar Alexa devices.
sudo apt-get install iptables-persistent
sudo iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8980
sudo netfilter-persistent save
sudo netfilter-persistent reload
February 2019 – I’ve uploaded a new version with mods for Raspbian and in particular Node-Red and nodejs v10 as currently used by the Node-Red guys on the Raspberry Pi.
Raspberry Pi users should log in a user PI and start with a clean Raspbian. Enable any hardware you want working before installing the script – like I2c.
Raspberry Pi users get the script in your /home/pi directory as below. Non-Raspberry Pi users start in your ROOT directory as user ROOT, initially.
Here’s how to get the script – 2019 version.
wget --no-check-certificate https://bitbucket.org/api/2.0/snippets/scargill/qexexb/master/files/script.sh