• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

sudo systemctl enable nodered.service doesn't "stick"

Q&A Forum › Category: ESP32 › sudo systemctl enable nodered.service doesn't "stick"
0 Vote Up Vote Down
Joe Margevicius asked 2 years ago

Hi Sara,  I was happily doing the eBook on Home Automation with RPi and ESP, using the “buster” OS on the RPi (32 bit), until I came to installing InfluxDB … then I couldn’t get it to install (“can’t locate influxdb2”).  I saw in one of your answers that influx only works on 64 bit systems, so I powered up an RPi with “bullseye” OS (a 64  bit OS), and proceeded to go through the book again (when I just figured I’d use the .json flows I had already created, I couldn’t get the node-RED to respond to an LED change, even though the ESP acknowledged that Mosquitto had received the request). …. So, as I go through node-RED 101 again, I’m finding that  applying sudo systemctl enable nodered.service doesn’t result in nodered.service being active after a reboot (i.e. systemctl status nodered.service after reboot shows inactive) … I can restart it, but it after a few minutes, the status shows it’s inactive again.  I can repeat this (i.e. restart, status, status ) and it’s active initially, then goes inactive.
 
Do you know of issues with the Bullseye OS with node-red?   Thanks for any help here

Question Tags: Node-Red
5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
In the ebook is it mentioned that you need to run Raspberry Pi OS 64-bit.
InfluxDB 2 is not compatible with Raspberry Pi OS 32.bit.
 
Try to run:

sudo systemctl start nodered 

And then again:

sudo systemctl enable nodered.service 

 
Then, check if Node-RED is running…
 
Regards,
Sara

0 Vote Up Vote Down
Joe Margevicius answered 2 years ago

Hi Sara … the problem is that sudo systemctl enable nodered.service doesn’t keep the service up.  When I start the service (i.e. sudo systemctl start nodered), and then immediately check status (i.e. sudo systemctl status nodered.service) it shows it’s active (i.e. working).  When I do a status check after ~30 seconds, it shows it’s failed.

I’ve never seen anything like this before.  Here is the “success” status report just after a start….

~/code $ sudo systemctl status nodered.service
● nodered.service – Node-RED graphical event wiring tool
Loaded: loaded (/lib/systemd/system/nodered.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2023-01-23 07:49:13 PST; 2s ago
Docs: http://nodered.org/docs/hardware/raspberrypi.html
Main PID: 1160 (node)
Tasks: 7 (limit: 779)
CPU: 2.784s
CGroup: /system.slice/nodered.service
└─1160 [node]
Jan 23 07:49:13 elearn64 systemd[1]: Started Node-RED graphical event wiring tool.
Jan 23 07:49:15 elearn64 Node-RED[1160]: Failed to get https settings: TypeError: Cannot read properties of undefined (reading ‘length’)
Jan 23 07:49:15 elearn64 Node-RED[1160]: TypeError: Cannot read properties of undefined (reading ‘length’)
Jan 23 07:49:15 elearn64 Node-RED[1160]: at basicAuthMiddleware (/usr/lib/node_modules/node-red/red.js:365:18)
Jan 23 07:49:15 elearn64 Node-RED[1160]: at /usr/lib/node_modules/node-red/red.js:412:39

 

……. and here is the report a few seconds later:
~/code $ sudo systemctl status nodered.service
● nodered.service – Node-RED graphical event wiring tool
Loaded: loaded (/lib/systemd/system/nodered.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Mon 2023-01-23 07:49:15 PST; 7s ago
Docs: http://nodered.org/docs/hardware/raspberrypi.html
Process: 1160 ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 1160 (code=exited, status=0/SUCCESS)
CPU: 2.801s
Jan 23 07:49:13 elearn64 systemd[1]: Started Node-RED graphical event wiring tool.
Jan 23 07:49:15 elearn64 Node-RED[1160]: Failed to get https settings: TypeError: Cannot read properties of undefined (reading ‘length’)
Jan 23 07:49:15 elearn64 Node-RED[1160]: TypeError: Cannot read properties of undefined (reading ‘length’)
Jan 23 07:49:15 elearn64 Node-RED[1160]: at basicAuthMiddleware (/usr/lib/node_modules/node-red/red.js:365:18)
Jan 23 07:49:15 elearn64 Node-RED[1160]: at /usr/lib/node_modules/node-red/red.js:412:39
Jan 23 07:49:15 elearn64 systemd[1]: nodered.service: Succeeded.
Jan 23 07:49:15 elearn64 systemd[1]: nodered.service: Consumed 2.801s CPU time.

I can do this start / status check / status check  cycle “until the cows come home” and it’s the same: 1st check shows active, 2nd check shows inactive … weird!  If you don’t have a clue, I’ll try a rebuild of the Bullseye OS and see if I get the same result (by the way, I’ve been using RPi for over 10 years and so didn’t even read your chapter on RPi in the eBook ! … so I missed the need for a 64 bit OS for influx … I paid for it !  … as I wrote earlier, I was fine with node-RED and MQTT with the 32 bit OS Buster, so I have to get at least these operational before getting into influx …. thanks for any help here!) — JoeM   (I tried using the enable function and that didn’t help … this is for rebooting so I wouldn’t expect it to change the start / status / status results.  When I reboot, I do get the same result: inactive after the 2nd status check!)

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

That’s weird indeed…
I’ve searched for a while and didn’t find a solution to that particular problem.
So, you might experiment starting with a fresh install and see what you get.
You may also try to update and upgrade your system before trying a new installation and see if that solves the issue.
Regards,
Sara

0 Vote Up Vote Down
Joe Margevicius answered 2 years ago

Hi Sara … so I reimaged the Bullseye OS, and went through node-RED 101 in the book (i.e. up to the MQTT chapter), and it is working fine ! … sorry to have taken up your time :–(  … it’s a mystery, but so is consciousness 😉
 
You can consider this resolved.

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Great.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.