I have a script to bring a current time on LCD in Raspberry PI.
LCD is connected with Raspberry PI tested working fine.
I created a script name index.js inside ~/.node-red folder, and have installed LCD node module inside the same ~/.node-red folder using mand : npm install lcd --save
cd ~/.node-red
pi@raspberrypi ~/.node-red $ sudo node index.js
When I tested inside using the mand it brings the time on the LCD.
How to execute this index.js script in node-red node exec?
I have tried but does not work.
node-red connection picture
node exec config picture
In inject node I entered string 1 as payload
In exec node I entered mand: sudo /home/pi/.node-red/node index.js
I tried in many ways to execute but no luck,
please check the pictures and help me in this issue.
Thanks a lot in advance
I have a script to bring a current time on LCD in Raspberry PI.
LCD is connected with Raspberry PI tested working fine.
I created a script name index.js inside ~/.node-red folder, and have installed LCD node module inside the same ~/.node-red folder using mand : npm install lcd --save
cd ~/.node-red
pi@raspberrypi ~/.node-red $ sudo node index.js
When I tested inside using the mand it brings the time on the LCD.
How to execute this index.js script in node-red node exec?
I have tried but does not work.
node-red connection picture
node exec config picture
In inject node I entered string 1 as payload
In exec node I entered mand: sudo /home/pi/.node-red/node index.js
I tried in many ways to execute but no luck,
please check the pictures and help me in this issue.
Thanks a lot in advance
Share Improve this question edited Oct 19, 2015 at 20:32 Alex da Silva 4,5902 gold badges18 silver badges26 bronze badges asked Oct 19, 2015 at 20:00 rwahidrwahid 1112 gold badges2 silver badges11 bronze badges1 Answer
Reset to default 3In the exec config node
- Change the mand to just
/usr/bin/sudo
- Uncheck the append message.payload box
- Place the following in the extra input parameters:
node /home/pi/.node-red/index.js
You don't need to put your index.js in the .node-red directory but since it's there this should work.