Node Red update and add-ons fail @ DietPi @ Raspberry Pi Zero W Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

Re: Node Red update and add-ons fail @ DietPi @ Raspberry Pi Zero W

Post by Joulinar »

looks better running installation of node-red-node-pi-gpio on CLI now

Code: Select all

root@DietPi1:~# cd /mnt/dietpi_userdata/node-red
root@DietPi1:/mnt/dietpi_userdata/node-red# sudo -u nodered npm i node-red-node-pi-gpio

added 1 package, and audited 364 packages in 43s

7 packages are looking for funding
  run `npm fund` for details

4 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 7.11.2 -> 7.12.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.12.0
npm notice Run npm install -g npm@7.12.0 to update!
npm notice
root@DietPi1:/mnt/dietpi_userdata/node-red#
will do a test via web ui as well
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

Re: Node Red update and add-ons fail @ DietPi @ Raspberry Pi Zero W

Post by Joulinar »

installation via web ui seems to be working as well. No error message on screen. Below the output from journalctl

Code: Select all

May 07 10:55:17 DietPi1 node-red[2497]: ---------------------------------------------------------------------
May 07 10:55:17 DietPi1 node-red[2497]: 7 May 10:55:17 - [info] Server now running at http://127.0.0.1:1880/
May 07 10:55:17 DietPi1 node-red[2497]: 7 May 10:55:17 - [info] Starting flows
May 07 10:55:17 DietPi1 node-red[2497]: 7 May 10:55:17 - [info] Started flows
May 07 11:24:13 DietPi1 node-red[2497]: 7 May 11:24:13 - [info] Installing module: node-red-node-pi-gpio, version: 1.2.3
May 07 11:24:49 DietPi1 node-red[2497]: 7 May 11:24:49 - [info] Installed module: node-red-node-pi-gpio
May 07 11:24:49 DietPi1 node-red[2497]: /bin/sh: 1: /mnt/dietpi_userdata/node-red/node_modules/node-red-node-pi-gpio/testgpio.py: not found
May 07 11:24:49 DietPi1 node-red[2497]: 7 May 11:24:49 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
May 07 11:24:50 DietPi1 node-red[2497]: 7 May 11:24:50 - [info] Added node types:
May 07 11:24:50 DietPi1 node-red[2497]: 7 May 11:24:50 - [info]  - node-red-node-pi-gpio:rpi-gpio in
May 07 11:24:50 DietPi1 node-red[2497]: 7 May 11:24:50 - [info]  - node-red-node-pi-gpio:rpi-gpio out
May 07 11:24:50 DietPi1 node-red[2497]: 7 May 11:24:50 - [info]  - node-red-node-pi-gpio:rpi-mouse
May 07 11:24:50 DietPi1 node-red[2497]: 7 May 11:24:50 - [info]  - node-red-node-pi-gpio:rpi-keyboard
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 3023
Joined: Sat Nov 18, 2017 6:21 pm

Re: Node Red update and add-ons fail @ DietPi @ Raspberry Pi Zero W

Post by MichaIng »

Great, many thanks for testing!
kriznik
Posts: 27
Joined: Mon Feb 03, 2020 8:03 pm

Re: Node Red update and add-ons fail @ DietPi @ Raspberry Pi Zero W

Post by kriznik »

Hi,
sadly I do have same issue on RPi2 with dietpi 7.1.2
fresh install of node-red is working fine - but without RPI gpio flow
any module install from palette menu causes node-red to crash and won't able to restart anymore.

tried several thing, as sudo, root, regular user, whatever.
nothing worked :(
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

Re: Node Red update and add-ons fail @ DietPi @ Raspberry Pi Zero W

Post by Joulinar »

Hi,

a fix will be provided with DietPi v7.2

in menatime you can do following. I assume Node-Red is not yet installed :)
  1. dietpi-software install 122
  2. cd /mnt/dietpi_userdata/node-red
  3. sudo -u nodered npm i node-red-node-pi-gpio
  4. dietpi-software reinstall 122
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
kriznik
Posts: 27
Joined: Mon Feb 03, 2020 8:03 pm

Re: Node Red update and add-ons fail @ DietPi @ Raspberry Pi Zero W

Post by kriznik »

so .. shall i reinstall node-red everytime new module is installed? cos it looks like every install does that (on my machine so far)

or maybe i'll try to install all modules I need and then reinstall it once for all ... dunno
it takes ages to reinstall it on rpi2 tho
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

Re: Node Red update and add-ons fail @ DietPi @ Raspberry Pi Zero W

Post by Joulinar »

well not sure if this is applicable for all installations but node-red-node-pi-gpio will remove nearly all other modules and Node-Red is not functioning anymore afterwards. That's why it is needed to perform reinstall at the moment. An option would be to switch to the develpment branch where the developer provided a possible fix. https://github.com/MichaIng/DietPi/pull/4345
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
kriznik
Posts: 27
Joined: Mon Feb 03, 2020 8:03 pm

Re: Node Red update and add-ons fail @ DietPi @ Raspberry Pi Zero W

Post by kriznik »

seems like it's only needed reinstall for node-red-node-pi-gpio but gpio is seen as not available in nodered
everything looks ok-ish, but looks like node-red can't handle gpio
kriznik
Posts: 27
Joined: Mon Feb 03, 2020 8:03 pm

Re: Node Red update and add-ons fail @ DietPi @ Raspberry Pi Zero W

Post by kriznik »

ok needed to apt install RPi.GPIO ... seems like dietpi-software instalation of python3 rpi-gpio is not enough
User avatar
MichaIng
Site Admin
Posts: 3023
Joined: Sat Nov 18, 2017 6:21 pm

Re: Node Red update and add-ons fail @ DietPi @ Raspberry Pi Zero W

Post by MichaIng »

Since the APT package "RPi.GPIO" does not exist, which one was finally installed (probably it's an alias)? "python-rpi.gpio", hence the Python 2 version?

Or did you mean pip install RPi.GPIO?

EDIT: Okay known issue: https://github.com/node-red/node-red-nodes/issues/721
The module actually works with Python 3, but it looks for the "python" command, which is Python 2 (officially EOL since this January). You installed now the Python 2 stack, which works, but we don't want to ship a deprecated Python version that does not receive security updates anymore on a regular basis.


One solution to keep using Python 3 is to create a symlink or alternative (now not possible with Python 2 installed):

Code: Select all

update-alternatives --install /usr/bin/python python2to3 /usr/bin/python3 1
This creates an alternative for the "python" command to be finally provided by the "python3" command, gives it the name "python2to3" (as alternatives system reference) with priority 1 (lowest), so that it is overridden by anything else providing this command. Finally a symlink will be created:

Code: Select all

/usr/bin/python => /etc/alternatives/python2to3 => /use/bin/python3
It is a little less intrusive than a direct symlink and can be overwritten automatically by APT packages, e.g. when you install Python 2 for a different reason.
Post Reply