How to use UART5 with Adafruit_BBIO ?

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
dlchambers
 
Posts: 20
Joined: Thu May 12, 2011 3:23 pm

How to use UART5 with Adafruit_BBIO ?

Post by dlchambers »

Starting with this:
https://learn.adafruit.com/setting-up-i ... black/uart
and changing it to do a loopback read:

Code: Select all

import Adafruit_BBIO.UART as UART
import serial
 
p = "5"
print "Running UART test on ttyO"+p
UART.setup("UART"+p)
ser = serial.Serial(port = "/dev/ttyO"+p, baudrate=9600)
ser.close()
ser.open()
if ser.isOpen():
	print "ttyO"+p+" is open!"

	count = 0
	ser.write("Hello World!")
	while(count < 5):
		print(ser.read())
		count = count + 1
   
ser.close()
 
I'm able to tx/rx on UART1, 2, and 4.
But when I try it on UART5 I get errors:

Code: Select all

Running UART test on ttyO5
Traceback (most recent call last):
  File "utest.py", line 10, in <module>
    ser = serial.Serial(port = "/dev/ttyO"+p, baudrate=9600)
  File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 260, in __init__
    self.open()
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 276, in open
    raise SerialException("could not open port %s: %s" % (self._port, msg))
serial.serialutil.SerialException: could not open port /dev/ttyO5: [Errno 2] No such file or directory: '/dev/ttyO5'
 
Any idea why?

One hint might be that I don't see ttyO5 here:

Code: Select all

ls -l /dev/ttyO*
crw-rw---- 1 root tty     247, 0 Mar 15 14:36 /dev/ttyO0
crw-rw---T 1 root dialout 247, 1 Mar 15 14:36 /dev/ttyO1
crw-rw---T 1 root dialout 247, 2 Mar 15 14:36 /dev/ttyO2
crw-rw---T 1 root dialout 247, 4 Mar 15 14:38 /dev/ttyO4
but then again I didn't knowingly :) do anything specific to create/enable 1, 2, and 4.

my /boot/uboot/uEnv.txt contains this:

Code: Select all

capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4,BB-UART5
Thanks!

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”