Cannot open serial device /dev/ttyUSB0
I am getting this error message when I try to connect to my C155 phone and upload hello_world.compalram.bin using this command:
./osmocon -p /dev/ttyUSB0 -m c155 ../../target/firmware/board/compal_e99/hello_world.compalram.bin
Even though device ttyUSB0 exists in my /dev/ directory, and I have set modprobe cp210x, and chmod 777 /dev/ttyUSB0. Here is an output from dmesg:
[ 105.110818] usb 6-3: USB disconnect, device number 2 [ 105.111098] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0 [ 105.111131] cp210x 6-3:1.0: device disconnected [ 113.728075] usb 6-3: new full speed USB device number 3 using ohci_hcd [ 113.901042] cp210x 6-3:1.0: cp210x converter detected [ 114.040085] usb 6-3: reset full speed USB device number 3 using ohci_hcd [ 114.206030] usb 6-3: cp210x converter now attached to ttyUSB0
Here is an output from ls -l /dev/tty :
crw-rw-rw- 1 root tty 5, 0 2013-06-04 21:27 /dev/tty crw--w---- 1 root tty 4, 0 2013-06-04 20:40 /dev/tty0 crw------- 1 root root 4, 1 2013-06-04 20:40 /dev/tty1 crw--w---- 1 root tty 4, 10 2013-06-04 20:40 /dev/tty10 crw--w---- 1 root tty 4, 11 2013-06-04 20:40 /dev/tty11 crw--w---- 1 root tty 4, 12 2013-06-04 20:40 /dev/tty12 crw--w---- 1 root tty 4, 13 2013-06-04 20:40 /dev/tty13 crw--w---- 1 root tty 4, 14 2013-06-04 20:40 /dev/tty14 crw--w---- 1 root tty 4, 15 2013-06-04 20:40 /dev/tty15 crw--w---- 1 root tty 4, 16 2013-06-04 20:40 /dev/tty16 crw--w---- 1 root tty 4, 17 2013-06-04 20:40 /dev/tty17 crw--w---- 1 root tty 4, 18 2013-06-04 20:40 /dev/tty18 crw--w---- 1 root tty 4, 19 2013-06-04 20:40 /dev/tty19 crw------- 1 root root 4, 2 2013-06-04 20:40 /dev/tty2 crw--w---- 1 root tty 4, 20 2013-06-04 20:40 /dev/tty20 crw--w---- 1 root tty 4, 21 2013-06-04 20:40 /dev/tty21 crw--w---- 1 root tty 4, 22 2013-06-04 20:40 /dev/tty22 crw--w---- 1 root tty 4, 23 2013-06-04 20:40 /dev/tty23 crw--w---- 1 root tty 4, 24 2013-06-04 20:40 /dev/tty24 crw--w---- 1 root tty 4, 25 2013-06-04 20:40 /dev/tty25 crw--w---- 1 root tty 4, 26 2013-06-04 20:40 /dev/tty26 crw--w---- 1 root tty 4, 27 2013-06-04 20:40 /dev/tty27 crw--w---- 1 root tty 4, 28 2013-06-04 20:40 /dev/tty28 crw--w---- 1 root tty 4, 29 2013-06-04 20:40 /dev/tty29 crw------- 1 root root 4, 3 2013-06-04 20:40 /dev/tty3 crw--w---- 1 root tty 4, 30 2013-06-04 20:40 /dev/tty30 crw--w---- 1 root tty 4, 31 2013-06-04 20:40 /dev/tty31 crw--w---- 1 root tty 4, 32 2013-06-04 20:40 /dev/tty32 crw--w---- 1 root tty 4, 33 2013-06-04 20:40 /dev/tty33 crw--w---- 1 root tty 4, 34 2013-06-04 20:40 /dev/tty34 crw--w---- 1 root tty 4, 35 2013-06-04 20:40 /dev/tty35 crw--w---- 1 root tty 4, 36 2013-06-04 20:40 /dev/tty36 crw--w---- 1 root tty 4, 37 2013-06-04 20:40 /dev/tty37 crw--w---- 1 root tty 4, 38 2013-06-04 20:40 /dev/tty38 crw--w---- 1 root tty 4, 39 2013-06-04 20:40 /dev/tty39 crw------- 1 root root 4, 4 2013-06-04 20:40 /dev/tty4 crw--w---- 1 root tty 4, 40 2013-06-04 20:40 /dev/tty40 crw--w---- 1 root tty 4, 41 2013-06-04 20:40 /dev/tty41 crw--w---- 1 root tty 4, 42 2013-06-04 20:40 /dev/tty42 crw--w---- 1 root tty 4, 43 2013-06-04 20:40 /dev/tty43 crw--w---- 1 root tty 4, 44 2013-06-04 20:40 /dev/tty44 crw--w---- 1 root tty 4, 45 2013-06-04 20:40 /dev/tty45 crw--w---- 1 root tty 4, 46 2013-06-04 20:40 /dev/tty46 crw--w---- 1 root tty 4, 47 2013-06-04 20:40 /dev/tty47 crw--w---- 1 root tty 4, 48 2013-06-04 20:40 /dev/tty48 crw--w---- 1 root tty 4, 49 2013-06-04 20:40 /dev/tty49 crw------- 1 root root 4, 5 2013-06-04 20:40 /dev/tty5 crw--w---- 1 root tty 4, 50 2013-06-04 20:40 /dev/tty50 crw--w---- 1 root tty 4, 51 2013-06-04 20:40 /dev/tty51 crw--w---- 1 root tty 4, 52 2013-06-04 20:40 /dev/tty52 crw--w---- 1 root tty 4, 53 2013-06-04 20:40 /dev/tty53 crw--w---- 1 root tty 4, 54 2013-06-04 20:40 /dev/tty54 crw--w---- 1 root tty 4, 55 2013-06-04 20:40 /dev/tty55 crw--w---- 1 root tty 4, 56 2013-06-04 20:40 /dev/tty56 crw--w---- 1 root tty 4, 57 2013-06-04 20:40 /dev/tty57 crw--w---- 1 root tty 4, 58 2013-06-04 20:40 /dev/tty58 crw--w---- 1 root tty 4, 59 2013-06-04 20:40 /dev/tty59 crw------- 1 root root 4, 6 2013-06-04 20:40 /dev/tty6 crw--w---- 1 root tty 4, 60 2013-06-04 20:40 /dev/tty60 crw--w---- 1 root tty 4, 61 2013-06-04 20:40 /dev/tty61 crw--w---- 1 root tty 4, 62 2013-06-04 20:40 /dev/tty62 crw--w---- 1 root tty 4, 63 2013-06-04 20:40 /dev/tty63 crw--w---- 1 root tty 4, 7 2013-06-04 20:40 /dev/tty7 crw--w---- 1 root tty 4, 8 2013-06-04 20:40 /dev/tty8 crw--w---- 1 root tty 4, 9 2013-06-04 20:40 /dev/tty9 crw------- 1 root root 5, 3 2013-06-04 20:40 /dev/ttyprintk crw-rw---- 1 root dialout 4, 64 2013-06-04 20:40 /dev/ttyS0 crw-rw---- 1 root dialout 4, 65 2013-06-04 20:40 /dev/ttyS1 crw-rw---- 1 root dialout 4, 74 2013-06-04 20:40 /dev/ttyS10 crw-rw---- 1 root dialout 4, 75 2013-06-04 20:40 /dev/ttyS11 crw-rw---- 1 root dialout 4, 76 2013-06-04 20:40 /dev/ttyS12 crw-rw---- 1 root dialout 4, 77 2013-06-04 20:40 /dev/ttyS13 crw-rw---- 1 root dialout 4, 78 2013-06-04 20:40 /dev/ttyS14 crw-rw---- 1 root dialout 4, 79 2013-06-04 20:40 /dev/ttyS15 crw-rw---- 1 root dialout 4, 80 2013-06-04 20:40 /dev/ttyS16 crw-rw---- 1 root dialout 4, 81 2013-06-04 20:40 /dev/ttyS17 crw-rw---- 1 root dialout 4, 82 2013-06-04 20:40 /dev/ttyS18 crw-rw---- 1 root dialout 4, 83 2013-06-04 20:40 /dev/ttyS19 crw-rw---- 1 root dialout 4, 66 2013-06-04 20:40 /dev/ttyS2 crw-rw---- 1 root dialout 4, 84 2013-06-04 20:40 /dev/ttyS20 crw-rw---- 1 root dialout 4, 85 2013-06-04 20:40 /dev/ttyS21 crw-rw---- 1 root dialout 4, 86 2013-06-04 20:40 /dev/ttyS22 crw-rw---- 1 root dialout 4, 87 2013-06-04 20:40 /dev/ttyS23 crw-rw---- 1 root dialout 4, 88 2013-06-04 20:40 /dev/ttyS24 crw-rw---- 1 root dialout 4, 89 2013-06-04 20:40 /dev/ttyS25 crw-rw---- 1 root dialout 4, 90 2013-06-04 20:40 /dev/ttyS26 crw-rw---- 1 root dialout 4, 91 2013-06-04 20:40 /dev/ttyS27 crw-rw---- 1 root dialout 4, 92 2013-06-04 20:40 /dev/ttyS28 crw-rw---- 1 root dialout 4, 93 2013-06-04 20:40 /dev/ttyS29 crw-rw---- 1 root dialout 4, 67 2013-06-04 20:40 /dev/ttyS3 crw-rw---- 1 root dialout 4, 94 2013-06-04 20:40 /dev/ttyS30 crw-rw---- 1 root dialout 4, 95 2013-06-04 20:40 /dev/ttyS31 crw-rw---- 1 root dialout 4, 68 2013-06-04 20:40 /dev/ttyS4 crw-rw---- 1 root dialout 4, 69 2013-06-04 20:40 /dev/ttyS5 crw-rw---- 1 root dialout 4, 70 2013-06-04 20:40 /dev/ttyS6 crw-rw---- 1 root dialout 4, 71 2013-06-04 20:40 /dev/ttyS7 crw-rw---- 1 root dialout 4, 72 2013-06-04 20:40 /dev/ttyS8 crw-rw---- 1 root dialout 4, 73 2013-06-04 20:40 /dev/ttyS9 crwxrwxrwx 1 root dialout 188, 0 2013-06-04 21:07 /dev/ttyUSB0
What is it that I am doing wrong?
Thanks, George
Excerpts from George Andguladze's message of 2013-06-04 10:40:35 -0700:
Cannot open serial device /dev/ttyUSB0
I am getting this error message when I try to connect to my C155 phone and upload hello_world.compalram.bin using this command:
./osmocon -p /dev/ttyUSB0 -m c155 ../../target/firmware/board/compal_e99/hello_world.compalram.bin
Even though device ttyUSB0 exists in my /dev/ directory, and I have set modprobe cp210x, and chmod 777 /dev/ttyUSB0.
instead of setting 777 permissions on this device, you can simply add yourself to the dialout group (it's the more proper way) here the debian command (don't forget to log out and in again for this to take effect) sudo adduser $USER dialout
crw-rw---- 1 root dialout 4, 71 2013-06-04 20:40 /dev/ttyS7 crw-rw---- 1 root dialout 4, 72 2013-06-04 20:40 /dev/ttyS8 crw-rw---- 1 root dialout 4, 73 2013-06-04 20:40 /dev/ttyS9 crwxrwxrwx 1 root dialout 188, 0 2013-06-04 21:07 /dev/ttyUSB0
What is it that I am doing wrong?
does it work with root rights (using sudo)?
kevin
Hi,
On 04.06.2013 19:40, George Andguladze wrote:
Cannot open serial device /dev/ttyUSB0 What is it that I am doing wrong?
If you're using a recent version of Ubuntu/Debian, modem-manager opens serial devices when connected and probes for a modem. Also, on older versions of Ubuntu brltty might block the port.
To work around the modem-manager issue either uninstall it, or put a udev blacklist rule in place (where you insert the VID/PID of your adapter):
http://cgit.freedesktop.org/ModemManager/ModemManager/tree/src/77-mm-usb-dev...
Regards, Steve
Hi Steve,
Thanks for help, but ModemManager doesn't seem to be an issue. Question: Does "Cannot open serial device /dev/ttyUSB0" error mean that it is unable to connect to my USB adapter or that there might not be a phone connected on the other end of the adapter?
George
Date: Wed, 5 Jun 2013 20:19:57 +0200 From: steve@steve-m.de To: gandguladze@hotmail.com Subject: Re: Cannot open serial device /dev/ttyUSB0 CC: baseband-devel@lists.osmocom.org
Hi,
On 04.06.2013 19:40, George Andguladze wrote:
Cannot open serial device /dev/ttyUSB0 What is it that I am doing wrong?
If you're using a recent version of Ubuntu/Debian, modem-manager opens serial devices when connected and probes for a modem. Also, on older versions of Ubuntu brltty might block the port.
To work around the modem-manager issue either uninstall it, or put a udev blacklist rule in place (where you insert the VID/PID of your adapter):
http://cgit.freedesktop.org/ModemManager/ModemManager/tree/src/77-mm-usb-dev...
Regards, Steve
Hi,
Thanks for help, but ModemManager doesn't seem to be an issue. Question: Does "Cannot open serial device /dev/ttyUSB0" error mean that it is unable to connect to my USB adapter or that there might not be a phone connected on the other end of the adapter?
It means it can't open the char device ... basically the call to open("/dev/ttyUSB0") failed somehow. nothing to do with the phone.
Cheers,
Sylvain
I can read/write baud rates to EEPROM of the device using cp210x-program. Basically I have tried everything apart from reinstalling the OS (Ubuntu 10.04). What might be the issue? (for more info refer to the older conversations)
Date: Tue, 11 Jun 2013 10:39:16 +0200 Subject: Re: Cannot open serial device /dev/ttyUSB0 From: 246tnt@gmail.com To: gandguladze@hotmail.com CC: steve@steve-m.de; baseband-devel@lists.osmocom.org
Hi,
Thanks for help, but ModemManager doesn't seem to be an issue. Question: Does "Cannot open serial device /dev/ttyUSB0" error mean that it is unable to connect to my USB adapter or that there might not be a phone connected on the other end of the adapter?
It means it can't open the char device ... basically the call to open("/dev/ttyUSB0") failed somehow. nothing to do with the phone.
Cheers,
Sylvain
On Tue, Jun 11, 2013 at 10:44 AM, George Andguladze gandguladze@hotmail.com wrote:
I can read/write baud rates to EEPROM of the device using cp210x-program. Basically I have tried everything apart from reinstalling the OS (Ubuntu 10.04). What might be the issue? (for more info refer to the older conversations)
Try to strace it.
strace osmocon ....
Cheers,
Sylvain
Hi Sylvain, thanks for that, already getting somewhere. Here are last several lines from strace output:
open("/dev/ttyUSB0", O_RDWR|O_NOCTTY) = 3 14:21:07.712932 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0 14:21:07.713657 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0 14:21:07.713847 ioctl(3, SNDCTL_TMR_START or TCSETS, {B115200 -opost -isig -icanon -echo ...}) = 0 14:21:07.715039 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 -opost -isig -icanon -echo ...}) = 0 14:21:07.715261 ioctl(3, TIOCMBIS, [TIOCM_DTR|TIOCM_RTS]) = -1 EPIPE (Broken pipe) 14:21:07.717054 close(3) = 0 14:21:07.720986 write(2, "Cannot open serial device /dev/t"..., 39Cannot open serial device /dev/ttyUSB0
I got -1 at ioctl(3, TIOCMBIS, [TIOCM_DTR|TIOCM_RTS]) (Broken pipe). But it was actually able to open "/dev/ttyUSB0" (returned 3). Have to find out what -1 means at this point.
Date: Tue, 11 Jun 2013 11:21:23 +0200 Subject: Re: Cannot open serial device /dev/ttyUSB0 From: 246tnt@gmail.com To: gandguladze@hotmail.com CC: baseband-devel@lists.osmocom.org
On Tue, Jun 11, 2013 at 10:44 AM, George Andguladze gandguladze@hotmail.com wrote:
I can read/write baud rates to EEPROM of the device using cp210x-program. Basically I have tried everything apart from reinstalling the OS (Ubuntu 10.04). What might be the issue? (for more info refer to the older conversations)
Try to strace it.
strace osmocon ....
Cheers,
Sylvain
________________________________ I had some problems with similar error message,they occurred when I wanted to restart osmocom-apps after having removed phone with its usb cable from pc and then reinserting phone and usb-cable. But when I just remove the phone from the usb-cable and then reconnect phone to the cable the "Cannot open serial device /dev/ttyUSB0" messages no longer occur and one can then rerun the osmocom-apps without error messages.
Regards Erich
Experiencing the same problem with "cannot open serial device". LSUSB list group of USB devices, my T191 cable even has it's own name as UART ... when connected (by the way other cable looks like thin USB-jack does not appear in lsusb), but still every time getting "cannot open".
What is it that I am doing wrong?
-- View this message in context: http://baseband-devel.722152.n3.nabble.com/Cannot-open-serial-device-dev-tty... Sent from the baseband-devel mailing list archive at Nabble.com.
baseband-devel@lists.osmocom.org