LINUX

Using Serial Ports In Linux

Article by:
Date Published:
Last Modified:

Where Do Serial Ports Show Up In Linux?

Serial ports typically show up as files under the /dev/ folder. They are usually prefixed with tty. Common names include:

ttyUSB0A common name for a generic USB-to-serial adapter. Most FTDI or Prolific adapters show up with this name.
ttyACM0Arduinos show up under this name. ACM stands for "Abstract Control Model".
ttyS0Some UART ports on SoC devices (such as the Xilinx Zynq) show up with this name.

Changing The Permissions On A Serial Port

You can change the permissions for a serial port so you don’t have to keep using sudo by typing:

1
sudo chmod 666 /dev/ACM0

where /dev/ACM0 is the file corresponding to the serial port you wish to control.

You can permanently change the permissions by adding the user to the group dialout with the following command:

1
~$ sudo adduser username dialout

which for the current user would just be:

1
~$ sudo adduser $USER dialout

Note that this depends on the username and dialout group already existing (which is normally the case).

WARNING

This new permission will not come into effect until the user has logged out and back in again.


Authors

Geoffrey Hunter

Dude making stuff.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License .

Related Content:

Tags

comments powered by Disqus