# Node-red doesnt deploy after connecting gpio pins

**URL:** https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694
**Category:** General
**Created:** [4 June 2021 08:27 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694 "2021-06-04T08:27:54Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![raj2911](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@raj2911](https://discourse.nodered.org/u/raj2911)
#### Post date: [4 June 2021 08:27 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/1 "2021-06-04T08:27:55Z")

</div>

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](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](http://flows.nodered.org)

Starting as a systemd service.

---

<div class="post-metadata">

### Author: ![raj2911](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@raj2911](https://discourse.nodered.org/u/raj2911)
#### Post date: [4 June 2021 08:49 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/2 "2021-06-04T08:49:25Z")

</div>

Start Node-RED

Once Node-RED has started, point a browser at [http://192.168.1.30:1880](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](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

---

<div class="post-metadata">

### Author: ![raj2911](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@raj2911](https://discourse.nodered.org/u/raj2911)
#### Post date: [4 June 2021 08:50 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/3 "2021-06-04T08:50:03Z")

</div>

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`).

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [4 June 2021 21:11 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/4 "2021-06-04T21:11:48Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![raj2911](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@raj2911](https://discourse.nodered.org/u/raj2911)
#### Post date: [5 June 2021 08:30 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/5 "2021-06-05T08:30:00Z")

</div>

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/](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

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [5 June 2021 08:37 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/6 "2021-06-05T08:37:18Z")

</div>

> [@raj2911](#):
>
> FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

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

---

<div class="post-metadata">

### Author: ![raj2911](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@raj2911](https://discourse.nodered.org/u/raj2911)
#### Post date: [5 June 2021 08:56 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/7 "2021-06-05T08:56:58Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [5 June 2021 08:59 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/8 "2021-06-05T08:59:36Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![raj2911](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@raj2911](https://discourse.nodered.org/u/raj2911)
#### Post date: [5 June 2021 09:12 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/9 "2021-06-05T09:12:46Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [5 June 2021 09:15 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/10 "2021-06-05T09:15:00Z")

</div>

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

`node-red --safe`

---

<div class="post-metadata">

### Author: ![raj2911](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@raj2911](https://discourse.nodered.org/u/raj2911)
#### Post date: [5 June 2021 09:47 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/11 "2021-06-05T09:47:32Z")

</div>

Thank you!,

 ![2021-06-05-134844_1600x900_scrot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/3/f3128e75387ea4f985685dd2d38cbc30d0186240.png)

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 !

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [5 June 2021 09:50 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/12 "2021-06-05T09:50:08Z")

</div>

> [@raj2911](#):
>
> I also wanted to ask if there is any issues with DHT sensor node

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)

---

<div class="post-metadata">

### Author: ![raj2911](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@raj2911](https://discourse.nodered.org/u/raj2911)
#### Post date: [6 June 2021 05:26 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/13 "2021-06-06T05:26:28Z")

</div>

Sure will do that, Thanks!

---

<div class="post-metadata">

### Author: ![raj2911](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@raj2911](https://discourse.nodered.org/u/raj2911)
#### Post date: [6 June 2021 05:35 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/14 "2021-06-06T05:35:45Z")

</div>

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.

 ![2021-06-06-092300_1024x768_scrot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/2/d2ede2ff549a94410c958a43ff866941d184c71e.png)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [6 June 2021 06:46 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/15 "2021-06-06T06:46:02Z")

</div>

> [@raj2911](#):
>
> Also Why doesn't the function node return number

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.

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

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [20 June 2021 06:46 UTC](https://discourse.nodered.org/t/node-red-doesnt-deploy-after-connecting-gpio-pins/46694/16 "2021-06-20T06:46:43Z")

</div>

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