Problems installing Node-red on an old Raspberry Pi

I am trying to get Node-red working on a Raspberry Pi Zero (it is a Zero W but the wifi chip died)

  1. Should I be able to install NR with the SD card in a modern Pi (Zero 2 W) and it work in a Zero?
    I did try this but so far no success.

At the moment I am using a Pi 3a with a wifi dongle but the install repeatedly fails at the same place.
The install log shows

1778 timing reify:rollback:retireShallow Completed in 6ms
1779 timing command:i Completed in 763375ms
1780 verbose type system
1781 verbose stack FetchError: request to https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz failed, reason: Client network socket disconnected before secure TLS connection was established
1781 verbose stack     at ClientRequest.<anonymous> (/usr/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
1781 verbose stack     at ClientRequest.emit (node:events:517:28)
1781 verbose stack     at TLSSocket.socketErrorListener (node:_http_client:501:9)
1781 verbose stack     at TLSSocket.emit (node:events:529:35)
1781 verbose stack     at emitErrorNT (node:internal/streams/destroy:151:8)
1781 verbose stack     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
1781 verbose stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
1782 verbose cwd /home/pi
1783 verbose Linux 6.1.21+
1784 verbose node v18.18.2
1785 verbose npm  v9.8.1
1786 error code ECONNRESET
1787 error errno ECONNRESET
1788 error network request to https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz failed, reason: Client network socket disconnected before secure TLS connection was established
1789 error network This is a problem related to network connectivity.

Since a) it always fails at the same place and b) my ssh connection does not die, I think it must be something other than a network glitch.

  1. Any helpful hints?

Are you using the bash curl script?

No -different CPUs - not an specific NR thing
[edit] I mean the card won't work in the PiZeroW

1 Like

Yes, and not using --noden

pi@farpi:~ $ bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
Running Node-RED update for user pi at /home/pi on raspbian


This can take 20-30 minutes on the slower Pi versions - please wait.

  Stop Node-RED                       ✔
  Remove old version of Node-RED      ✔
  Node option not specified           :   --node16, --node18 or --node20
  Leave existing Node.js              :   v18.18.2   Npm 9.8.1
  Clean npm cache                     -
  Install Node-RED core               ✘
  Move global nodes to local          -
  Leave existing nodes                -
  Install extra Pi nodes              -
  Add shortcut commands               ✔
  Update systemd script               ✔


Any errors will be logged to   /var/log/nodered-install.log
All done.
You can now start Node-RED with the command  node-red-start
  or using the icon under   Menu / Programming / Node-RED
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started :  Fri 24 Nov 16:14:31 GMT 2023
Finished:  Fri 24 Nov 16:37:27 GMT 2023

**********************************************************************************
 ### WARNING ###
 DO NOT EXPOSE NODE-RED TO THE OPEN INTERNET WITHOUT SECURING IT FIRST

 Even if your Node-RED doesn't have anything valuable, (automated) attacks will
 happen and could provide a foothold in your local network

 Follow the guide at https://nodered.org/docs/user-guide/runtime/securing-node-red
 to setup security.

 ### ADDITIONAL RECOMMENDATIONS ###
  - Remove the /etc/sudoers.d/010_pi-nopasswd file to require entering your password
    when performing any sudo/root commands:

      sudo rm -f /etc/sudoers.d/010_pi-nopasswd

  - You can customise the initial settings by running:

      node-red admin init

  - After running Node-RED for the first time, change the ownership of the settings
    file to 'root' to prevent unauthorised changes:

      sudo chown root:root ~/.node-red/settings.js

**********************************************************************************

  Would you like to customise the settings now (y/N) ?
pi@farpi:~ $ 

I'm not clear what you are saying Simon - the OS appears to work on the Zero, and it (RPiOS Legacy) was installed using the imager on my PC.
Of course I can't SSH into it (yet) so can't be certain.

Does the NR installation include any processor specific code which will fail when the SD card is transferred to an older Pi?

Unless my memory has failed me completely - when you install Raspbian on a card - it sets itself up for the CPU environment it finds it itself in.

But maybe I'm wrong and it all works fine.

BUT ....
how do you envisage accessing NR on the duff PiZeroW without WiFi even if the card did work?

Raspbian is not the issue! RPiOS Legacy is for the older CPUs but it will run on a more modern Pi.
Thus I can install the OS, boot it up in a newer Pi and do various stuff like copy over my scripts before moving it to the old Pi. I think :grinning:

Ethernet over USB gadget mode using a short male - male USB cable to a Pi Zero 2.
I've done this before. The Zero 2 has two IP addresses : wifi 192.168.1.26 and "ethernet" 10.0.0.1. The old Zero has IP 10.0.0.2

It's not exactly practical but I want them to talk to each other to drive contrasting colour LEDs

I stand corrected - good luck :slight_smile:

What version of the OS?

I'm not sure, currently in the process of reinstalling from scratch again...

You need to install the os and nodejs on the zero. The cpu architecture is different ( arm6 vs arm7) and some of the binaries that get installed on a 7 won’t work on a 6. ( other way round is ok)

Thanks Dave. I'm currently redoing it all start to finish on the Pi 3a (which has an older CPU) because the Zero has no network access until it's all up and running. Fingers crossed.

node.js is a compiled executable I guess.

Yeah. But 3a is still arm7. You need an original pi 1 or zero.

1 Like

Thanks for the advice folks. Some hours later:

  • Burned 2021-05-07-raspios-buster-armhf-lite to an SD card, setting up hostname, wifi & ssh in RPi Imager.
  • Booted the card in a RPi 3a (not 3a+)
  • Installed Pimoroni Blinkt to permit some LED effects.
  • Used the standard Node-red install script to install NR and it's prerequisites (node.js v18)
  • Created a flow to cycle between two Blinkt example scripts.
  • Shutdown and booted the card in a Pi Zero W (but without working wifi)

The Blinkt examples do cycle between the two patterns demonstrating that RPiOS Buster and Node-red installed on a Pi 3a will run on a Pi Zero W.

I have left out OS updates which would have taken an extra hour or two and maybe broken compatibility. Maybe after the impending gratuitous LED season I'll try updating the OS on a Zero 2 W for speed and see if it still works. Probably not since it will surely replace the kernel.

You could add a Wi-Fi dongle via a (micro) usb hub.. or usb Ethernet. Then upgrade in situ.

Yeah, good ideas :grinning:. Not got one, don't have the skills to bridge USB Ethernet to Wifi on the Zero 2.

Or I could buy another Zero 2 W and stop clinging to 32 bit antiquities.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.