# Reboot, vs \`node-red-restart\`

**URL:** <https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373>\
**Category:** General\
**Created:** [10 March 2021 01:40 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373 "2021-03-10T01:40:28Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 March 2021 01:40 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/1 "2021-03-10T01:40:28Z")

</div>

Today's question:

I have flows which have `inject` nodes which inject a signal at boot.

Fair enough.

So what's the difference - as I am sure there is - between a reboot (where the machine **reboots** ) and if I go to the terminal and say `node-red-restart`

It would seem that the `inject` nodes don't trigger.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [10 March 2021 05:49 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/2 "2021-03-10T05:49:09Z")

</div>

Does the 2nd post from dceejay [from this topic](https://discourse.nodered.org/t/inject-nodes-not-firing-on-boot-up-of-raspberry-pi-4/30675) perhaps explain the behaviour ? or the reply from stefan24 ? (initial firing couple of seconds later)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 March 2021 06:22 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/3 "2021-03-10T06:22:21Z")

</div>

I scrolled down to the second post and clicked the link.

That is a whole different language to me.

Yikes.

Sorry, but I can't make sense of it.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 March 2021 08:08 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/4 "2021-03-10T08:08:33Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/390eebb8e7ad62fcfab3f3d0f96292f3d013f870.png)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 March 2021 08:15 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/5 "2021-03-10T08:15:17Z")

</div>

I'll try that.

But I don't understand what I am doing.

To test this, I have to do (rather than `node-red-restart`) is `node-red-stop` and `node-red-start` and watch the log - yes?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 March 2021 08:18 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/6 "2021-03-10T08:18:10Z")

</div>

Maybe try changing the time to 2 seconds first

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 March 2021 08:20 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/7 "2021-03-10T08:20:12Z")

</div>

Ok, taking what I just wrote as correct, I put an `inject` node set to inject ~~at boot~~ after 5 seconds.  
_That seems to have changed. No longer says AFTER BOOT_

This is the node.

```auto
[{"id":"ca336c07.164e3","type":"inject","z":"8bb4de19.f72c88","name":"This is a test node","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"3","topic":"","payload":"TEST MESSAGE","payloadType":"str","x":2110,"y":2140,"wires":[["e41494e7.5e59e"]]}]

```

I set the payload as `TEST MESSAGE` and went to the CLI.

`node-red-stop`

`node-red-start`

