i created a I2C node

1,182 views
Skip to first unread message

Niels vd spek

unread,
Nov 16, 2015, 3:18:27 AM11/16/15
to Node-RED
hi all,

For the rpi2b and posible older versions i created a nice set of I2C nodes. when there is any interest i love to put them on npm or so?

greating
Niels

Dave C-J

unread,
Nov 16, 2015, 5:01:17 AM11/16/15
to node...@googlegroups.com

Yes please. Very useful.
If you can follow the packaging/naming guidelines then we will automatically add them to the flows.nodered.org site.
Thanks

Niels vd spek

unread,
Nov 16, 2015, 6:20:49 AM11/16/15
to Node-RED
No Problem, To be sure can you give the right location of those package/naming guidlines?

Op maandag 16 november 2015 11:01:17 UTC+1 schreef Dave C-J:

Nicholas O'Leary

unread,
Nov 16, 2015, 6:27:33 AM11/16/15
to Node-RED Mailing LIst

--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Niels vd spek

unread,
Nov 16, 2015, 7:29:00 AM11/16/15
to Node-RED
Perfect.

I have now put it on github: https://github.com/nielsnl68/node-contrib-i2c
Before i put it on npm i like some feedback about the code first.

thanks for your nice work.

Op maandag 16 november 2015 12:27:33 UTC+1 schreef Nick O'Leary:

Armin Blum

unread,
Nov 17, 2015, 10:34:11 AM11/17/15
to Node-RED
Dear Niels

I made some tests with your draft nodes regarding i2c interface. There is still a lack of explanation how to use them (ie. input, output and conifguration values). A sample flow would be very helpful.  At least after some trials I found a syntax error in file 26-i2c.js at line 92. parseint is not spelled correctly probably it should be parseInt. If i change it, node-red crashes with:    

17 Nov 16:06:33 - [red] Uncaught Exception:
17 Nov 16:06:35 - TypeError: number is not a function
  at Immediate._onImmediate (/home/pi/.node-red/node_modules/i2c/lib/i2c.coffee:60:9)
  at processImmediate [as _immediateCallback] (timers.js:367:17)

I hope you can fix it. I think the nodes would be very useful to me an others once in a stable version.

Regards, Armin Blum

Niels vd spek

unread,
Nov 17, 2015, 5:44:32 PM11/17/15
to Node-RED
Hello Armin

Thank you for taking the time to test my interface, hope it will be as good for you as it is now for me.
You where right It should have been parseInt(). I committed a new the fix.
About the documentation, I find it hard to know what to write down per function/node. It helps me a lot when you like to ask the thinks what you are missing exactly, then will extend the descriptions according to that. 

Best Wishes
Niels

Op dinsdag 17 november 2015 16:34:11 UTC+1 schreef Armin Blum:

Luis Montes

unread,
Nov 17, 2015, 7:26:37 PM11/17/15
to node...@googlegroups.com
If it helps, I wrote some generic gpio nodes, and here's an example of reading i2c accelermoter data on a pi:  http://flows.nodered.org/flow/f8c7a94454f79d3cfdc5

Might be helpful to have an example flow for  yours.

Niels vd spek

unread,
Nov 19, 2015, 3:37:56 AM11/19/15
to Node-RED
Thanks Luis,

That is a nice idea to use, sadly i dont have the nodes used to show it correctly
would you mind telling which settings where used in the two nodes that communicate with the I2C bus?

thanks anyway
Niels

Op woensdag 18 november 2015 01:26:37 UTC+1 schreef Luis Montes:

Luis Montes

unread,
Nov 20, 2015, 4:59:55 PM11/20/15
to node...@googlegroups.com
take a look at my node-red-contrib-gpio nodes:  http://flows.nodered.org/node/node-red-contrib-gpio

Niels vd spek

unread,
Jun 26, 2016, 5:01:46 PM6/26/16
to Node-RED
hi All,

Just tried to install my i2c node again but now i get the following error:

26 Jun 22:44:55 - [info] Loading palette nodes
26 Jun 22:45:07 - [warn] ------------------------------------------------------
26 Jun 22:45:07 - [warn] [i2c] Error: Cannot find module '../build/Release/i2c'
26 Jun 22:45:07 - [warn] ------------------------------------------------------

The i2c main module is installed in "/usr/lib/node_modules/" and my own node-red-node is at: "/usr/lib/node_modules/node-red/node_modules/"
It worked before with the old configuration so i'm sure all works fine.


Reply all
Reply to author
Forward
0 new messages