Read serial port data with node-red on Raspberry Pi

1,719 views
Skip to first unread message

Dan Hoover

unread,
Mar 12, 2017, 9:13:35 PM3/12/17
to Node-RED
I have a raspberry pi running node 7.5.0 and npm 4.2.0 and I can't get any packages installed to read serial port data.  Can anyone point me in the right direction?

The serial 4.0.7 keeps failing. 

Dave C-J

unread,
Mar 13, 2017, 2:29:51 AM3/13/17
to node...@googlegroups.com
We support node 6.x

sent from phone

Nick O'Leary

unread,
Mar 13, 2017, 3:13:05 AM3/13/17
to node...@googlegroups.com

Dan,

Can you share the error you are getting? As Dave says, we recommend the stable Node.js 6.x, but it would be good to know about issues with 7.x so we can address them before 8.x is released in the next month and then becomes the next stable release in October.

Nick


On Mon, 13 Mar 2017, 06:29 Dave C-J, <dce...@gmail.com> wrote:
We support node 6.x

sent from phone

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
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.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/CACXWFw%2BUZLb8rFGh1g96R1DshrFxNg0t8FXegd34o7aP_EwkGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Dave C-J

unread,
Mar 13, 2017, 5:00:40 AM3/13/17
to node...@googlegroups.com
Hi,

just had a quick play on a Pi2 with node 7 - Serial port installed OK - Lots of warnings, but working.  By default our install script for Pi installs node v6.x and also includes the serialport so should work out of the box. 

But if you upgrade to 7 then you will need to flush the npm cache and rebuild the serial binaries. Normally when we install them they are in /usr/lib/node-red-node-serialport...    To over install then you can just
    sudo npm i -g --unsafe-perm node-red-node-serialport

Dan Hoover

unread,
Mar 13, 2017, 9:24:40 AM3/13/17
to Node-RED
Thank you! Clearing the npm cache did it!

I probably should have given some more context. The way I understand it, if I plug an arduino into the usb port of the pi, it will read the data as serial port data.  I guess I'm about to find out.  Thanks so much for your time.

Dave C-J

unread,
Mar 13, 2017, 10:49:04 AM3/13/17
to node...@googlegroups.com
Dan, indeed that is the easiest way to do it.

Dan Hoover

unread,
Mar 13, 2017, 11:36:36 AM3/13/17
to Node-RED
I should post back and add that it reads the data beautifully. I never really "got" why someone would choose arduino over pi at first, but now that I'm using the two together, I love the best of both worlds approach. Thanks for your help. This is great stuff.

Julian Knight

unread,
Mar 15, 2017, 6:52:35 PM3/15/17
to Node-RED
Yes, using an Arduino for the realtime/physical part of things certainly seems a lot easier than trying to wrestle the GPIO ports of the Pi.
Reply all
Reply to author
Forward
0 new messages