The Problem

If you have experienced a LONG delay (5 minutes!) after Node-Red is started after a reboot, then here’s the solution.  But first the symptoms.  When Node-Red starts it puts out lines like this:

Starting as a systemd service.
Started Node-RED graphical event wiring tool.

and then waits 5 minutes before eventually continuing.  It only happens on the first Node-Red start after a reboot.

When it does continue you will see lines like these /var/log/messages:

May 6 12:46:55 pi kernel: [ 53.424513] EXT4-fs (mmcblk0p2): resized filesystem to 7542272
May 6 12:52:11 pi kernel: [ 369.491684] random: crng init done
May 6 12:52:11 pi kernel: [ 369.491705] random: 7 urandom warning(s) missed due to ratelimiting

The delay is evident between the first and second lines.  It would appear that it is waiting to seed the random number generator by using mouse movements.  See here for details (I think this person is seeing it as a boot delay because their Node-Red is set to start automatically at boot.) It’s unlikely your moving the mouse during that random number initialization, so there must be a 5 minute timeout.

The Solution

Run the following 2 lines at the Pi prompt.

sudo apt install haveged
sudo systemctl enable haveged

Then reboot and confirm the delay is significantly reduced.  For more information on haveged go here.

My Raspberry Pi Setup

$ cat /etc/os-release
PRETTY_NAME=”Raspbian GNU/Linux 9 (stretch)”
NAME=”Raspbian GNU/Linux”
VERSION=”9 (stretch)”

$ npm -v

[info] Node-RED version: v3.0.2
[info] Node.js version: v14.21.3
[info] Linux 4.19.66+ arm LE


Share This