# Problem with exec node output in Spawn mode

**URL:** <https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902>\
**Category:** General\
**Created:** [8 February 2023 17:23 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902 "2023-02-08T17:23:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![batigolle](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@batigolle](https://discourse.nodered.org/u/batigolle)\
**Post date:** [8 February 2023 17:23 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/1 "2023-02-08T17:23:24Z")

</div>

I'm using the BIGEXEC node, which runs the command: **sudo ./rf95\_server** , but I'm not seeing any output  
When I run the command in a raspberry terminal, it displays some messages on the screen every few seconds

An example of running in the terminal with two messages  
 ![ricezionedati](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/b/4b8b5572a106ab15cde1e62d1234c6c100508700.jpeg)

node flow  
 ![BIGEXEC_NODE](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/1/1198146ee17c197c02386e8bfc2298162fa74122.jpeg)

node configuration

 ![BIGEXEC_NODE_CODE](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/7/f71e4ee2c70321449b09aa30d0d3124aea53f8c1.jpeg)

message received on startup

 ![BIGEXEC_DEBUG](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3b70fbe6e519d2ae2500a155bbc7462b4b322024.jpeg)

**The command runs correctly, I don't get any errors**  
At startup, on the raspberry ,the following startup tasks appear  
 ![BIGEXEC_PROCESS](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/d/5dcbf2d3bac8bf88e86ab7a364e1632b6209b9d3.jpeg)

Why am I not getting any messages in the output of the bigexece node?  
**Do you have any suggestions ?**

---

<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:** [8 February 2023 20:02 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/2 "2023-02-08T20:02:54Z")

</div>

You may need to contact the author via GitHub. Not sure many people use those nodes who are in the forum?

---

<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:** [8 February 2023 20:35 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/3 "2023-02-08T20:35:14Z")

</div>

The debug nodes seem to be configured to output to the console (and perhaps not to the debug window ?)

---

<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:** [8 February 2023 20:45 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/4 "2023-02-08T20:45:28Z")

</div>

Is there a reason you are using bigexec rather than the core exec node?

---

<div class="post-metadata">

**Author:** ![batigolle](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@batigolle](https://discourse.nodered.org/u/batigolle)\
**Post date:** [9 February 2023 10:43 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/5 "2023-02-09T10:43:09Z")

</div>

Thanks for the reply @bakman2

The msg node is set for both outputs

---

<div class="post-metadata">

**Author:** ![batigolle](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@batigolle](https://discourse.nodered.org/u/batigolle)\
**Post date:** [9 February 2023 11:02 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/6 "2023-02-09T11:02:57Z")

</div>

Thanks for the reply @Colin  
I don't know how to process in node-red the messages generated by the command as shown in the raspberry terminal window, searching the net, I came across the bigexec command ...

**Also tried the exec command, as you suggested, but the result doesn't change, I don't get any output message**

Flow  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/2/c26d88f3ea929ab9388f4be2baf666a60a351f45.png)

Node exec configuration  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/0/709a61bcbec713057ec38f6b4260b849a5d10ec3.png)

When flow is activated, two tasks appear  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/2/72de4fd4cc4e143238cebaf450a6e5c405ee62df.png)

**I don't get any error messages or output messages**

---

<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:** [9 February 2023 11:09 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/7 "2023-02-09T11:09:54Z")

</div>

Your command uses `sudo`. This will not work because sudo generally requires an extra input on the command line. You would have to edit the sudo permissions to allow the user running Node-RED to issue that command without a password prompt.

Almost certainly, you would be much better allowing the node-red user to access the rf95 software and hardware so that sudo wasn't required.

---

<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:** [9 February 2023 15:54 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/8 "2023-02-09T15:54:26Z")

</div>

If you run that command in a terminal, with sudo, does it ask for a password? If so then @TotallyInformation is correct. If it doesn't ask for a password then I guess you have set your pi up (or it was setup like that by default) to not need a pwd when using sudo, which is a security risk. However, if it doesn't ask for a pwd then that is probably not the problem here. In fact, since you see the server in the task list then that is probably not the problem.

Do you see anything in the node red log or in syslog when you start the server?

---

<div class="post-metadata">

