node.js - nodejs python-shell error on raspberry pi -
i'm working on nodejs on raspberry pi, base on python's basic code suppose run working on pi:
import rpi.gpio gpio gpio.setmode(gpio.board) gpio.setup(7, gpio.out) gpio.output(7, true)
but when tried on python shell package run python script above. throws error:
error: process exited code 2 @ childprocess. (/home/pi/desktop/social_feed/node_modules/python-shell/index.js:82:23) @ childprocess.emit (events.js:110:17) @ process.childprocess._handle.onexit (child_process.js:1067:12)
the javascript run python-shell is:
var pythonshell = require('..'); pythonshell.run('anythingcodes.py', function (err) { if (err) throw err; console.log('finished'); });
does tested using python-shell run python script on raspberry pi's gpio ?
Comments
Post a Comment