Ubuntu – Problem with serial port

12.04serial port

I am unable to access the serial port on my PC with Ubuntu 12.04.

The command:

dmesg | grep ttyS

Outputs:

[    0.590705] 00:08: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A

I think serial port is not getting detected.

Can anyone please help me in solving the problem?

Best Answer

[    0.590705] 00:08: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A

The line above tell us that the kernel detected a 16550 UART chip in your PC, which provides a serial port (ttyS0), and there's some resources allocated to it (0x3f8 I/O address, IRQ 4).

The default permissions for serial devices are the following:

crw-rw---- 1 root dialout ... /dev/ttyS0

So, if you are a member of the dialout group, you'll be able to access (read from/write to) the serial port devices. Add yourself to the dialout group by running:

sudo adduser $USER dialout

Or:

sudo adduser <username> dialout

Then log out and log in again. Now you should have access to the serial port. Of course, you must also input the correct settings (speed, data bits, parity, stop bits, flow control) in the program you're using to access the device.

Related Question