i want to run a python script via nodejs with python-shell to simply turn a led via my raspberry pi on. The script works pretty well, but i cant run it via the nodejs
my NodeJS:
var PythonShell = require('python-shell');
PythonShell.run('ledtest.py', function (err) {
if (err) throw err;
console.log('finished');
});
my PythonScript:
import serial
import time
s = serial.Serial('/dev/ttyACM0', 9600)
s.close()
s.open()
time.sleep(5)
s.write("1")
time.sleep(2)
s.write("0")
error
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn python ENOENT
at exports._errnoException (util.js:953:11)
at Process.ChildProcess._handle.onexit
(internal/child_process.js:182:32)
at onErrorNT (internal/child_process.js:348:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Function.Module.runMain (module.js:577:11)
at startup (node.js:160:18)
at node.js:449:3
thanks for suggestions
/dev/ttyUSB0.