Node-red doesnt deploy after connecting gpio pins

I have been using an dht sensor in my flow and i cannot start node-red. I tried updating node-red and nodejs along with using different pi to check if there is any issues.

Sometimes node-red flows get started but i cannot use the gui to access the nodes and flow.

when i start node-red i get this :
Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.30:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.30:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
4 Jun 12:30:37 - [info]
Welcome to Node-RED

4 Jun 12:30:37 - [info] Node-RED version: v1.3.3
4 Jun 12:30:37 - [info] Node.js version: v10.24.0
4 Jun 12:30:37 - [info] Linux 5.10.17-v7+ arm LE
4 Jun 12:30:46 - [info] Loading palette nodes
4 Jun 12:30:56 - [info] Dashboard version 2.29.0 started at /ui
4 Jun 12:30:57 - [warn] ------------------------------------------------------
4 Jun 12:30:57 - [warn] [node-red-node-serialport/serialport] Error: The module '/home/pi/.node-red/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
4 Jun 12:30:57 - [warn] [node-red-contrib-easybotics-ina219-sensor/ina] Error: The module '/home/pi/.node-red/node_modules/i2c-bus/build/Release/i2c.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
4 Jun 12:30:57 - [warn] [node-red-contrib-easybotics-pca9685/PCA] Error: The module '/home/pi/.node-red/node_modules/i2c-bus/build/Release/i2c.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
4 Jun 12:30:57 - [warn] ------------------------------------------------------
4 Jun 12:30:57 - [info] Settings file : /home/pi/.node-red/settings.js
4 Jun 12:30:57 - [info] Context store : 'default' [module=memory]
4 Jun 12:30:57 - [info] User directory : /home/pi/.node-red
4 Jun 12:30:57 - [warn] Projects disabled : editorTheme.projects.enabled=false
4 Jun 12:30:57 - [info] Flows file : /home/pi/.node-red/flows_rpi1.json
4 Jun 12:30:57 - [warn]

Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

4 Jun 12:30:57 - [info] Starting flows
4 Jun 12:31:00 - [error] [rc522:2dd52caf.bb4084] Error: The module '/home/pi/.node-red/node_modules/rpio/build/Release/rpio.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
4 Jun 12:31:00 - [info] Started flows
4 Jun 12:31:02 - [error] [MySQLdatabase:e18a7475.dfea58] Error: connect ECONNREFUSED 127.0.0.1:3306

Tried rebuilding using npm still getting errors
Error: The module '/home/pi/.node-red/node_modules/rpio/build/Release/rpio.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).

So you've fixed some but not all of the issues. Presumably you changed node.js major version but didn't rebuild your nodes.

Sometimes, it is easier (though it can take a while on a Pi) to simply delete the folder ~/.node-red/node_modules then, from folder ~/.node-red/, do an npm install which should reinstall everything, rebuilding as it goes.

Thanks!, I did that and now i have a different error

Starting as a systemd service.
5 Jun 12:18:25 - [info]
Welcome to Node-RED

5 Jun 12:18:25 - [info] Node-RED version: v1.3.5
5 Jun 12:18:25 - [info] Node.js version: v14.17.0
5 Jun 12:18:25 - [info] Linux 5.10.17-v7l+ arm LE
5 Jun 12:18:26 - [info] Loading palette nodes
5 Jun 12:18:29 - [info] Dashboard version 2.28.2 started at /ui
5 Jun 12:18:30 - [info] Settings file : /home/pi/.node-red/settings.js
5 Jun 12:18:30 - [info] Context store : 'default' [module=memory]
5 Jun 12:18:30 - [info] User directory : /home/pi/.node-red
5 Jun 12:18:30 - [warn] Projects disabled : editorTheme.projects.enabled=false
5 Jun 12:18:30 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
5 Jun 12:18:30 - [info] Server now running at http://127.0.0.1:1880/
5 Jun 12:18:30 - [warn]

Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

5 Jun 12:18:30 - [info] Starting flows
5 Jun 12:18:31 - [info] Started flows
5 Jun 12:18:31 - [info] [mqtt-broker:ab34aa77.2c06c8] Connected to broker: mqtt://localhost:1883
<--- Last few GCs --->
[5357:0x50b7020] 295541 ms: Mark-sweep 1987.7 (2060.7) -> 1980.9 (2062.7) MB, 29111.7 / 0.1 ms (average mu = 0.090, current mu = 0.010) allocation failure scavenge might not succeed
[5357:0x50b7020] 325018 ms: Mark-sweep 1989.3 (2062.7) -> 1982.3 (2064.0) MB, 29262.3 / 0.1 ms (average mu = 0.048, current mu = 0.007) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
nodered.service: Main process exited, code=killed, status=6/ABRT
nodered.service: Failed with result 'signal'.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 1.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
5 Jun 12:24:41 - [info]
Welcome to Node-RED

Have a search on the web for this. Is it possible your flow is creating a loop and exhausting memory?

Well i searched and some say there might be an leakage of memory through loops in the flow causing it to stop node-red, well i dont know what might be the cause but this started after i used mqtt in node to send values from my python program and just inject node to send values every 3-4 seconds of intervals . i have no idea how to remove nodes causing the problem. is there any way to edit the json file of the flow

do you subscribe to a topic in node-red that you later publish to?

e.g.
MQTT IN test/test → some node → some node → MQTT OUT test/test
or
e.g. MQTT IN test/# → some node → some node → MQTT OUT test/test

that would cause an MQTT loop.

I am publishing from my python code
eg :
publish.single("test/volt",voltage,hostname ="raspberrypi")

later use MQTT IN test/volt → gauge

I hope it makes sense , i am very noob in node-red and mqtt. so i have very less knowledge in it.

You can start node-red in safe mode and fix up your flows / remove any bad nodes.

node-red --safe

Thank you!,

i don't know why but few of the inject nodes sending number as payload for every 3-4 seconds caused it to stop working. i have disabled the few inject nodes and now its working properly.

I also wanted to ask if there is any issues with DHT sensor node causing the same problem. because It all started from there since i'm not using any GPIO pins.

Either ways, thank you !

You should try to recreate the issue (enable the injects but turn off the interval - operate them manually)

then go to the github repo & check the issues pages - raise a new issue if necessary (once you pin down the cause)

Sure will do that, Thanks!

Also Why doesn't the function node return number or why the RPIO out consider it as string even though it is not. I am sending 0 or 1 for unlocking the door and if the switch case match it sends 1 to unlock. But now the RPIO accepts it as a string.

Sorry for asking a different issue but i have a deadline coming up so my bad.

From the node-red docs...

The function must always return a msg object. Returning a number or string will result in an error.

So if you want to return a number, you use a property (like payload) e.g.

// ... your code ...
// ... etc ...
msg.payload = 1;
return msg;

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