RaspberryPi cant define serial port

818 views
Skip to first unread message

Will Cook-Martin

unread,
May 2, 2014, 8:03:42 AM5/2/14
to node...@googlegroups.com
Hi I've installed node red using these instructions http://c-mobberley.com/wordpress/2013/10/03/raspberry-pi-hosting-node-red-take-the-crap-out-of-developing-automation-the-internet-of-things-iot/ but i cant define the serial port as suggested here http://blog.thiseldo.co.uk/?p=944 to communicate with my serial port and slice of radio that is installed. ive checked and ttyAMA0 is installed under the /dev folder so the serial device should be listed when I click the pencil icon but it's not?

Any ideas?

Ben Ward

unread,
May 2, 2014, 8:29:51 AM5/2/14
to node...@googlegroups.com
Hi Will,

If you click the dropdown list there should be an "Add New Serial Port..." option. 
Then you'll be able to set /dev/ttyAMA0 at 115200

For LLAP disable "Don't add new line to serial output" because otherwise each character will get a newline. Instead to collect the bytes of a message make a function node using the code in this: http://blog.thiseldo.co.uk/?p=944

Ben



On 2 May 2014 13:03, Will Cook-Martin <willcoo...@googlemail.com> wrote:
Hi I've installed node red using these instructions http://c-mobberley.com/wordpress/2013/10/03/raspberry-pi-hosting-node-red-take-the-crap-out-of-developing-automation-the-internet-of-things-iot/ but i cant define the serial port as suggested here http://blog.thiseldo.co.uk/?p=944 to communicate with my serial port and slice of radio that is installed. ive checked and ttyAMA0 is installed under the /dev folder so the serial device should be listed when I click the pencil icon but it's not?

Any ideas?

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



--
Love Hz | b...@love-hz.com | http://love-hz.com | @welovehz | 07771 537574

Will Cook-Martin

unread,
May 3, 2014, 3:58:33 PM5/3/14
to node...@googlegroups.com, b...@love-hz.com
Hi Ben,

I couldn't get it to work at all, I was pulling my hair out, I'm sure I was doing something obviously wrong but it was still frustrating! Thankfully thethingbox.io was the answer for me

Ta!

Andrew Lindsay

unread,
May 4, 2014, 5:16:08 PM5/4/14
to node...@googlegroups.com, b...@love-hz.com
OK, I though this was simple. I've got a Ciseco Slice of radio, so basically a serial input to the Pi. I see a serial port /dev/ttyAMA0 using ls but not in the dropdown when trying to add it in the serial in node. I've got this working fine on another regular Linux server but trying to setup a Pi for some new hardware tests.

How does Node-Red determine which serial ports to use. Is there some config somewhere on the Pi or in Node-Red for this?

thanks

Andrew

Mark Setrem

unread,
May 4, 2014, 5:36:49 PM5/4/14
to node...@googlegroups.com
By default the serial port is configured for
Console input/output.

Have you tried freeing up the serial port?
Instructions for doing so can be found here....

http://www.hobbytronics.co.uk/raspberry-pi-serial-port

Nicholas O'Leary

unread,
May 4, 2014, 6:23:19 PM5/4/14
to node...@googlegroups.com
Andrew (and everyone...)

the recent update to the serial-node made the port definition a select box rather than text input box. The select box is populated by the list of serial ports the node-serialport module reports back to us as being available. In theory, easier for users, but also disastrous if for some reason a valid serial port isn't being reported to us by the node-serialport module.

I'm on the fence over this particular change - I do wonder if it should allow the user to enter their own thing as an alternative to selecting from the list. Thoughts and suggestions welcome.

Nick








Luis Montes

unread,
May 4, 2014, 6:32:28 PM5/4/14
to node...@googlegroups.com
I'd say leave it as a texfield, but put a search button next to the textfield that overlays another modal with values in a list that can be chosen from.

I have a serial/arduino node implementation that does that just this and it feels intuitive enough.  Searching is typically async for similar type queries to fill in values in the box, so you have to take some considerations on what to render and how to resize the secondary modal.



Andrew Lindsay

