Hi @picklerick.
This is not really a feature of the C program, it justs prints it's output to the "standard output" device. the > .node-red/node_modules/node-red-dashboard/dist/js
is using the Bash shell to redirect the output into a file.
This is a good thing for you, the program output will magically appear in msg.payload after the exec node.
It is possible that the program is designed to accept the option 1-5 from the command line, eg
sunsaver 5.
If not, the simplest solution (unless someone else knows how to do a "Here Document" from exec) is to write a script "callsunsaver" to call the program, something like this
#! /bin/bash
/full/path/to/sunsaver <<EOF
$1
EOF
Make callsunsaver executable chmod +x callsunsaver
Now your exec node would be something like this
[
{
"id": "3f1453d2073c0cbe",
"type": "inject",
"z": "03f8230b250f8d2a",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "2",
"payloadType": "str",
"x": 290,
"y": 140,
"wires": [
[
"772114dbc4e4519d"
]
]
},
{
"id": "772114dbc4e4519d",
"type": "exec",
"z": "03f8230b250f8d2a",
"command": "/home/pi/bin/callsunsaver",
"addpay": "payload",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 510,
"y": 160,
"wires": [
[
"98678fcdfeebb11d"
],
[],
[]
]
},
{
"id": "98678fcdfeebb11d",
"type": "debug",
"z": "03f8230b250f8d2a",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 750,
"y": 160,
"wires": []
},
{
"id": "efdb7dfcb07f689a",
"type": "inject",
"z": "03f8230b250f8d2a",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "5",
"payloadType": "str",
"x": 290,
"y": 180,
"wires": [
[
"772114dbc4e4519d"
]
]
}
]
As @Colin hints, if sunsaver waits for more input it's going to be a problem.