You need to be a member of the group that owns the serial port device connected to your rig. On Debian-based systems such as Debian GNU/Linux, Ubuntu and its derivatives (Kubuntu, Xubuntu, Lubuntu etc.) and Mint, just to name a few, this is the "dialout" group. On other systems you can determine the group you need to join with this command:
$ ls -l /dev/ttyUSB*
(If this doesn't return any files, use ''ls -l /dev/ttyS*'' instead.)
This should give you a list of one or more serial port devices of the form:
crw-rw---- 1 root uucp 188, 0 Jul 22 02:49 /dev/ttyUSB0
In this case the serial device is owned by user "root" and group "uucp", so you want to add yourself to the "uucp" group. In the examples below we will use "dialout" for the group we need to join.
There are several ways to add yourself to a group.
From a terminal, you can enter the following command
$ sudo adduser (username) dialout
Substitute your login name for (username)
You can check to be sure that you are now a member of the dialout group with the command:
$ groups
which should respond with the full list of groups you belong to.
There are also Graphical User Interface tools that perform the same basic function. On Lubuntu this is the "users-admin" command which is usually found on the Lubuntu menu item "System Tools | Users and groups". You can of course start that tool from the command line
$ sudo users-admin
sudo is used for all of these modifications to ensure that you have the correct read/write privilege for the files that will be changed. You may need to log out and log back in again for the change to take effect.
Contributed by Charlie, NA5NM
Contributed by Dave, WB5NHL
Contributed by John, KC5LAA
You need to log out and log back in again for the changes to take effect.
The serial drivers may need to be installed for the device to work properly. After plugging in the device, first check the hardware messages to see the device was detected:
$ dmesg
Toward the end of the messages, you should see this:
usb 1-1: new full speed USB device using uhci_and address 2 usb 1-1: configuration #1 chosen from 1 choice
Now, we need to figure out the device vendor number and product number to tell the usbserial driver. For this we can use lsusb. The easiest way to find the information is to first unplug the device, then run lsusb:
$ lsusb
You will see a summary list of your USB devices on the system, for example:
Bus 001 Device 001: ID 0000:0000
Now, plug the device back in, and run lsusb again:
$ lsusb
Which returns the summary list again, but now showing the new USB device:
Bus 001 Device 002: ID 4348:5523 Bus 001 Device 001: ID 0000:0000
Now, we can load up the driver for this device:
sudo modprobe usbserial vendor=0x4348 product=0x5523
Finally, check dmesg again to ensure it loaded properly.
$ dmesg
Near the end, you should see something like:
usbserial_generic 1-1:1.0: generic converter detected usb 1-1: generic converter now attached to ttyUSB0 usbcore: registered new interface driver usbserial_generic
Congratulations, your link is up - in this example, the device can be used on /dev/ttyUSB0. As much fun as you had doing this, there is some chance you want to do this automatically in the future. Just add this line:
usbserial vendor=0x4348 product=0x5523
to /etc/modules with the vendor and product numbers you found. Of course you must user sudo to edit that file.