jperkin / node-rpio

Raspberry Pi GPIO library for node.js
860 stars 126 forks source link

Questions to the expert ! #4

Closed jguillod closed 8 years ago

jguillod commented 9 years ago

Jonathan,

I've just started to find my way out for the last two week as a Rapsberry PI2 beginner. Since most tutorials and a Sunfounder kit are based on either C or Python, and as a NodeJS developer, I am searching for a nodejs module to control the GPIO. I superficially tried with success some of the many node modules I found but I'm still a bit lost to select a reliable, maintained, easy to use and fast one. I realise that speed can be important as I went to this Comparison 2013 of NodeJS GPIO access packages. Yours appears interesting as beeing writen in C and also has support for i²c, PWM, and SPI. Other NodeJS modules I quickly made a test with are : fivdi/onoff, brnt/node-rpio, nebrius/raspi (with raspi-gpio, raspi-io for Johnny-Five and raspi-board), gavinhungry/wpi-gpio and JamesBarwell/rpi-gpio.js.

MY QUESTIONS :

I hope not to worry you with such questions, so dont hesitate to drop them.

Thank you very much for any advices. With regards, Joel

jperkin commented 8 years ago

Thanks for the interest, and apologies it's taken so long to reply.

Is your module just safe and reliable to use with a Raspberry PI 2?

Yes, it is my primary development platform, and I also have a couple of older PI v1's which I test updates on too.

Will it be maintained on the long term? (writing C/C++ was at an ancient time for me…)

I will try to, though I guess the length of time it's taken for me to reply to this issue suggests not as often as I'd like. I tend to have a few spare evenings every few months where I can update the code and go through the open issues, but I plan to keep on doing that.

Can we expect not to have to launch node in sudo mode with rpio?

Unfortunately not, it's a hard requirement due to using the mmap() interface. If this is important to you then you'll just have to use one of the other modules which use the slower /sys interface.

Where would node-rpio compared in the Comparison 2013 of NodeJS GPIO access packages? Do you have advices for me to choose such a module? Or web link to a well made article? What about using raspi-gpio (with raspi-io for Johnny-Five): any experiences?

These are all quite similar so I'll answer them in one go. I haven't used any other modules. When I started writing this there was only one other module which used /sys, so I just went ahead and wrote my own. I'm not really best placed therefore to compare them, but to the best of my knowledge mine is the only one which uses the bcm2835 library, so I guess the others only differ in the API they present rather than anything fundamental.

Hope that's helpful, and apologies again for how long it's taken to reply.