Serial Port Data Transmission Issues

237 views
Skip to first unread message

jam...@cladnetwork.com

unread,
Jun 10, 2016, 10:42:51 AM6/10/16
to BeagleBoard
I am trying to get an arduino to communicate with the BeagleBone Black and send some measured sensor data over via the serial port. I am using the most recent version of node red to do this. I am running the latest version of Debian.

I have confirmed using an oscilloscope that the arduino's serial port is outputting the information when it is supposed to (it's triggered by an interrupt sent by the BBB). I can see the serial ports that are supposedly enabled in /dev and they appear as ttyO1, ttyO2, and ttyO4, and I have confirmed the port mapping and ruled out wiring issues as well (I'm using a logic level converter to go from the arduino's 5V to the BBB's 3.3V level).

The ports also appear to map like so:

lrwxrwxrwx 1 root root 5 Jun  9 22:37 ttyO1 -> ttyS1
lrwxrwxrwx 1 root root 5 Jun  9 22:37 ttyO2 -> ttyS2
lrwxrwxrwx 1 root root 5 Jun  9 22:37 ttyO4 -> ttyS4


Node red also sees these ports and indicated that they are 'connected' which I assume means opened.

When I attempt to receive data on the BBB from ANY of these ports I am unable to see anything on the output in node red or from the command prompt.

I am using a baud rate of 300 to rule out timing issues. I have also confirmed that the arduino's serial settings should be matched to what the BBB is expecting. Lastly, I have even tried sending simple strings from one serial port to the other on the BBB itself.

Has anyone here had this sort of issue and if so, how did you come to a solution?


TL;DR:
When I attempt to receive data on the BBB from ANY of the UART ports I am unable to see anything on the output in node red or from the command prompt. Already ruled out the obvious issues, and the BBB clearly sees the ports. What could be the issue here?

json source from nodered:

[{"id":"1a47c203.f9dc9e","type":"serial-port","z":"1d18ac42.887634","serialport":"/dev/ttyO2","serialbaud":"300","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"879d3b35.230e98","type":"debug","z":"1d18ac42.887634","name":"Sensor Output View","active":true,"console":"false","complete":"true","x":385.78334045410156,"y":60.44999694824219,"wires":[]},{"id":"5eef16d7.037da8","type":"serial in","z":"1d18ac42.887634","name":"Sensor Data","serial":"1a47c203.f9dc9e","x":124.7833251953125,"y":150.683349609375,"wires":[["879d3b35.230e98"]]},{"id":"52614fb3.59fe2","type":"bbb-discrete-out","z":"1d18ac42.887634","pin":"P8_7","inverting":false,"toggle":true,"defaultState":"1","name":"Interrupt to Sensors","x":284.38330078125,"y":348.3000183105469,"wires":[["ff5b799a.86d1a"]]},{"id":"bdbd2367.9d45a","type":"inject","z":"1d18ac42.887634","name":"Poll Sensors","topic":"","payload":"\\n int","payloadType":"str","repeat":"","crontab":"","once":false,"x":126.38330078125,"y":283.7333679199219,"wires":[["52614fb3.59fe2"]]},{"id":"ff5b799a.86d1a","type":"trigger","z":"1d18ac42.887634","op1":"int","op2":"0","op1type":"val","op2type":"pay","duration":"250","extend":false,"units":"ms","reset":"","name":"Reset","x":468.08331298828125,"y":352.0333251953125,"wires":[["b8a60fb7.8d86f"]]},{"id":"b8a60fb7.8d86f","type":"bbb-discrete-out","z":"1d18ac42.887634","pin":"P8_7","inverting":false,"toggle":true,"defaultState":"1","name":"Reset to HIGH","x":611.38330078125,"y":405.96668243408203,"wires":[[]]},{"id":"7e38a1db.de0088","type":"comment","z":"1d18ac42.887634","name":"Send Interrupt to Arduino","info":"","x":385.7833251953125,"y":286.9666748046875,"wires":[]},{"id":"b75bbc4d.e19d18","type":"comment","z":"1d18ac42.887634","name":"Serial Port Setup","info":"","x":142.0833282470703,"y":79.08333587646484,"wires":[]}]


Robert Nelson

unread,
Jun 10, 2016, 10:46:44 AM6/10/16
to Beagle Board, jam...@cladnetwork.com
Hi James,
By default, cape-universal is loaded, for BB-UART1 just do:

config-pin P9.24 uart
config-pin P9.26 uart

and then /dev/ttyO1 will now work..

Regards,

--
Robert Nelson
https://rcn-ee.com/

evilwulfie

unread,
Jun 10, 2016, 10:47:38 AM6/10/16
to beagl...@googlegroups.com
Take your serial port on the BBB and tie TX to RX. Use Screen or some other program to test your ports.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/7a31375d-5637-4032-bfe8-71d5e37d6ba0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


jam...@cladnetwork.com

unread,
Jun 10, 2016, 11:24:48 AM6/10/16
to BeagleBoard
Still no luck.

jam...@cladnetwork.com

unread,
Jun 10, 2016, 11:30:39 AM6/10/16
to BeagleBoard, jam...@cladnetwork.com

That did not help unfortunately, thanks anyway.

Manavendra Nath Manav

unread,
Jun 10, 2016, 12:44:34 PM6/10/16
to beagl...@googlegroups.com, jam...@cladnetwork.com
Hi James,

Which Port Pins of Beaglebone Red you have connected to which pins of
Arduino, and the output of that port pin properties in /sys we might
be able to help.

Thanks
Manav

On 6/10/16, jam...@cladnetwork.com <jam...@cladnetwork.com> wrote:
>
> That did not help unfortunately, thanks anyway.
> On Friday, June 10, 2016 at 10:46:44 AM UTC-4, RobertCNelson wrote:
>>
>> Hi James,
>>
>> On Fri, Jun 10, 2016 at 9:42 AM, <jam...@cladnetwork.com <javascript:>>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/a8e491c4-c39d-4812-bfbe-7346c5b315eb%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


--
Manavendra Nath Manav

William Hermans

unread,
Jun 10, 2016, 1:53:46 PM6/10/16
to beagl...@googlegroups.com
There are too many variables here to know what exactly is going on. Id actually use Node to test your connection as such . . .

(function() {
        var fs = require('fs');
        var rs = fs.createReadStream('/dev/ttyO0');
       
        rs.on('data', function(chunk){
                process.stdout.write(chunk.toString());
        });    
})();

Just change the device path . . . and this code does work. For writes, use createWriteStream() instead, and it's nearly as simple.

Some things that may be obvious to check.

Make sure that you swap data line from one device to the next. e.g. tx<->rx, rx<->tx.
Make sure you load the proper device tree files, and disable the universal IO device tree file. *IF* you do not want to use it.
Disconnect all your serial ports, and just work on a single port until you get something working.


jam...@cladnetwork.com

unread,
Jun 10, 2016, 4:30:05 PM6/10/16
to BeagleBoard, jam...@cladnetwork.com
I am using Beaglebone Black. I have connected pin 1 (tx) of the arduino to the rx input of my voltage level shifter, and then the result into pin 26 (UART1_RX) of the BBB. I have wired pin 0 of the artuino (rx) in a similar manner to pin 24 of the BBB.

Robert Nelson

unread,
Jun 10, 2016, 4:31:59 PM6/10/16
to Beagle Board, jam...@cladnetwork.com
On Fri, Jun 10, 2016 at 3:30 PM, <jam...@cladnetwork.com> wrote:
> I am using Beaglebone Black. I have connected pin 1 (tx) of the arduino to
> the rx input of my voltage level shifter, and then the result into pin 26
> (UART1_RX) of the BBB. I have wired pin 0 of the artuino (rx) in a similar
> manner to pin 24 of the BBB.

So just two pin's... Where's your ground pin connected?

jam...@cladnetwork.com

unread,
Jun 10, 2016, 4:39:00 PM6/10/16
to BeagleBoard, jam...@cladnetwork.com
GND (pin 1 on P9 rail) is connected to the arduino's GND & my protoboard's GND rails

jam...@cladnetwork.com

unread,
Jun 10, 2016, 6:05:39 PM6/10/16
to BeagleBoard
I believe I have found the problem. I need to get both the UART and the digital I/o pins enabled at the same time in the device tree, however when I edit uEnv.txt to enable the UART in the usual manner, universal i/o is no longer enabled, I am trying to explicitly enable that as well as the UART1. I'll keep you all posted. Advice on this is also highly appreciated.

Robert Nelson

unread,
Jun 10, 2016, 6:07:57 PM6/10/16
to Beagle Board
On Fri, Jun 10, 2016 at 5:05 PM, <jam...@cladnetwork.com> wrote:
> I believe I have found the problem. I need to get both the UART and the
> digital I/o pins enabled at the same time in the device tree, however when I
> edit uEnv.txt to enable the UART in the usual manner, universal i/o is no
> longer enabled, I am trying to explicitly enable that as well as the UART1.
> I'll keep you all posted. Advice on this is also highly appreciated.

universal i/o will disable it self, if you force something else via
cape_enable in /boot/uEnv.txt

jam...@cladnetwork.com

unread,
Jun 10, 2016, 6:11:09 PM6/10/16
to BeagleBoard
Thank you for the pointer. I'll look for the name of the i/o pin I'm using and enable that manually.

-James

jam...@cladnetwork.com

unread,
Jun 10, 2016, 6:41:24 PM6/10/16
to BeagleBoard
IT seems that whenever I enable the UARTs I cannot enable the appropriate digital i/o pins

ie I do this in uEnv.txt

cape_enable=bone_capemgr.enable_partno=PyBBIO-gpio2_2,BB-UART1,BB-UART2,BB-UART4

evilwulfie

unread,
Jun 10, 2016, 7:25:16 PM6/10/16
to beagl...@googlegroups.com
I find it easier to just write an overlay and load after boot time
much easier to test and debug.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.

jam...@cladnetwork.com

unread,
Jun 13, 2016, 1:13:10 PM6/13/16
to BeagleBoard
Wrote my own device tree overlay. About to test to see if it works. Thanks for all the help and advice!


On Friday, June 10, 2016 at 10:42:51 AM UTC-4, jam...@cladnetwork.com wrote:
Reply all
Reply to author
Forward
0 new messages