How do I connect to a terminal to a serial-to-USB device on Ubuntu 10.10 (Maverick Meerkat)?
Solution 1
First check with dmesg | grep tty
if system recognize your adapter.
Then try to run minicom with sudo minicom -s
, go to "Serial port setup" and change the first line to /dev/ttyUSB0
.
Don't forget to save config as default with "Save setup as dfl". It works for me on Ubuntu 11.04 on VirtualBox.
Solution 2
You will need to set the permissions every time you plug the converter in. I use PuTTY to connect. In order to do so, I have created a little Bash script to sort out the permissions and launch PuTTY:
#!/bin/bash
sudo chmod 666 /dev/ttyUSB0
putty
P.S. I would never recommend that permissions are set to 777.
Solution 3
The serial port communication programs moserial
or gtkterm
provide an easy way to check connectivity and modify /dev/ttyUSB0
(or /dev/ttyUSB1
!) settings. Even though there maybe only a single USB to RS232 adapter, the n
designation /dev/ttyUSBn
can and does change periodically! Both moserial
and gtkterm
will show what port designation is relevant in their respective pull down menus when selecting an appropriate port
to use.
Check out help.ubuntu.com/community/Minicom for details on minicom
.
Solution 4
Long time reader, first time helper ;)
I'm going through the same hellish
experience here with a Prolific USB <> Serial adapter and so far Linux is the easiest to get it to work.
On CentOS, I didn't need to install any drivers etc.. That said,
-
dmesg | grep -i tty
ordmesg | grep -i usb
showed me /dev/ttyUSB0. -
screen ttyUSB0 9600
didn't do the trick for me like it did in OSX - minicom is new to me but it was complaining about lack of /dev/modem
However, this helped: https://www.centos.org/forums/viewtopic.php?t=21271
So install minicom (yum install minicom
) then enter its settings (minicom -s
).
Then select Serial Port Setup
and change the Serial Device (Option A) to /dev/ttyUSB0, or whatever your device file is as it slightly differs per distro.
Then change the Bps (Option E) to 9600 and the rest should be default (8N1 Y N)
Save as default, then simply minicom
and Bob's your uncle.
HTH.
Solution 5
I had fix this with adduser *username* dialout
. I never had this error again, even though previously the only way to get it to work was to reboot the PC or unplug and replug the usb to serial adapter.
codingJoe
Updated on July 05, 2022Comments
-
codingJoe almost 2 years
I am trying to connect minicom to a serial device that is connected via a USB-to-serial adapter. This is a PL2303 and from everything I've read no additional drivers are required. The device is recognised as a PL2303.
I'm a beginner at minicom. Is this the correct command to execute? Or do I need to configure something?
$ sudo minicom --device /dev/ttyUSB0 minicom: cannot open /dev/ttyUSB0: No such file or directory $ sudo lsusb -v Bus 002 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port Device Descriptor: bLength 18 bDescriptorType 1 $ tail /var/log/syslog #then removed and attached the device. Mar 13 23:31:49 ubuntu kernel: [807996.786805] usb 2-1: pl2303 converter now attached to ttyUSB0 Mar 13 23:34:44 ubuntu kernel: [808172.155129] usb 2-1: USB disconnect, address 7 Mar 13 23:34:44 ubuntu kernel: [808172.156321] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0 Mar 13 23:34:44 ubuntu kernel: [808172.156374] pl2303 2-1:1.0: device disconnected Mar 13 23:34:52 ubuntu kernel: [808179.497856] usb 2-1: new full speed USB device using uhci_hcd and address 8 Mar 13 23:34:52 ubuntu kernel: [808179.785845] pl2303 2-1:1.0: pl2303 converter detected Mar 13 23:34:52 ubuntu kernel: [808179.872309] usb 2-1: pl2303 converter now attached to ttyUSB0
-
Chris Stratton almost 12 yearsYes, if you run as a regular user permissions could be an issue. Note however that in this question, minicom is being run as root using sudo. Generally the preferred solution on access permissions is to assign users who need access to a group which owns the serial port device files and has the needed permission to them - on Ubuntu that is typically 'dialout'
-
Don Kirkby almost 12 yearsFor more details on the
dialout
group, see a related question on askubuntu.com. -
abarisone almost 9 yearsCould you please add a little more description about the explanation you provide?
-
gatorback almost 8 yearsCutecom is an intuitive serial-port monitor. Be sure to mind the devices permissions: best to open them up: chmod 777 /dev/ttyUSB0
-
Vassilis almost 8 yearsI think that is worth trying to add your user to the
dialout
and/oruucp
group before changing permissions, as you might not need to do that anymore! -
Vassilis almost 8 yearsAlso, add user to the
dialout
group, as you need write access to the device. -
Matthias Dieter Wallnöfer about 7 yearsShould probably mean
/dev/ttyACM0
instead of/dev/ttyUSB0
. -
Simon A. Eugster almost 5 years@MatthiasDieterWallnöfer it depends.
-
ryanjdillon over 4 yearsExcellent SO writing style :)
-
Scott Prive about 3 yearsI can add an update: @Vassilis answer is true still today (even on Ubuntu 20). If you had
ls -l /dev/ttyUSB0
and looked at the device's "group" owner, that would be a clue what group your user needs to be added to. Lastly, the 3rd column is "nobody" permission meaning if you're going to hack permission changes, that's the column you especially do not want to change (it won't help your user, and it may grant permission to insecure processes such as a webserver you run). See:usermod -a -G dialout $USER
instead.. -
Jesusaur about 3 yearsI'm able to use
screen -U /dev/ttyUSB0 115200
to connect to a PL2303