**Author:** ![batigolle](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@batigolle](https://discourse.nodered.org/u/batigolle)\
**Post date:** [9 February 2023 16:48 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/9 "2023-02-09T16:48:00Z")

</div>

Thanks for the reply @TotallyInformation

The user Node-Red starts as is the classic pi  
I enabled user pi ,in the file /etc/sudoers,  
so that it doesn't ask for pwd by entering the line  
pi ALL=(ALL:ALL) NOPASSWD:ALL

The fact that the rf95\_server line appears in the tasks means that the command has executed it, if it asked for a pwd it would give an error.

If I try to run the command manually without SUDO in the terminal window, it doesn't ask for the pwd , but the error is thrown  
**paging fault**  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/5/a513a101b5b169ffdd784c513957fde2199f0268.png)

---

<div class="post-metadata">

**Author:** ![batigolle](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@batigolle](https://discourse.nodered.org/u/batigolle)\
**Post date:** [9 February 2023 16:58 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/10 "2023-02-09T16:58:28Z")

</div>

Hi @Colin  
The sudo command does not require a password

When I start the exec node in flow , in node-red log it appears

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/1/61e06a8f572f71c74b82090f7b5a2ae1f2282fa3.png)

---

<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:** [9 February 2023 17:02 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/11 "2023-02-09T17:02:28Z")

</div>