unread,
May 5, 2014, 2:16:28 AM5/5/14
to node...@googlegroups.com
Could it be an issue with the node-serialport not identifying ports properly? Permissions? Port name formats? Symbolic links?
I'm using /dev/ttyAMA0 which works with minicom fine without using sudo.

Cheers

Andrew

Andrew Lindsay

unread,
May 5, 2014, 2:42:41 AM5/5/14
to node...@googlegroups.com
I checked these also and found I'd done the changes to disable serial logins already.

Cheers

Andrew

Andrew Lindsay

unread,
May 5, 2014, 3:03:18 AM5/5/14
to node...@googlegroups.com
Further to this. I tried the simple list example from the node-serialport github readme, it listed no ports. When I plugged in a USB serial device it then found it.
At this point Node-Red was then able to show it in the Serial node select list and use it.

Poking around a bit more....

Cheers

Andrew

Dave C-J

unread,
May 5, 2014, 3:12:01 AM5/5/14
to node...@googlegroups.com

Very annoying ... I'll put it back to a text box in a sec, so it can work for anything, and then rework from there.

Andrew Lindsay

unread,
May 5, 2014, 3:27:51 AM5/5/14
to node...@googlegroups.com
Thanks Dave.
The select option is a nice feature, if it detected the ports. I think its some underlying issue in the node-serialport library and not Node-Red. May even raise an issue on the library github repository so they can look into it.

Cheers

Andrew

Dave C-J

unread,
May 5, 2014, 4:04:35 AM5/5/14
to node...@googlegroups.com

Looking at the serialport npm it looks for devices in /dev/serial/by-id .  For some reason the Pi does not register ttyAMA0 there - so I suspect it's more complicated than "just" the serialport npm.
In the meantime I have pushed a "fix" that reverts the input to a vanilla text box so you can type in anything - while we look at best way to visualise properly.

Andrew Lindsay

unread,
May 5, 2014, 4:33:33 AM5/5/14
to node...@googlegroups.com
Hi Dave,

I've found that bit in the code too, so looking deeper, for some reason the device isnt being setup with a /dev/serial/by-id entry. This is empty until I plug in a usb serial device then I see a file. After removal the file is removed. So USB devices work fine, just the serial device. So frustrating.

Cheers

Andrew
Message has been deleted
Message has been deleted

Dave C-J

unread,
May 5, 2014, 7:35:58 AM5/5/14
to node...@googlegroups.com
Meanwhile I have changed the UI more along lines of Luis suggestion... so you can either manually enter the value you want... - or you can select the list button and get a list to choose from... not withstanding the fact that the list may indeed be wrong...

thoughts ?

Andrew Lindsay

unread,
May 5, 2014, 12:37:43 PM5/5/14
to node...@googlegroups.com
Got this new change, it seems to work in selecting a port. However, I'm not seeing any data being received on the serial port in Node-Red. I swapped to a USB serial device and its not receiving data either.

Going back to basics using minicom on port /dev/ttyAMA0 then ftdi cable to laptop I am able to see data transferred between the two. Going back to Node-Red with the simplest of flows being a single Serial In node and a debug output node I should see received characters. I've tried a simple node.js serial and that receives characters.

Am I missing something here?

Cheers

Andrew

Dave C-J

unread,
May 5, 2014, 1:21:09 PM5/5/14
to node...@googlegroups.com
very strange - If I plug in a USB gps to my Pi I get

Inline images 1
you are sending line ends \n  for it to split on aren't you ? (not the enter key)


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



--
regards

Dave Conway-Jones

Andrew Lindsay

unread,
May 5, 2014, 1:46:55 PM5/5/14
to node...@googlegroups.com
Hi Dave,

Got it working here, miss read the bit about 'dont add new line to output', assumed it was for input and output. Cleared the new line value. 

Cheers

Andrew

Dave C-J

unread,
May 6, 2014, 6:07:27 AM5/6/14
to node...@googlegroups.com
This isn't over yet... :-)

while testing a bit deeper - we found that the underlying serialport npm also doesn't differentiate between two identical USB serial port adaptors plugged into the same host adapter. - Have raised an issue on it... so maybe that will get fixed also...

In meantime a bodge to make ama0 appear in the list for Pi is to manually add it at startup via /etc/rc.local
edit /etc/rc.local to include

