ftdi usb serial node only accessible by root
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
After the upgrade to Kubuntu 10.10 I was not able connect to my buspirate (FTDI USB -> serial). Minicom reported:
minicom: cannot open /dev/buspirate: Device or resource busy
uname -a : Linux lorelei 2.6.35-22-generic #34-Ubuntu SMP Sun Oct 10 09:26:05 UTC 2010 x86_64 GNU/Linux
This was working fine before the upgrade. At that time I had the following udev rule: 98-buspirate.rules
UBSYSTEM=="tty", ATTRS{serial}
I thought it could have something to do with the rule so I removed it and reloaded the udev rules:
sudo udevadm control --reload-rules
Then again I could acces /dev/ttyUSB0 as normal user.
Today after a reboot I wanted to access my buspirate through minicom (udev rule removed) and could not access /dev/ttyUSB0:
minicom: cannot open /dev/ttyUSB0: Device or resource busy
I checked the permissions:
ping@lorelei:~$ ls -al /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 2010-10-18 20:52 /dev/ttyUSB0
Group membership:
ping@lorelei:~$ groups
ping adm dialout cdrom plugdev users lpadmin admin sambashare vboxusers
Even added myself to the uucp group but to nothing changed. Tried reloading the ftdi_sio kernel module but didn't help.
dmesg entries look normal I think:
[ 7795.737299] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[ 7795.737309] ftdi_sio 6-2:1.0: device disconnected
[ 7798.963590] usb 6-2: new full speed USB device using uhci_hcd and address 8
[ 7799.178150] ftdi_sio 6-2:1.0: FTDI USB Serial Device converter detected
[ 7799.178188] usb 6-2: Detected FT232RL
[ 7799.178192] usb 6-2: Number of endpoints 2
[ 7799.178196] usb 6-2: Endpoint 1 MaxPacketSize 64
[ 7799.178199] usb 6-2: Endpoint 2 MaxPacketSize 64
[ 7799.178203] usb 6-2: Setting MaxPacketSize 64
[ 7799.179162] usb 6-2: FTDI USB Serial Device converter now attached to ttyUSB0
I did an strace of minicom to see if I got any wiser:
....
stat("/var/lock", {st_mode=
open("/
umask(022) = 022
open("/
getpid() = 10590
write(3, " 10590\n", 11) = 11
close(3) = 0
umask(022) = 022
rt_sigaction(
alarm(4) = 0
open("/
alarm(0) = 4
rt_sigaction(
....
Permissions of /var/lock can't be the cause...
Using sudo I can access the buspirate, but I want to run my programs as a regular user...
I did notice that connecting through minicom to /dev/ttyS0 with the same permissions is successful.
I found the culprit, modem-manager...
I loaded the ftdi_sio driver with debugging enabled. While searching the syslog (did not check it yesterday) for debugging output from the driver I found that from the moment I plugged the buspirate in, modem-manager opened the port for some reason. Effectively locking the port, this without putting a lock file in /var/lock.
I removed modem-manager and could use my buspirate again.
Maybe it would be could if modem-manager puts a lockfile in /var/lock when opening a serial port.....