> [@batigolle](#):
>
> I enabled user pi ,in the file /etc/sudoers,  
> so that it doesn't ask for pwd by entering the line  
> pi ALL=(ALL:ALL) NOPASSWD:ALL

OK, but don't ever let your Pi loose on the Internet or bad things may happen (which they probably would anyway if you are using the `pi` user) 🙂

---

<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:** [9 February 2023 17:03 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/12 "2023-02-09T17:03:39Z")

</div>

I see you are using an extremely ancient version of node-red and a long out of support version of nodejs, so I suggest you start by upgrading to the current version of node-red and node.js v16. On a pi you can usually do that by using the script at [Running on Raspberry Pi : Node-RED](https://nodered.org/docs/getting-started/raspberrypi). However, if you are using an also long out of support version of Pi OS then that may be too old to allow an upgrade.

---

<div class="post-metadata">

**Author:** ![batigolle](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@batigolle](https://discourse.nodered.org/u/batigolle)\
**Post date:** [9 February 2023 17:09 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/13 "2023-02-09T17:09:45Z")

</div>

Thanks for the suggestion, but at the moment it is not reachable from the outside, it remains in my wifi network

---

<div class="post-metadata">

**Author:** ![batigolle](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@batigolle](https://discourse.nodered.org/u/batigolle)\
**Post date:** [9 February 2023 17:15 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/14 "2023-02-09T17:15:46Z")

</div>

You're right @Colin , Node-red is an old version 0.18.4, a bit dated.

This is the version of my Raspberry , do you think it will be supported for the latest version of Node-red ?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/a/4a8d17f82cf5a3caa47c5abc65ac5e93da57821b.png)

---

<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:** [9 February 2023 17:20 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/15 "2023-02-09T17:20:33Z")

</div>

I think stretch is ok still. I presume you have everything useful backed up anyway.  
In future if you could copy/paste text rather than screenshot it would be appreciated.

To tell the script to install nodejs 16 and `--node16` on the end.

---

<div class="post-metadata">

**Author:** ![batigolle](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@batigolle](https://discourse.nodered.org/u/batigolle)\
**Post date:** [13 February 2023 18:27 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/16 "2023-02-13T18:27:18Z")

</div>

Hello @Colin  
I updated Node-Red to version 3.0.2 and with node v16.19.0  
and I found the way to run the ./rf95\_server program, without using the SUDO command

After these commands, i can run the program, as root user, no matter who started it or from where (no sudo required)

```
1) sudo chown root rf95_server
2) sudo chmod +s rf95_server

```

Node exec config  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/f/5f421fdd2618a016b57df08e35853f70e916ca93.png)

after to start  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/2/623a6129ceb9f08a563b3c16aeb270178c7a9cef.png)

task manager  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/4/94d48460a79183ba69ec7fa90742a3f96cbf559e.png)

From the task manager , it is noted that in this case , unlike the previous ones , the task ./rf95\_server is unique , there are no SH or SUDO parent tasks

**Even after these updates**  
**the program runs, but I'm not getting any output from the MSG nodes**

_ **NOTE** _ : I have the C sources of the program, I can insert a few lines of code and recompile it, if you have any ideas to suggest me

---

<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:** [14 February 2023 20:59 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/17 "2023-02-14T20:59:51Z")

</div>

That is dissapointing.

Can you show us what the startup log looks like now please.  
Rather than screenshot please copy/paste the text. When pasting use the `</>` button at the top of the forum entry window to stop the output being interpretted as markdown.

In the C code, what do the lines that output the data look like?  
Does it have any command line options to say where to send the output?

---

<div class="post-metadata">

**Author:** ![batigolle](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@batigolle](https://discourse.nodered.org/u/batigolle)\
**Post date:** [14 February 2023 21:20 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/18 "2023-02-14T21:20:35Z")

</div>

Startup log Node-RED

```auto
pi@raspberrypi:~ $ node-red-log 
- /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
14 Feb 22:05:55 - [warn] [node-red-contrib-rfm69radio/rfm69-out] 'rfm69-radio' already registered by module node-red-contrib-rfm69radio
14 Feb 22:05:55 - [warn] [node-red-contrib-rfm69radio/rfm69-radio] 'rfm69-radio' already registered by module node-red-contrib-rfm69radio
14 Feb 22:05:55 - [warn] ------------------------------------------------------
14 Feb 22:05:55 - [info] Settings file : /home/pi/.node-red/settings.js
14 Feb 22:05:55 - [info] Context store : 'default' [module=memory]
14 Feb 22:05:55 - [info] User directory : /home/pi/.node-red
14 Feb 22:05:55 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
14 Feb 22:05:55 - [warn] Flows file name not set. Generating name using hostname.
14 Feb 22:05:55 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
14 Feb 22:05:55 - [info] Server now running at http://127.0.0.1:1880/
14 Feb 22:05:55 - [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.
---------------------------------------------------------------------
14 Feb 22:05:55 - [info] Starting flows
14 Feb 22:05:55 - [info] Started flows

```

When I run the exec node, no message appears in the log

Part of the C code that writes the outgoing message with printf command

```auto
         if (rf95.available()) { 
#ifdef RF_LED_PIN
          led_blink = millis();
          digitalWrite(RF_LED_PIN, HIGH);
#endif
          // Should be a message for us now
          uint8_t buf[RH_RF95_MAX_MESSAGE_LEN];
          uint8_t len = sizeof(buf);
          uint8_t from = rf95.headerFrom();
          uint8_t to = rf95.headerTo();
          uint8_t id = rf95.headerId();
          uint8_t flags= rf95.headerFlags();;
          int8_t rssi = rf95.lastRssi();
          
          if (rf95.recv(buf, &len)) {
            printf("Packet[%02d] #%d => #%d %ddB: ", len, from, to, rssi);
            printbuffer(buf, len);
          } else {
            Serial.print("receive failed");
          }
          printf("\n");
        }

```

---

<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:** [14 February 2023 21:23 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/19 "2023-02-14T21:23:55Z")

</div>

`printf` should go to stdout, so that doesn't provide any clues.

You haven't got the start of the log. Run  
`node-red-stop`  
`node-red-start`  
and it should give it you from the start.

---

<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:** [14 February 2023 21:27 UTC](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902/20 "2023-02-14T21:27:10Z")

</div>

> [@batigolle](#):
>
> `14 Feb 22:05:55 - [warn] [node-red-contrib-rfm69radio/rfm69-out] 'rfm69-radio' already registered by module node-red-contrib-rfm69radio`

That is not good. That suggests that you have two nodes installed for doing a similar thing.

If you don't think that is the case please post the file package.json

**[Edit]** Actually it looks like this is a fault in the node, see [9 Nodes, "already registered", disconnected · Issue #4 · AndyFlem/rfm69radio-node · GitHub](https://github.com/AndyFlem/rfm69radio-node/issues/4)  
The fact that it has multiple unaddressed issues over several years suggests that the node is not supported, so you may be out of luck getting it to work.

[Next page](https://discourse.nodered.org/t/problem-with-exec-node-output-in-spawn-mode/74902.md?page=2)
