Serial Port (UART) with Node-Red on Beaglebone Black

707 views
Skip to first unread message

Michael Dalby

unread,
Apr 13, 2017, 3:03:31 PM4/13/17
to Node-RED
Hi All,

I hope someone can help me out there as I'm pulling my hair out in frustration at trying to get a simple serial port write from my BBB using Node-Red.
I have tried lots of different images to try and sort this problem out and thought I'd try you guys to see if anyone has successfully got this working?!?!?!

Software:
My latest attempt is to use the recently released Debian BBB image (https://beagleboard.org/latest-images) 8.7 [2017-3-19]... this has node red baked in as standard.(Ver 0.15.2).

Hardware:
I have a (RS485) waveshare cape fitted to my BBB to which is then connected an FTDI RS485 to serial (USB) interface cable - so to test comms I should be able to write a simple flow that uses an injection node into a serial output node and the message should go through the RS485 cape into the RS485 cable where it is converted into serial and back into my computer where it appears as a serial message in a terminau program (Terra Term).

When I click on the serial node I can search for the available comm ports and it allows me to select '/dev/ttySx' (where x is 0 to 5).... when I deploy the node it say connected in the serial node status. When I inject a message nothing is sent from the selected comm port. (Note - I have also tried an injection from the USB serial port into the cape to see if I can get a incomming message displayed in the debug window....but that doesn't work either)

I have read lots of comment online from people saying to adjust the uEnv.txt file to include a cape structure..... but this didn't work in the past - now with the latest build of Debian I can't seem to modify this file to try it as it says permission denied when I try to save the modified file (is this because I now have to login as Debian instead of Root - a recent change in the latest image)???

In the past I have also tried OctalBoneScript node install instead of using the standard Node-Red serial node, but this didn't work either

I seem to be going round in circles with this a burning hours/days in the process.... can anyone help please??     

Many thanks in advance

Michael

Garry Hayne

unread,
Apr 14, 2017, 1:10:34 PM4/14/17
to Node-RED
Hi,

does node-red have the necessary rights to access the port? I had a similar problem a few weeks ago, have a look at the group "serial"

Garry

Richard Tenney

unread,
Apr 17, 2017, 12:45:46 AM4/17/17
to Node-RED
Have you changed the pins for your UART from their default GPIO state?

Without a cape, I use the following file, which I call "setTty.sh" to do this to access /dev/ttyO4:
#!/bin/sh
config-pin p9.11 uart
config-pin p9.13 uart
stty -F /dev/ttyO4 sane
echo "/dev/ttyO4 state is"
stty -F /dev/ttyO4

Be sure to make the file executable ("chmod 755 setTty.sh" works) if you want to use it. Oh, and since I regard the BBB as a dedicated device, I violate all the rules and always run as root. So, I can't tell you if there are rights issues involved in configuring pins. I'd imagine that you do have to be root to change such things.

I then simply connect a Serial In node to a Debug node and (after deploying) watch the data arriving at the RxD.

What I haven't figured out -- any help greatly appreciated -- is how to extract some information from the serial string and put it into a web page, so an external browser can view it. And I also want to update the web page as the data in the string change. For starters, I have no idea at all how to insert a node-red flow into a web page and how to make that web page accessible to the world. I do know how to create a static HTML web page that is available to the world; it's inserting the node-red stuff that I haven't been able to figure out.

Cheers,
Richard
Reply all
Reply to author
Forward
0 new messages