Page 1 of 1

Nodejs GPIO

Posted: Sat Jun 09, 2012 3:02 pm
by dph
Hope this is useful for others out there, I wrote a node package that lets you interact with the GPIO https://github.com/EnotionZ/GpiO (there's also a little video in the README)

It does use the filesystem API, especially the watchFile function so there's no crazy js closures just to access values.

Re: Nodejs GPIO

Posted: Wed Jun 13, 2012 2:35 am
by sironitomas
This is awesome. Kind of remind me to this project for Arduino. When I have some spare time I will play with it.

Thanks for the good effort and waiting for news!

Re: Nodejs GPIO

Posted: Thu Jun 14, 2012 3:10 am
by ferik
How did you compile node.js on the Rpi? I have followed a few blog posts but no dice.

Re: Nodejs GPIO

Posted: Thu Jun 14, 2012 4:18 am
by sironitomas
ferik wrote:How did you compile node.js on the Rpi? I have followed a few blog posts but no dice.
In Arch Linux you just:

Code: Select all

pacman -S nodejs
Regards!

Re: Nodejs GPIO

Posted: Thu Jun 14, 2012 12:55 pm
by ferik
I am on debian, will work on compiling it, hitting brick walls for now.

Re: Nodejs GPIO

Posted: Sat Jun 16, 2012 5:31 pm
by legrang
ferik wrote:I am on debian, will work on compiling it, hitting brick walls for now.
Follow these instructions: http://elsmorian.com/post/23474168753/n ... spberry-pi

Re: Nodejs GPIO

Posted: Sun Jun 17, 2012 3:04 am
by dph
The Raspberry Pi's CPU is based on ARMv6, so you just need to compile it with the right flags. I followed the same link legrang posted and was able to compile without a problem.

A few notes:
1) it took close to an hour to install node, so you shouldn't sit around and wait for it.
2) there's a mistype in that blog post. The current stable release is v0.6.19, but the branch name has a "-release" appended to it. So to check out the v0.6.19 branch, you want to do "git checkout v0.6.19-release"
3) you still need sudo power to read and write to the gpio, my library doesn't solve that for you. Either "sudo su" or set group permission, place current user (pi) in that group, and give that group read/write access to the gpio directory.

Re: Nodejs GPIO

Posted: Tue Jul 31, 2012 8:29 am
by vicary
After reading this post, I started reading GPIO things all over.

Maybe we are all wasting a lot of I/O power in the chips?
http://www.instructables.com/id/Prelimi ... g-with-a-/