0


I'm trying to detect the UART port names for a BananaPi M3 device running a Raspbian so I can do a simple test to send and receive some data on it. I connected the RX and TX pins of the UART connector with a simple jumper but I cannot detect the actual name of the ports. The pins are described here but I don't find exactly their names.
The tests I made so far without success:

ser = serial.Serial('/dev/ttyS1', 115200, timeout = 1)
    num = ser.write("test\n")
ser2 = serial.Serial('/dev/ttyS2', 115200, timeout = 1)
    data = ser2.read(100)


So, how exactly the UART port names can be detected.
Thank you

Jan Marek
  • 10,390
  • 3
  • 21
  • 19
Lucian
  • 874
  • 11
  • 33
  • 1
    Did you have a look into the file system? `ls -l /dev/tty*` or so? – glglgl Jul 25 '16 at 11:41
  • 1
    In addition to @glglgl I'd suggest using `ls -l /dev/ttyS*` in order to list serial ports only. – albert Jul 25 '16 at 11:43
  • ls -l /dev/ttyS* outputs: crw--w---- 1 root tty 249, 0 Dec 18 19:50 /dev/ttyS0 crw-rw---- 1 root dialout 249, 1 Dec 18 20:12 /dev/ttyS1 crw-rw---- 1 root dialout 249, 2 Dec 18 20:16 /dev/ttyS2 So, which is which? – Lucian Jul 25 '16 at 11:47
  • Possible duplicate of [How to find all serial devices (ttyS, ttyUSB, ..) on Linux without opening them?](http://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them) – sawdust Jul 25 '16 at 18:26

0 Answers0