dph
Posts: 5
Joined: Fri Jun 08, 2012 6:26 pm

Nodejs GPIO

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.

sironitomas
Posts: 6
Joined: Mon Apr 23, 2012 12:59 pm

Re: Nodejs GPIO

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!

ferik
Posts: 15
Joined: Thu May 31, 2012 2:32 am

Re: Nodejs GPIO

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.

sironitomas
Posts: 6
Joined: Mon Apr 23, 2012 12:59 pm

Re: Nodejs GPIO

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!

ferik
Posts: 15
Joined: Thu May 31, 2012 2:32 am

Re: Nodejs GPIO

Thu Jun 14, 2012 12:55 pm

I am on debian, will work on compiling it, hitting brick walls for now.

legrang
Posts: 1
Joined: Sat Jun 16, 2012 5:30 pm

Re: Nodejs GPIO

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/n ... spberry-pi

dph
Posts: 5
Joined: Fri Jun 08, 2012 6:26 pm

Re: Nodejs GPIO

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.

User avatar
vicary
Posts: 15
Joined: Tue Jul 17, 2012 4:37 am
Location: Hong Kong

Re: Nodejs GPIO

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-/

Return to “Other languages”

Who is online

Users browsing this forum: No registered users and 6 guests