(With a bit of cutting the top part as it didn't show anything anyway)

```auto
10 Mar 19:16:18 - [warn] [node-red-node-sqlite/sqlite] Error: Cannot find module '/home/me/.node-red/node_modules/sqlite3/lib/binding/node-v72-linux-x64/node_sqlite3.node'
Require stack:
- /home/me/.node-red/node_modules/sqlite3/lib/sqlite3.js
- /home/me/.node-red/node_modules/node-red-node-sqlite/sqlite.js
- /usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/lib/node_modules/node-red/lib/red.js
- /usr/lib/node_modules/node-red/red.js
10 Mar 19:16:18 - [warn] [node-red-contrib-play-soundfile/config-soundfile] Error: /home/me/.node-red/node_modules/node-red-contrib-play-soundfile/config-soundfile.html does not exist
10 Mar 19:16:18 - [warn] ------------------------------------------------------
10 Mar 19:16:18 - [info] Settings file : /home/me/.node-red/settings.js
10 Mar 19:16:18 - [info] HTTP Static : /home/me/.node-red/public
10 Mar 19:16:18 - [info] Context store : 'default' [module=memory]
10 Mar 19:16:18 - [info] User directory : /home/me/.node-red
10 Mar 19:16:18 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
10 Mar 19:16:18 - [info] Flows file : /home/me/.node-red/flows_me-desktop.json
10 Mar 19:16:18 - [info] Server now running at http://127.0.0.1:1880/
10 Mar 19:16:18 - [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.
---------------------------------------------------------------------
10 Mar 19:16:18 - [info] Starting flows
TypeError: Cannot read property 'config' of null
    at addWidget (/home/me/.node-red/node_modules/node-red-dashboard/index.js:73:39)
    at Object.addWidget (/home/me/.node-red/node_modules/node-red-dashboard/index.js:137:48)
    at new LEDNodeConstructor (/home/me/.node-red/node_modules/node-red-contrib-ui-led/dist/nodes/ui_led/ui_led.js:30:29)
    at Object.createNode (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/util.js:493:31)
    at Flow.start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:194:48)
    at start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/index.js:345:33)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
TypeError: Cannot read property 'config' of null
    at addWidget (/home/me/.node-red/node_modules/node-red-dashboard/index.js:73:39)
    at Object.addWidget (/home/me/.node-red/node_modules/node-red-dashboard/index.js:137:48)
    at new LEDNodeConstructor (/home/me/.node-red/node_modules/node-red-contrib-ui-led/dist/nodes/ui_led/ui_led.js:30:29)
    at Object.createNode (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/util.js:493:31)
    at Flow.start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:194:48)
    at start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/index.js:345:33)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
10 Mar 19:16:18 - [error] [change:AUX] Invalid 'to' JSON property
10 Mar 19:16:18 - [info] [cronplus:Day Start / End] createTask - index: 0, static: true, opt: {"name":"Dawn","topic":"schedule1","payloadType":"str","payload":"Dawn","expressionType":"solar","expression":"0 * * * * * *","location":"-33.88050254877312 151.12279272092562","offset":"-60","solarType":"selected","solarEvents":"sunrise"}
10 Mar 19:16:18 - [info] [cronplus:Day Start / End] createTask - index: 1, static: true, opt: {"name":"Dusk","topic":"schedule2","payloadType":"str","payload":"Dusk","expressionType":"solar","expression":"0 * * * * * *","location":"-33.88050254877312 151.12279272092562","offset":"","solarType":"selected","solarEvents":"sunset"}
10 Mar 19:16:18 - [info] [cronplus:Day Start correct LONG value] createTask - index: 0, static: true, opt: {"name":"Dawn","topic":"schedule1","payloadType":"str","payload":"Dawn","expressionType":"solar","expression":"0 * * * * * *","location":"-33.88050254877312 151.12279272092562","offset":"","solarType":"selected","solarEvents":"sunset"}
10 Mar 19:16:18 - [info] [cronplus:Day Start / End] createTask - index: 0, static: true, opt: {"name":"Dawn","topic":"schedule1","payloadType":"str","payload":"Dawn","expressionType":"solar","expression":"0 * * * * * *","location":"33.88094790268725 -208.87731456743495","offset":"0","solarType":"selected","solarEvents":"sunrise"}
10 Mar 19:16:18 - [info] [cronplus:Day Start / End] createTask - index: 1, static: true, opt: {"name":"Dusk","topic":"schedule2","payloadType":"str","payload":"Dusk","expressionType":"solar","expression":"0 * * * * * *","location":"33.88094790268725 -208.87731456743495","offset":"0","solarType":"selected","solarEvents":"sunset"}
10 Mar 19:16:19 - [info] [cronplus:at 06:30] createTask - index: 0, static: true, opt: {"name":"schedule1","topic":"06:30","payloadType":"default","payload":"","expressionType":"cron","expression":"0 30 6 * * ? *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}
10 Mar 19:16:19 - [info] Started flows
10 Mar 19:16:19 - [info] [udp in:d3745e21.23d568] udp listener at 0.0.0.0:6722
10 Mar 19:16:19 - [info] [udp in:b33c21bd.7a57c8] udp listener at 0.0.0.0:6723
10 Mar 19:16:19 - [info] [udp out:ff1b54c.cf5b5a8] udp re-use socket: -> 192.168.0.21:6723
10 Mar 19:16:19 - [info] [mqtt-broker:TIMEPI MQTT] Connected to broker: mqtt://192.168.0.99:1883
10 Mar 19:16:21 - [warn] [function:Push Button] Setting up

```

And...... I can't see anything that to me implies it is/was injected.

# AND!

Is doing the `stop/start` the same as `restart`?  
(I don't want to go think about that)

I'm a bit worried about some of the errors though.  
(But that'll be a different thread)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 March 2021 09:04 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/8 "2021-03-10T09:04:41Z")

</div>

`node-red-restart`  
`node-red-log`  
is the same as  
`node-red-stop`  
`node-red-start`

To check whether an inject node has triggered at startup configure it to output to the console then the message will appear in syslog and in `node-red-log` (except that it might be off the front as node-red-log only shows the most recent messages. Provided the log shows the node red startup then it will show the console message.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 March 2021 09:07 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/9 "2021-03-10T09:07:28Z")

</div>

Updated NR as well....

Stopped and started.

```auto
10 Mar 20:06:08 - [info] Starting flows
TypeError: Cannot read property 'config' of null
    at addWidget (/home/me/.node-red/node_modules/node-red-dashboard/index.js:73:39)
    at Object.addWidget (/home/me/.node-red/node_modules/node-red-dashboard/index.js:137:48)
    at new LEDNodeConstructor (/home/me/.node-red/node_modules/node-red-contrib-ui-led/dist/nodes/ui_led/ui_led.js:30:29)
    at Object.createNode (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/util.js:493:31)
    at Flow.start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:194:48)
    at start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/index.js:345:33)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

```

Still happening.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 March 2021 09:09 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/10 "2021-03-10T09:09:53Z")

</div>

I posted the entire `inject` node's code.

Where is this `output to console`? I think you mean in the `debug` node - yes?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 March 2021 09:11 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/11 "2021-03-10T09:11:44Z")

</div>

After adding a `debug` node and setting to output to console (or what ever)

I see this:

```auto
10 Mar 20:10:28 - [info] [debug:e41494e7.5e59e] TEST MESSAGE

```

Ok.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 March 2021 09:23 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/12 "2021-03-10T09:23:09Z")

</div>

> [@Trying\_to\_learn](#):
>
> Where is this `output to console` ? I think you mean in the `debug` node - yes?

You deduce correctly.

---

<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:** [9 May 2021 09:23 UTC](https://discourse.nodered.org/t/reboot-vs-node-red-restart/42373/13 "2021-05-09T09:23:14Z")

</div>

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