mkdir -p /dev/serial/by-id
ln -s /dev/ttyAMA0 /dev/serial/by-id/pi-serial

Reason for mention the npm is that of course if they fix it by moving to by-path rather than by-id then the bodge above will need to change also :-)

Chris Jefferies

unread,
May 7, 2014, 10:15:23 PM5/7/14
to node...@googlegroups.com
another bit of info...  I came across this issue a few days ago with blank serial port list and no way to enter into text box.

I'm using Beaglebone black with UART2 and it is referenced as /dev/ttyO2  (that's an upper case o, not a zero)

UART2 - /dev/ttyO2
P9-21 - TX
P9-22 - RX

Dave C-J

unread,
May 8, 2014, 2:19:29 PM5/8/14
to node...@googlegroups.com
You should now (with latest) - be able to enter whatever you like in the box...
but thanks - will look to see what gives on BB also...
I guess part of the problem is that on both Pi and BB those serial ports are not dedicated and can be used for general IO as well. Also technically I guess they are not true serial ports per se as they are just the low voltage pins so marking them in /dev/serial may be a bad thing... - though that is what the serialport npm relies on.


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



--
regards

Dave Conway-Jones

Stephen Haesung Lee

unread,
Dec 24, 2016, 6:56:33 AM12/24/16
to Node-RED
Dear Dave-CJ or Everyone

I'm struggling the serial node to open the serial port on Node-RED. Please help me my problem to figure out.

The error message said that
"
serial port /dev/ttyAMA0 error: Error: Error: Permission denied, cannot open /dev/ttyAMA0

"
 



2014년 5월 9일 금요일 오전 4시 19분 29초 UTC+10, Dave C-J 님의 말:

Dave C-J

unread,
Dec 24, 2016, 7:57:02 AM12/24/16
to node...@googlegroups.com
Slightly old - but did you just google it ?

which user are you using ?
is it a member of the dialout group ?
have you turned off getty on that port ?

Julian Knight

unread,
Dec 24, 2016, 11:30:19 AM12/24/16
to Node-RED
You need to make sure that the user running NR is in the appropriate group allowing access to open the serial port.

I always forget which group it is - "dialout" I think?

Stephen Haesung Lee

unread,
Dec 24, 2016, 8:17:18 PM12/24/16
to node...@googlegroups.com
Dear Dave CJ & Julian Knight 

Thank you so much! Merry Christmas!!

Yes I did all methods to open the serial node on NodeRED.
I'm still struggling with the serial node to open.  I'v enclosed my pictures. I put the GPS sensor at my robot.

. Also, I used the GPS sensor well. 





--


http://nodered.org


 


Join us on Slack to continue the conversation: http://nodered.org/slack


---


You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.


To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/eW7R-7IsWR0/unsubscribe.


To unsubscribe from this group and all its topics, 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%2Bw2_J2PK6b_TZGLWakNtJVxLZhzW%2BsVhg59pDyXkiTCQ%40mail.gmail.com.

Stephen Haesung Lee

unread,
Dec 24, 2016, 8:34:25 PM12/24/16
to node...@googlegroups.com

Stephen Haesung Lee

unread,
Dec 25, 2016, 2:13:12 AM12/25/16
to Node-RED
Dear Dave C-J

I carefully followed the directions but this serial didn't open.
I'm connecting with GPS sensor but still same errorr.
Please help me figure out my problems.


12/25/2016, 6:07:39 PMmsg : string [89]serial port /dev/ttyAMA0 error: Error: Error: Permission denied, cannot open /dev/ttyAMA0









2016년 12월 24일 토요일 오후 11시 57분 2초 UTC+11, Dave C-J 님의 말:

Stephen Haesung Lee

