Current location - Quotes Website - Team slogan - Linux search serial port
Linux search serial port
1, equipment entrance

You can check /dev/ttyS*, /dev/*uart* (main device number 4 or 204), and the first serial port is usually ttyS0, *uart0, etc.

The USB-to-serial device is generally /dev/ttyUSB* (the main device number is 188), and the first port is generally ttyUSB0.

2. The above /dev is only the entrance of serial port, and the existence of specific devices needs to be determined by querying /proc/devices with keywords (ttyS, ttyUSB, uart).

3. The serial port is a communication port. If there are multiple serial port devices, it is necessary to check which serial port is connected, for example:

cat /dev/ttyS0