# Trouble init flow (OrangePi)

**URL:** https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262
**Category:** General
**Tags:** function-node
**Created:** [27 January 2023 14:35 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262 "2023-01-27T14:35:23Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![namexx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/namexx/32/72976_2.png) [@namexx](https://discourse.nodered.org/u/namexx)
#### Post date: [27 January 2023 14:35 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/1 "2023-01-27T14:35:23Z")

</div>

Hi, i have using node inject as init flow. But i have a trouble.

When i unplugged my wire ethernet and after plugged, my node flow restarted...

How I can avoid this? and make it start only when my node red boots

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [27 January 2023 14:49 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/2 "2023-01-27T14:49:05Z")

</div>

What do the Node-RED logs show?

Did Node-RED restart for some reasons when you pulled the network cable? That's the only reason the Inject node would be triggered again.

---

<div class="post-metadata">

### Author: ![namexx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/namexx/32/72976_2.png) [@namexx](https://discourse.nodered.org/u/namexx)
#### Post date: [27 January 2023 15:46 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/3 "2023-01-27T15:46:48Z")

</div>

Where i can see log?

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [27 January 2023 15:48 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/4 "2023-01-27T15:48:48Z")

</div>

It depends on how you installed Node-RED, and how you run it. If you can describe how you set it up, we can point you at the logs.

---

<div class="post-metadata">

### Author: ![namexx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/namexx/32/72976_2.png) [@namexx](https://discourse.nodered.org/u/namexx)
#### Post date: [27 January 2023 15:54 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/5 "2023-01-27T15:54:36Z")

</div>

Im using ubuntu one device OrangePi R1+

[https://nodered.org/docs/getting-started/raspberrypi](https://nodered.org/docs/getting-started/raspberrypi)

---

<div class="post-metadata">

### Author: ![namexx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/namexx/32/72976_2.png) [@namexx](https://discourse.nodered.org/u/namexx)
#### Post date: [27 January 2023 15:56 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/6 "2023-01-27T15:56:56Z")

</div>

![Log Node RED](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/7/272e4bd1c0b1be57eb27e338fd77d6c52becf349.png)

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [27 January 2023 16:00 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/7 "2023-01-27T16:00:02Z")

</div>

You're going to have to work this out yourself as I can't dig through your logs.

As I said, the only reason an Inject node would fire on start is if Node-RED has restarted. So you need to look at the logs whilst pulling the network cable. (use `node-red-log` to stream the logs - assuming you used the pi install script you linked to) to see what Node-RED does.

---

<div class="post-metadata">

### Author: ![namexx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/namexx/32/72976_2.png) [@namexx](https://discourse.nodered.org/u/namexx)
#### Post date: [27 January 2023 16:04 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/8 "2023-01-27T16:04:19Z")

</div>

I found the log share my capture

 ![Captura de pantalla de 2023-01-27 13-03-25](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/4/a4b853950872c07211349ecc9246ebcfdabc84a2.png)

---

<div class="post-metadata">

### Author: ![namexx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/namexx/32/72976_2.png) [@namexx](https://discourse.nodered.org/u/namexx)
#### Post date: [27 January 2023 16:05 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/9 "2023-01-27T16:05:57Z")

</div>

```auto
  at afterDns (node:dgram:659:5)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 3.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
27 Jan 13:03:47 - [info]
Welcome to Node-RED
===================
27 Jan 13:03:47 - [info] Node-RED version: v3.0.2
27 Jan 13:03:47 - [info] Node.js version: v16.19.0
27 Jan 13:03:47 - [info] Linux 5.10.44-rockchip64 arm64 LE
27 Jan 13:03:51 - [info] Loading palette nodes
27 Jan 13:03:57 - [info] Settings file : /root/.node-red/settings.js
27 Jan 13:03:57 - [info] Context store : 'default' [module=memory]
27 Jan 13:03:57 - [info] User directory : /root/.node-red
27 Jan 13:03:58 - [info] Projects directory: /root/.node-red/projects
27 Jan 13:03:58 - [error] Uncaught Exception:
27 Jan 13:03:58 - [error] Error: listen EADDRINUSE: address already in use 0.0.0.0:1880
    at Server.setupListenHandle [as _listen2] (node:net:1463:16)
    at listenInCluster (node:net:1511:12)
    at doListen (node:net:1660:7)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 4.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
27 Jan 13:04:22 - [info]
Welcome to Node-RED
===================
27 Jan 13:04:22 - [info] Node-RED version: v3.0.2
27 Jan 13:04:22 - [info] Node.js version: v16.19.0
27 Jan 13:04:22 - [info] Linux 5.10.44-rockchip64 arm64 LE
27 Jan 13:04:26 - [info] Loading palette nodes
27 Jan 13:04:33 - [info] Settings file : /root/.node-red/settings.js
27 Jan 13:04:33 - [info] Context store : 'default' [module=memory]
27 Jan 13:04:33 - [info] User directory : /root/.node-red
27 Jan 13:04:33 - [info] Projects directory: /root/.node-red/projects
27 Jan 13:04:33 - [error] Uncaught Exception:
27 Jan 13:04:33 - [error] Error: listen EADDRINUSE: address already in use 0.0.0.0:1880
    at Server.setupListenHandle [as _listen2] (node:net:1463:16)
    at listenInCluster (node:net:1511:12)
    at doListen (node:net:1660:7)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Scheduled restart job, restart counter is at 5.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
27 Jan 13:04:58 - [info]
Welcome to Node-RED
===================
27 Jan 13:04:58 - [info] Node-RED version: v3.0.2
27 Jan 13:04:58 - [info] Node.js version: v16.19.0
27 Jan 13:04:58 - [info] Linux 5.10.44-rockchip64 arm64 LE
27 Jan 13:05:02 - [info] Loading palette nodes
27 Jan 13:05:09 - [info] Settings file : /root/.node-red/settings.js
27 Jan 13:05:09 - [info] Context store : 'default' [module=memory]
27 Jan 13:05:09 - [info] User directory : /root/.node-red
27 Jan 13:05:09 - [info] Projects directory: /root/.node-red/projects
27 Jan 13:05:09 - [info] Server now running at http://127.0.0.1:1880/
27 Jan 13:05:10 - [info] Active project : ContadoresCom3010
27 Jan 13:05:10 - [info] Flows file : /root/.node-red/projects/ContadoresCom3010/flows.json
27 Jan 13:05:10 - [warn] Using unencrypted credentials
27 Jan 13:05:10 - [info] Starting flows
27 Jan 13:05:10 - [info] Started flows
27 Jan 13:05:12 - [red] Uncaught Exception:
27 Jan 13:05:12 - [error] Error: send ENETUNREACH 255.255.255.255:44818
    at doSend (node:dgram:713:16)
    at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18)
    at afterDns (node:dgram:659:5)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.

```

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [27 January 2023 16:07 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/10 "2023-01-27T16:07:45Z")

</div>

That just shows lots of attempts to run Node-RED when it was already running. Again, I don't know how any of that log relates to when you pulled out the network cable.

---

<div class="post-metadata">

### Author: ![namexx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/namexx/32/72976_2.png) [@namexx](https://discourse.nodered.org/u/namexx)
#### Post date: [27 January 2023 16:33 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/11 "2023-01-27T16:33:26Z")

</div>

In another post I read that the problem is:

I'm not very good at this to solve it

```auto
[error] Error: send ENETUNREACH 255.255.255.255:44818

```

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [27 January 2023 17:03 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/12 "2023-01-27T17:03:11Z")

</div>

Having a single line like that without any context makes it hard to suggest what is wrong.

What other post did you read to find that?

My guess is a node you have does not like having the network pulled out and is crashing Node-RED. Node-RED then restarts and retriggers your Inject node.

So the question is what node is causing the crash.... that isn't something we can tell you without a more complete log output from the error.

---

<div class="post-metadata">

### Author: ![namexx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/namexx/32/72976_2.png) [@namexx](https://discourse.nodered.org/u/namexx)
#### Post date: [27 January 2023 17:08 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/13 "2023-01-27T17:08:56Z")

</div>

I opened an empty project and it keeps throwing that error, now I'm going to reinstall my system in case something is misconfigured

---

<div class="post-metadata">

### Author: ![namexx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/namexx/32/72976_2.png) [@namexx](https://discourse.nodered.org/u/namexx)
#### Post date: [27 January 2023 18:03 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/14 "2023-01-27T18:03:51Z")

</div>

I found the problem and how do I fix it!

It turns out that I am using an orange Pi device but I installed node-red using the following link because it has debian opartive system.

[Running on Raspberry Pi : Node-RED (nodered.org)](https://nodered.org/docs/getting-started/raspberrypi)

Any method of installing using those link, they broke node-red on my operating system.

The solution is the next:

Step 1:Install node-red using:

> npm install -g --unsafe-perm node-red

Step2 then pm2 should be installed

> sudo npm install -g pm2

> pm2 start /usr/bin/node-red --node-args="--max-old-space-size=128" -- -v

> pm2 save

> pm2 startup

> pm2 startup systemd

And last step reboot system

---

<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: [10 February 2023 18:04 UTC](https://discourse.nodered.org/t/trouble-init-flow-orangepi/74262/15 "2023-02-10T18:04:49Z")

</div>

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