unread,
Dec 25, 2016, 2:27:47 AM12/25/16
to Node-RED
pi@raspberrypi:~ $ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://169.254.170.40:1880
On Pi Node-RED works better with the Firefox browser

Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Started Node-RED graphical event wiring tool..
25 Dec 07:26:59 - [info] Stopping flows
25 Dec 07:26:59 - [info] serial port /dev/ttyAMA0 closed
25 Dec 07:26:59 - [info] [mqtt-broker:867260d8.6e4528] Disconnected from broker: mqtt://iot.eclipse.org:1883
25 Dec 07:26:59 - [info] [mqtt-broker:a7b0c5ab.0614f] Disconnected from broker: mqtt://iot.eclipse.org:1883
pam_unix(sudo:session): session closed for user root
pam_unix(sudo:session): session closed for user root
pam_unix(sudo:session): session closed for user root
pam_unix(sudo:session): session closed for user root
pam_unix(sudo:session): session closed for user root
25 Dec 07:27:00 - [info] [mqtt-broker:9fbaab4c.84b59] Disconnected from broker: mqtt://iot.eclipse.org:1883
25 Dec 07:27:00 - [info] Stopped flows
25 Dec 07:27:00 - [info] Starting flows
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/python -u /usr/lib/node_modules/node-red/nodes/core/hardware/nrgpio.py pwm 29
pam_unix(sudo:session): session opened for user root by (uid=0)
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/python -u /usr/lib/node_modules/node-red/nodes/core/hardware/nrgpio.py pwm 31
pam_unix(sudo:session): session opened for user root by (uid=0)
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/python -u /usr/lib/node_modules/node-red/nodes/core/hardware/nrgpio.py pwm 16
pam_unix(sudo:session): session opened for user root by (uid=0)
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/python -u /usr/lib/node_modules/node-red/nodes/core/hardware/nrgpio.py pwm 18
pam_unix(sudo:session): session opened for user root by (uid=0)
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/python -u /usr/lib/node_modules/node-red/nodes/core/hardware/nrgpio.py pwm 7
pam_unix(sudo:session): session opened for user root by (uid=0)
25 Dec 07:27:01 - [info] Started flows
25 Dec 07:27:01 - [error] serial port /dev/ttyAMA0 error: Error: Error: Permission denied, cannot open /dev/ttyAMA0
25 Dec 07:27:02 - [info] [mqtt-broker:a7b0c5ab.0614f] Connected to broker: mqtt://iot.eclipse.org:1883
25 Dec 07:27:02 - [info] [mqtt-broker:9fbaab4c.84b59] Connected to broker: mqtt://iot.eclipse.org:1883
25 Dec 07:27:02 - [info] [mqtt-broker:867260d8.6e4528] Connected to broker: mqtt://iot.eclipse.org:1883




2016년 12월 25일 일요일 오후 6시 13분 12초 UTC+11, Stephen Haesung Lee 님의 말:

Stephen Haesung Lee

unread,
Dec 25, 2016, 3:04:00 AM12/25/16
to Node-RED
Dear Dave C-J 

Thank you.

I've just opend the serial by your help.
Have a merry Christmas!.



2016년 12월 25일 일요일 오후 6시 27분 47초 UTC+11, Stephen Haesung Lee 님의 말:

Stephen Haesung Lee

unread,
Dec 25, 2016, 6:24:10 AM12/25/16
to node...@googlegroups.com
My GPD data is very strange..
Is this normal? I can't recognise the Lon & Lat...



--


http://nodered.org


 


Join us on Slack to continue the conversation: http://nodered.org/slack


---


You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.


To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/eW7R-7IsWR0/unsubscribe.


To unsubscribe from this group and all its topics, 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.


Stephen Haesung Lee

unread,
Dec 25, 2016, 6:39:27 AM12/25/16
to node...@googlegroups.com
*GPS

Julian Knight

unread,
Dec 25, 2016, 6:54:42 AM12/25/16
to Node-RED
yes, that is correct I think, it is raw GPS data.

Dave C-J

unread,
Dec 25, 2016, 11:54:25 AM12/25/16
to node...@googlegroups.com
2 seconds on google gets you places like
where you can see that the V in the GPRMC sentence means you don't yet have a valid gps reading. So i think it's working fine.

Stephen Haesung Lee

unread,
Dec 25, 2016, 12:03:39 PM12/25/16
to node...@googlegroups.com
Dear Julian Knight & Dave C-J

Thank you so much!
It's really helpful!

Regards,
Lee, Stephen 


--


http://nodered.org


 


Join us on Slack to continue the conversation: http://nodered.org/slack


---


You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.


To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/eW7R-7IsWR0/unsubscribe.


To unsubscribe from this group and all its topics, 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.


Reply all
Reply to author
Forward
0 new messages