DietPi_RPi-ARMv6-Buster.7z downloaded April 21st, 2021
Raspberry Pi Zero W v1.1
Try to boot from above image, then install Node-Red with use of the DietPi optimized software installation system. It works fine by this moment, you can deploy a flow etc, all is good.
I mean these simple commands…
systemctl stop node-red
cd /mnt/dietpi_userdata/node-red
sudo -u nodered npm up node-red
systemctl start node-red
Above update will crash your Node-Red completely. You will nod be able to run it again. DietPi team, please!
Another experiment. Try to install RPI-GPIO 1.2.3 or something else from inside the Node-Red. It will fail. DietPi team, please! Why to add Node-Red for RPi when RpI IO lib cannot be added!
Try to uninstall the Node-Red and install it manually using the script from Node-Red webpage. It will fail telling you that DietPi system is recognized and you should use embedded optimized software installation system. Vicious circle.
I got fed up with this whole DietPi experiment and installed Raspberry Pi OS Lite. Everything works like a charm, straight away.
Many thanks for your report. Some details would have been great to enable us identifying and fixing the issue.
I tested the current local install method and as well a global install (npm i -g node-red) and in both cases indeed the web UI stays blank aside of the header bar, with the following browser error:
Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
at Object.init (http://192.168.1.22:1880/red/red.min.js:16:17142)
at Object.init (http://192.168.1.22:1880/red/red.min.js:16:16449)
at HTMLDocument.<anonymous> (http://192.168.1.22:1880/red/main.min.js:16:161)
at e (http://192.168.1.22:1880/vendor/vendor.js:2:30005)
at t (http://192.168.1.22:1880/vendor/vendor.js:2:30307)
That is new. Either a recent Node-RED update or Node.js update broke it. Does it match the issue you faced after updating Node-RED or what do you mean by “crash your Node-Red completely” and “will nod be able to run it again”?
EDIT: Nope, the above error was due to some Cookie overlap with other test applications on that server. The browser denies to access the local/cookie storage then. Issue solved. Also I can now upgrade and downgrade with the commands from the docs without breaking anything. So again it would be helpful to know what the exact error/failure is you faced.
The official installer btw installs Node v12 and installs it as global module (like we did prior to DietPi v6.34), otherwise it’s pretty much the same.
About the RPi GPIO, you mean that module? https://www.npmjs.com/package/rpi-gpio
v1.2.3 does not support any Node version above v8, while we install v16. So you’d need to use the recent version v2.1.7. Also what you mean by “It will fail”? Is there any error message included?
I’ll play with older Node-RED and Node.js versions to see which combination works.
Now found from the palette: node-red-node-pi-gpio v1.2.3 which is obviously what you meant.
Install worked flawlessly:
Nodes zur Palette hinzugefügt:
rpi-gpio in
rpi-gpio out
rpi-mouse
rpi-keyboard
The new nodes appear at the bottom of the list and I can add and manage them. So apparently in your case something failed that is not a general issue with the install method but dedicated to the system stage or so. But without logs or details I have no chance to investigate .
I’ll do another test on RPi.
EDIT: Also on RPi it all works fine. Unable to replicate any issues.
Thanks for your trials. Have you tried with RPi Zero W? Maybe this is where the issue is.
I switched to Raspberry Pi OS Lite and did not experience any of the described by me issues with DietPi and Node-Red.
Have you tried to work with Node-Red installed by the DietPi embedded software installation system? If not, please try it and then from Node-Red try to install node-red-node-pi-gpio v1.2.3 from the “Manage palette”. In my case it was failing. My steps were as follows:
Flash SD with DietPi_RPi-ARMv6-Buster.7z downloaded April 21st, 2021
Boot Raspberry Pi Zero W v1.1 with the prepared SD.
Install Node-Red via DietPi-software and “Software Optimized”
Access Node-Red flow creator via web broswer.
Try to install node-red-node-pi-gpio v1.2.3 from the “Manage palette”.
I was getting install error notification.
I do not have details for the displayed error and for other things as when I tried to create an account to post this issue here your account creator was not working, throwing some crazy message saying that “some action cannot be performed” or something similar. I got back to operation day later so I created an accound and posted. Earlier I was too pissed on DietPi. OS was not working as expected and then it was impossible to create an account to post here about the issues.
BTW for installation of Node-Red I tried to use the following script:
It did exactly those steps, which worked fine on multiple systems. We’d need to check the exact error message and in case Node-RED debug logs to be able to further investigate.
I went today through the listed steps at my Raspberry Pi 2B+ and installation of RPI-GPIO 1.2.3. lib from inside Node-Red works fine. I used exactly the same image as before for RPi Zero W. So there must be something wrong with DietPi driving RPi Zero W. When I was playing with my Zero W I actually installed the OS two times to check if this was me who crashed something on the way or something wrong with the OS working with specific HW platform and it seems DietPi is not well tested on RasPi Zero W.
just to avoid a misunderstanding. DietPi is not an own OS. In case of RPi devices, Raspberry OS is used as base image. Means, DietPi is a Raspberry OS with reduced amount of packages and some scripting on top. As well RPi Zero W is, behind RPi3 and 4, one of the most popular model. More than 7% of our users using such a SBC. (according survey statistics)
Indeed, DietPi is very well tested on RPi Zero and the benefit of using the official Raspberry Pi OS distro and kernel is that it is cross-compatible across all DietPi models and tested with the official Raspberry Pi OS. From the CPU/architecture perspective, RPi Zero = RPi 1 = ARMv6 hard-float, so its very unlikely that there are any differences between Node-RED running on the one or on the other. I more suspect an issue with disk writes, possible RAM shortage, CPU temperature or voltage issues. The RPi Zero is clearly more prune to such things as it runs the same SoC on higher clock rates by default.
The other thing is the difference between the Node-RED installer script, which is very old, using an outdated Node version etc and installs Node-RED as global system module instead of local one, which breaks the ability to update or uninstall core modules without implying security downsides. The principal method of doing a local install has been tested intensively and is unlikely affected at all by the SBC/SoC/architecture, but for completeness it needs to be mentioned.
If we want to debug this, we need the exact error message and service + system logs, as we are not able to replicate it following the above steps. The thread is here, so hopefully other users find it if having similar issues.
I will repeat, I used the same Raspberry Pi Zero W v1.1 with exactly the same SD card.
I run three experiments:
DietPi
DietPi (again flashed the same SD with the same image)
Raspberry Pi OS Lite
In 1 & 2 I installed Node-Red with use of Optimized Software DietPi installer and the installed Node-Red does not allow to install any additional libraries (installation triggered from inside Node-Red with use of embedded libs manager), eg. …RPI-GPIO v1.2.3. I then tried to run Node-Red update according to DietPi webpage using these instructions:
systemctl stop node-red
cd /mnt/dietpi_userdata/node-red
sudo -u nodered npm up node-red
systemctl start node-red
Above instructions crashed the Node-Red which could not be started anymore (same in experiment 1 & 2).
Then I uninstalled the Node-Red with use of DietPi Optimised Software Uninstaller and tried to installer it with use of this well known and popular script:
It was not possibe, as the script says that DietPi is recognized and that I should use DietPi Optimised Software installer to install Node-Red.
I gave up after above. I stepted into experiment 3:
I flashed the same SD card with RaspberryPi OS Lite and inserted the SD into the same Raspberry Pi Zero v1.1.
Then I run the script:
Node-Red was working straight of the box, RPI-GPIO v.1.2.3 was installed automatically by the script and I could easily install other libs from inside the Node-Red.
Above tells me that DietPi Optimised Software installed does something wrong. So you can keep repeating that DietPi is a sort of RaspberryPi distro port and that it’s well tested but I can see on my own eyes is that your Optimised Software installer does something wrong and it would be worth repairing it. And this was definitely not well tested.
BTW I really appreciate the fact that you are very communicative on this forum and that you try to understand where the issue is. Thanks for that! Good standards!
I understood and have no doubt that something went wrong in your case. The issue still is that we do not see an obvious bug, cannot replicate the issue and have no logs to start any debugging with. It’s good that we (including you) collected all information here that helps with debugging, if anyone else is facing that issue and I’m happy that you have a functional Node-RED instance now.
Btw, if anyone wants to use the curl installer on DietPi, ping me here and we’ll remove the DietPi exit path from the installer, to allow further debugging.
MichaIng
I’m able to replicate the issue on my RPi1.
Looks like somewhere around installation of RPI-GPIO v1.2.3. (via web interface) quite some files are vanished from file system. This lead node to fail
root@DietPi1:/mnt/dietpi_userdata/node-red# systemctl status node-red
● node-red.service - Node-RED (DietPi)
Loaded: loaded (/etc/systemd/system/node-red.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2021-05-02 15:40:31 CEST; 6s ago
Process: 628 ExecStart=/mnt/dietpi_userdata/node-red/node_modules/.bin/node-red -u /mnt/dietpi_userdata/node-red (code=exited, status=203/EXEC
)
Main PID: 628 (code=exited, status=203/EXEC)
May 02 15:40:31 DietPi1 systemd[1]: Started Node-RED (DietPi).
May 02 15:40:31 DietPi1 systemd[628]: node-red.service: Failed to execute command: No such file or directory
May 02 15:40:31 DietPi1 systemd[628]: node-red.service: Failed at step EXEC spawning /mnt/dietpi_userdata/node-red/node_modules/
.bin/node-red: No such file or directory
May 02 15:40:31 DietPi1 systemd[1]: node-red.service: Main process exited, code=exited, status=203/EXEC
May 02 15:40:31 DietPi1 systemd[1]: node-red.service: Failed with result 'exit-code'.
root@DietPi1:/mnt/dietpi_userdata/node-red#
Hmm, when installing the module via web interface (palette manager), did the green popup appear that it went well?
And journalctl -u node-red doesn’t show an error either (before restart attempt)?
It removes the Node-RED core module, it seems. Probably in the architecture + Node version, the Node-RED core module is not compatible with the RPi.GPIO module, so that installing the letter one automatically removes the first, or it downgrades Node-RED core, breaking itself (the web interface) so that it does not install the lower version anymore. The only idea I have at least. To verify this, one could do a clean install, then:
cd /mnt/dietpi_userdata/node-red
sudo -u nodered npm i node-red-node-pi-gpio
So the install over the local Node-RED core can be followed, including any possible dependency issues.
If the idea is true, then we should check back with Node-RED devs, whether it is possible to abort module installs/upgrades from the web interface in the first place, instead of having other modules purged or downgraded without any user information and confirmation about that. When Node-RED core is a system module, the web interface had no permissions to change it, but if other modules are potentially removed or downgraded, this is still an issue that should be addressed.
I have a spare SD under hand so I made a clean install again. Before I read the above message I installed Node-Red with use of DietPi Optimized Software wizard.
In Node-Red web interface, triggered installation of RPI-GPIO v1.2.3 throws after some time a pop-up with:
Failed to install: node-red-node-pi-gpio
Install failed
Check the log for more information
There are two buttons: Close and View log. The view log shows:
2021-05-02T19:20:17.111Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-node-pi-gpio@1.2.3
2021-05-02T19:21:35.404Z [out] + node-red-node-pi-gpio@1.2.3
2021-05-02T19:21:35.404Z [out] added 1 package from 1 contributor and removed 302 packages in 68.346s
2021-05-02T19:21:35.494Z rc=0
BTW installed Node-Red version is 1.3.4.
Running the followg:
root@DietPi:~# journalctl -u node-red
…prints this:
root@DietPi:~# journalctl -u node-red
-- Logs begin at Thu 2021-03-25 20:59:27 CET, end at Sun 2021-05-02 21:21:35 CEST. --
May 02 21:16:39 DietPi systemd[1]: Started Node-RED (DietPi).
May 02 21:16:50 DietPi node-red[3503]: 2 May 21:16:50 - [info]
May 02 21:16:50 DietPi node-red[3503]: Welcome to Node-RED
May 02 21:16:50 DietPi node-red[3503]: ===================
May 02 21:16:50 DietPi node-red[3503]: 2 May 21:16:50 - [info] Node-RED version: v1.3.4
May 02 21:16:50 DietPi node-red[3503]: 2 May 21:16:50 - [info] Node.js version: v11.15.0
May 02 21:16:50 DietPi node-red[3503]: 2 May 21:16:50 - [info] Linux 5.10.17+ arm LE
May 02 21:16:54 DietPi node-red[3503]: 2 May 21:16:54 - [info] Loading palette nodes
May 02 21:17:04 DietPi node-red[3503]: 2 May 21:17:04 - [info] Settings file : /mnt/dietpi_userdata/node-red/settings.js
May 02 21:17:04 DietPi node-red[3503]: 2 May 21:17:04 - [info] Context store : 'default' [module=memory]
May 02 21:17:04 DietPi node-red[3503]: 2 May 21:17:04 - [info] User directory : /mnt/dietpi_userdata/node-red
May 02 21:17:04 DietPi node-red[3503]: 2 May 21:17:04 - [warn] Projects disabled : editorTheme.projects.enabled=false
May 02 21:17:04 DietPi node-red[3503]: 2 May 21:17:04 - [info] Flows file : /mnt/dietpi_userdata/node-red/flows_DietPi.json
May 02 21:17:04 DietPi node-red[3503]: 2 May 21:17:04 - [info] Creating new flow file
May 02 21:17:04 DietPi node-red[3503]: 2 May 21:17:04 - [warn]
May 02 21:17:04 DietPi node-red[3503]: ---------------------------------------------------------------------
May 02 21:17:04 DietPi node-red[3503]: Your flow credentials file is encrypted using a system-generated key.
May 02 21:17:04 DietPi node-red[3503]: If the system-generated key is lost for any reason, your credentials
May 02 21:17:04 DietPi node-red[3503]: file will not be recoverable, you will have to delete it and re-enter
May 02 21:17:04 DietPi node-red[3503]: your credentials.
May 02 21:17:04 DietPi node-red[3503]: You should set your own key using the 'credentialSecret' option in
May 02 21:17:04 DietPi node-red[3503]: your settings file. Node-RED will then re-encrypt your credentials
May 02 21:17:04 DietPi node-red[3503]: file using your chosen key the next time you deploy a change.
May 02 21:17:04 DietPi node-red[3503]: ---------------------------------------------------------------------
May 02 21:17:05 DietPi node-red[3503]: 2 May 21:17:05 - [info] Server now running at http://127.0.0.1:1880/
May 02 21:17:05 DietPi node-red[3503]: 2 May 21:17:05 - [info] Starting flows
May 02 21:17:05 DietPi node-red[3503]: 2 May 21:17:05 - [info] Started flows
May 02 21:20:17 DietPi node-red[3503]: 2 May 21:20:17 - [info] Installing module: node-red-node-pi-gpio, version: 1.2.3
May 02 21:21:35 DietPi node-red[3503]: 2 May 21:21:35 - [info] Installed module: node-red-node-pi-gpio
May 02 21:21:35 DietPi node-red[3503]: 2 May 21:21:35 - [warn] Installation of module node-red-node-pi-gpio failed:
May 02 21:21:35 DietPi node-red[3503]: 2 May 21:21:35 - [warn] ------------------------------------------
May 02 21:21:35 DietPi node-red[3503]: 2 May 21:21:35 - [warn] undefined
May 02 21:21:35 DietPi node-red[3503]: 2 May 21:21:35 - [warn] ------------------------------------------
May 02 21:21:35 DietPi node-red[3503]: Error: Install failed
May 02 21:21:35 DietPi node-red[3503]: at exec.run.then.catch.result (/mnt/dietpi_userdata/node-red/node_modules/@node-red/registry/lib/installer.js:214:23)
May 02 21:21:35 DietPi node-red[3503]: at processTicksAndRejections (internal/process/task_queues.js:86:5)
May 02 21:21:35 DietPi node-red[3503]: 2 May 21:21:35 - [error] Error: Install failed
Running this:
cd /mnt/dietpi_userdata/node-red
sudo -u nodered npm i node-red-node-pi-gpio
…prints this:
root@DietPi:~# cd /mnt/dietpi_userdata/node-red
root@DietPi:/mnt/dietpi_userdata/node-red# sudo -u nodered npm i node-red-node-pi-gpio
+ node-red-node-pi-gpio@1.2.3
updated 1 package and audited 1 package in 5.588s
found 0 vulnerabilities
root@DietPi:/mnt/dietpi_userdata/node-red#
root@DietPi1:/mnt/dietpi_userdata/node-red# sudo -u nodered npm i node-red-node-pi-gpio
+ node-red-node-pi-gpio@1.2.3
added 1 package from 1 contributor, removed 302 packages and audited 1 package in 104.427s
found 0 vulnerabilities
removed 302 packages vs added 1 package WTF
/mnt/dietpi_userdata/node-red/node_modules/.bin if nearly empty
root@DietPi1:/mnt/dietpi_userdata/node-red/node_modules/.bin# ls -la
total 16
drwxr-xr-x 2 nodered nodered 4096 May 2 21:53 .
drwxr-xr-x 5 nodered nodered 12288 May 2 21:54 ..
lrwxrwxrwx 1 nodered nodered 33 May 2 17:07 detect-libc -> ../detect-libc/bin/detect-libc.js
lrwxrwxrwx 1 nodered nodered 20 May 2 17:07 needle -> ../needle/bin/needle
lrwxrwxrwx 1 nodered nodered 32 May 2 17:07 node-pre-gyp -> ../node-pre-gyp/bin/node-pre-gyp
lrwxrwxrwx 1 nodered nodered 12 May 2 17:07 rc -> ../rc/cli.js
lrwxrwxrwx 1 nodered nodered 16 May 2 17:07 rimraf -> ../rimraf/bin.js
root@DietPi1:/mnt/dietpi_userdata/node-red/node_modules/.bin#
now for sure Node-Red is not starting anymore.
May 02 21:58:34 DietPi1 systemd[1]: Started Node-RED (DietPi).
May 02 21:58:34 DietPi1 systemd[2525]: node-red.service: Failed to execute command: No such file or directory
May 02 21:58:34 DietPi1 systemd[2525]: node-red.service: Failed at step EXEC spawning /mnt/dietpi_userdata/node-red/node_modules/.bin/node-red: No such file or directory
May 02 21:58:34 DietPi1 systemd[1]: node-red.service: Main process exited, code=exited, status=203/EXEC
May 02 21:58:34 DietPi1 systemd[1]: node-red.service: Failed with result 'exit-code'.
however dietpi-software reinstall 122 fix it as it will install the require modules again
# sudo -u nodered npm i node-red-node-pi-gpio
added 1 package, and audited 364 packages in 4s
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.10.0 -> 7.11.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.11.2
npm notice Run npm install -g npm@7.11.2 to update!
npm notice
Testing on ARMv7 RPi…
… Raspbian seems to do some mirror update currently, getting “File has unexpected size” errors currently. Will check later, in case tomorrow.
And by coincidence, now I see there is a PR on my Node installer fork to add support for this source: https://github.com/MichaIng/nodejs-linux-installer/pull/2
Seems like we have a solution to test. I’ll have a closer look at the PR tomorrow.
I cannot verify whether it fixes the issue with Node v11.15.0 on ARMv6, since with that version on my systems even fresh bare Node-RED does not work, so it seems to cause more fundamental issues there, including a bunch of warning during compilation .