Help on how to use the BBB UART

661 views
Skip to first unread message

Lidia Toscano

unread,
Sep 19, 2016, 3:22:11 PM9/19/16
to BeagleBoard
Howdy,

Here is the newbie again!  I am learning how to use the BB UARTs.  I am working on the example at https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/uart

The  minicom commands are not working for me.
  1. #first terminal window:
  2. minicom -b 9600 -D /dev/ttyO1
  3.  
  4. #second terminal window:
  5. minicom -b 9600 -D /dev/ttyO2

I modified the program slighty thinking I could setup UART1 and UART2, cross the RX/TX of UART 1 and UART 2 as per the directions.

Since I can't get the minicom to work for me is there another way I test everything is working?

Here is my program in Python:

#!/usr/bin/python
import Adafruit_BBIO.UART as UART
import serial

UART.setup("UART1")
UART.setup("UART2")

#tty1 RX = P9_26   TX = P9_24
ser = serial.Serial(port = "/dev/tty1", baudrate=9600)
#tty2 RX = P9_22   TX = P9_21
ser = serial.Serial(port = "/dev/tty2", baudrate=9600)
ser.close()
ser.open()
if ser.isOpen():
        print "Serial is open!"
        print "Great Job"
ser.write("Hello World!")
ser.close()

# Eventually, you'll want to clean up, but leave this commented for now,
# as it doesn't work yet
#UART.cleanup()

I am expecting to be able to transmit and receive: "Hello Word!"  right?

Thanks in advance,

Lidia

Robert Nelson

unread,
Sep 19, 2016, 3:25:57 PM9/19/16
to Beagle Board, Lidia Toscano
On Mon, Sep 19, 2016 at 2:22 PM, Lidia Toscano <lidia....@gmail.com> wrote:
> Howdy,
>
> Here is the newbie again! I am learning how to use the BB UARTs. I am
> working on the example at
> https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/uart
>
> The minicom commands are not working for me.
>
> #first terminal window:
> minicom -b 9600 -D /dev/ttyO1
>
> #second terminal window:
> minicom -b 9600 -D /dev/ttyO2
>
> I modified the program slighty thinking I could setup UART1 and UART2, cross
> the RX/TX of UART 1 and UART 2 as per the directions.
>
> Since I can't get the minicom to work for me is there another way I test
> everything is working?
>
> Here is my program in Python:
>
> #!/usr/bin/python
> import Adafruit_BBIO.UART as UART
> import serial
>
> UART.setup("UART1")
> UART.setup("UART2")
>
> #tty1 RX = P9_26 TX = P9_24
> ser = serial.Serial(port = "/dev/tty1", baudrate=9600)

^ /dev/ttyO1

> #tty2 RX = P9_22 TX = P9_21
> ser = serial.Serial(port = "/dev/tty2", baudrate=9600)

^ /dev/ttyO2

Regards,

--
Robert Nelson
https://rcn-ee.com/
Reply all
Reply to author
Forward
0 new messages