Nodejs GPIO


8 posts
by dph » Sat Jun 09, 2012 3:02 pm
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.
Posts: 5
Joined: Fri Jun 08, 2012 6:26 pm
by sironitomas » Wed Jun 13, 2012 2:35 am
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!
Posts: 6
Joined: Mon Apr 23, 2012 12:59 pm
by ferik » Thu Jun 14, 2012 3:10 am
How did you compile node.js on the Rpi? I have followed a few blog posts but no dice.
Posts: 15
Joined: Thu May 31, 2012 2:32 am
by sironitomas » Thu Jun 14, 2012 4:18 am
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!
Posts: 6
Joined: Mon Apr 23, 2012 12:59 pm
by ferik » Thu Jun 14, 2012 12:55 pm
I am on debian, will work on compiling it, hitting brick walls for now.
Posts: 15
Joined: Thu May 31, 2012 2:32 am
by legrang » Sat Jun 16, 2012 5:31 pm
ferik wrote:I am on debian, will work on compiling it, hitting brick walls for now.


Follow these instructions: http://elsmorian.com/post/23474168753/node-js-on-raspberry-pi
Posts: 1
Joined: Sat Jun 16, 2012 5:30 pm
by dph » Sun Jun 17, 2012 3:04 am
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.
Posts: 5
Joined: Fri Jun 08, 2012 6:26 pm
by vicary » Tue Jul 31, 2012 8:29 am
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-/
User avatar
Posts: 15
Joined: Tue Jul 17, 2012 4:37 am
Location: Hong Kong