pi-gpio icon indicating copy to clipboard operation
pi-gpio copied to clipboard

Looking forward to I2C and SPI for node.js of Rpi

Open paultanner opened this issue 12 years ago • 10 comments

Thx for GPIO Happy to do some work on I2C and SPI if you have a starting point. Paul

paultanner avatar Sep 26 '12 10:09 paultanner

Hey @paultanner. I don't have a starting point yet, but I'm considering several options:

  • Bit-banging the protocol. Not too excited about this approach.
  • Moving to wiring-pi, which seems to have done a bulk of the work already. There are already wrappers in other languages. We could just learn from the other implementations and adapt that for node. This is what seems most appealing to me.
  • It appears that Wheezy now comes with I2C and SPI drivers. Not sure if wiring-pi wraps over them. If wiring-pi does that already, I'd rather wrap around wiring-pi. If not, we could wrap around the drivers directly.
  • Any other suggestions you might have?

rakeshpai avatar Sep 26 '12 10:09 rakeshpai

Thx for the quick reply Rakesh, I'm using the Black Raspberry Pi distro which has kernel support. Interface code in C++ is available (derived from Gertboard code). I got a copy from skpang.co.uk Could this C++ code be wrapped for node? (Not something I've done.) Paul At 11:57 AM 9/26/2012, you wrote:

Hey https://github.com/paultanner@paultanner. I don't have a starting point yet, but I'm considering several options:

  • Bit-banging the protocol. Not too excited about this approach.
  • Moving to https://projects.drogon.net/raspberry-pi/wiringpi/wiring-pi, which seems to have done a bulk of the work already. There are already wrappers in other languages. We could just learn from the other implementations and adapt that for node. This is what seems most appealing to me.
  • It appears that Wheezy now comes with I2C and SPI drivers. Not sure if wiring-pi wraps over them. If wiring-pi does that already, I'd rather wrap around wiring-pi. If not, we could wrap around the drivers directly.
  • Any other suggestions you might have?

­ Reply to this email directly or https://github.com/rakeshpai/pi-gpio/issues/1#issuecomment-8886094view it on GitHub.

Paul Tanner - Virtual Technologies - http://www.virtual-techno.com Tel: +44 1494 581979 Mob: +44 7973 223239 mailto:[email protected]

paultanner avatar Sep 26 '12 11:09 paultanner

Unfortunately, it isn't something I've done either. I'll spend some time to learn about this soon-ish though.

rakeshpai avatar Sep 26 '12 16:09 rakeshpai

Hey @rakeshpai, I'm also pretty interested in creating/adapting a node.js module, using the WiringPi library, mainly because of the interruptions support... are you working on it?

gfcittolin avatar Dec 18 '12 15:12 gfcittolin

Any update on this?

kristjanjansen avatar Jan 21 '13 15:01 kristjanjansen

Any update on this?

kristjanjansen avatar Feb 13 '13 16:02 kristjanjansen

This is the problem: I've unfortunately got tied up some things, and it will be some time before I get back to hardware hacking again. It might take a month or two. Until then, you'll either have to wait, or I'll gladly accept pull requests.

rakeshpai avatar Feb 14 '13 17:02 rakeshpai

i2c on node.js is done, seems to work on the Pi: https://npmjs.org/package/i2c

As for SPI, let's take a look at that too.

mrutgerj avatar Oct 06 '13 02:10 mrutgerj

If this project isn't dead...

There are now three NodeJS implementations of SPI:

  1. RussTheAerialist/node-spi 38 Stars, 11 Forks*
  2. natevw/pi-spi 4 Stars, 2 Forks*
  3. fjw/node-simplespi 1 Star, 1 Fork* (probably just the author) *Data is from the time of this post.

I haven't been able to test any of them myself yet, but RussTheAerialist/node-spi looks promising. Considering that this has been down at least three times now (and I2C is also complete), this issue should be closed unless a fourth version will be made. Or, these could be dependencies of this library, but that would be clunky and indirect. It would also make issues for that library probably show up here.

DaAwesomeP avatar Feb 23 '14 04:02 DaAwesomeP

@DaAwesomeP I will look into that when I get a chance but it might be a few weeks before I have the time.

darkwisperer avatar Feb 26 '14 21:02 darkwisperer