Testing new Node-RED flows on the main Raspberry Pi controller can be a nuisance as every Deploy initiates a number of things that you might not want to happen frequently; getting weather data etc. To obviate this, a completely separate Node-RED environment is setup on the TrueNAS server.
Note: It is important to remember to turn off the Node-RED test instance whenever not in use as it might interfere with the primary Node-RED operation. As the two share the MQTT server and OpenHab / Philips Hue hubs there could be clashes between the two.
Build on TrueNAS
- Create new jail
-
- name: NodeRed_Test
- release: pick latest [12.3-RELEASE]
- VNET: checked
- IPv4 Interface: vnet0
- IPv4 Address: 192.168.0.31
- IPv4 Netmask: 24
- Auto-start: checked [might need to edit after Submit to tick this]
- name: NodeRed_Test
- Start “NodeRed_Test” Jail
- Goto “NodeRed_Test” Shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pkg update # will prompt to install "pkg"
pkg upgrade
pkg install python
pkg install node
pkg install www/npm
npm install -g --unsafe-perm node-red
npm install -g pm2 # Install PM2 Daemon to boot node-red at startup
which node-red #confirm node-red location = /usr/local/bin/node-red
pm2 start /usr/local/bin/node-red -- -v #tell pm2 to start node-red
pm2 save # tell pm2 to save current process list
mkdir -p /usr/local/etc/rc.d
pm2 startup rcd # tell pm2 to run on boot
Setup Node-RED
- Access the Node-RED editor by pointing browser at http://192.168.0.31:1880
- Add extra nodes as required by current Raspberry Pi build, e.g.:
1
2
3
4
5
6
7
contrib-bigtimer
contrib-huemagic
contrib-openhab3
contrib-timeout
node-email
node-mysql
node-random
Test flows as required without upsetting main “production” flows