How to get started on serial ports on the BBB


I am little confused about serial ports on the BBB.

How can the BBB be connected to a RS 232 port ?? Do I have to use a USB-serial converter ?? or can this be done using the USART I/O pins on the BBB ?

I have seen a tutorial on adafruit that explains serial ports using python, I would like to use C++ for this, could anyone please point out some tutorials that explain how this can be done.


From a hardware perspective id you want to connect to a RS232 interface, you will need an RS232 level shifter.


Sure I understand, its not the hardware that is the problem, I need some C++ or C tutorials for the BeagleBone black that can help me.

Which of the USART ports can I use ?? Something that runs by default after power up would be good.


In C:
You can enum all the ttys in the system by reading the symlinks in directory /sys/class/tty/.

Then you can read the pseudofile to check if it is a real serial port or a virtual one. The possible values are in <linux/serial.h>:
See: c - UNIX - list all existing serial ports - Stack Overflow

1 Like

dmesg | grep tty

From command. Write a script to monitor status of specific port you are looking for.