I want to use node.js to parse data from a java script application back to the node.js server, I have accomplished this in a very rudimentary form and now I want to have the data turn on or off the GPIO pins on the Pi B+. I attempted doing that with this module: https://www.npmjs.com/package/pi-gpio a problem I ran into is that apparently it's file path is outdated and there isn't really any easy way around it. I was wondering if anyone knew of an ulterior way of interfacing with the GPIO pins in Node.js.
-
If all else fails you could use syscalls to the Python gpio package. It wouldn't be fast but it would always workbenathon– benathon2015年04月11日 10:45:50 +00:00Commented Apr 11, 2015 at 10:45
2 Answers 2
I suggest using this module to switch and read GPIO pins, it is easy to handle and works very well: https://www.npmjs.com/package/onoff
Another module: https://www.npmjs.com/package/rpio
-
I find this module rather slow compared to the Python plugin and it is hard to configure pull-up / -down resistors that one looks good: npmjs.com/package/rpioThor_Bux– Thor_Bux2018年02月06日 06:59:06 +00:00Commented Feb 6, 2018 at 6:59
-
i did not know that one, will include it, thanx!andyrandy– andyrandy2018年02月06日 08:13:25 +00:00Commented Feb 6, 2018 at 8:13
Use this module: https://www.npmjs.com/package/node-cmd
And use the gpio shell commands.
Run gpio -h on raspberry pi terminal to find syntax.