Re: VirtualSerial: Device or resource busy

2,007 views
Skip to first unread message

Johannes H. Jensen

unread,
Jan 18, 2013, 8:50:02 AM1/18/13
to lufa-s...@googlegroups.com
Replying to myself in case someone else stumble into the same.

It turns out it was a permission problem, something I didn't even consider given the dubious error message! Running minicom as root works, so all I need to do now is set up a .rules file[1].

Thanks goes to "Opendous Support", whoever you are, who was kind enough to send me the answer by e-mail :-)


Cheers,

- Johannes

On Wednesday, January 16, 2013 12:34:35 AM UTC+1, Johannes H. Jensen wrote:
Greetings!

I'm trying to get the Device/ClassDriver/VirtualSerial demo running on my "Pro Micro" ATmega32U4 board[1].

The board has no joystick, so I've commented out the Joystick code and replaced the call to CheckJoystickMovement() with:

fputs("Hello world\r\n", &USBSerialStream);

I.e. my attempt is to have an endless stream of "Hello world" messages printed to the serial device on my Linux machine.

The device seems to enumerate successfully. I see the following in dmesg:

[ 1719.756322] usb 1-1.3: new full-speed USB device number 27 using ehci_hcd
[ 1719.843258] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device

However, when I attempt to open /dev/ttyACM0 with minicom, all I get is "Device or resource busy":

$ minicom -b 9600 -D /dev/ttyACM0 
minicom: cannot open /dev/ttyACM0: Device or resource busy

Fuses read:

avrdude: Device signature = 0x1e9587
avrdude: safemode: lfuse reads as DE
avrdude: safemode: hfuse reads as 99
avrdude: safemode: efuse reads as C3

I'm running Ubuntu 12.10 with the 3.5.0 Linux kernel.

Any hints on what might be wrong?

Cheers,

- Johannes

Johannes H. Jensen

unread,
Jan 21, 2013, 5:50:49 PM1/21/13
to lufa-s...@googlegroups.com
Replying to myself again...

Turns out setting the permissions with an udev rule is not enough, at least on Ubuntu 12.10. Turns out a daemon called 'modem-manager' will try to open any new serial device it encounters. This prevents any other program from opening the serial device. Check syslog for clues like:

Jan 21 23:27:49 FarSite modem-manager[6970]: <info>  (ttyACM0) opening serial port...
Jan 21 23:27:56 FarSite modem-manager[6970]: <info>  (ttyACM0) closing serial port...
Jan 21 23:27:56 FarSite modem-manager[6970]: <info>  (ttyACM0) serial port closed
Jan 21 23:27:56 FarSite modem-manager[6970]: <warn>  Couldn't probe for capabilities, probably not a GSM or CDMA modem

To prevent this, you can add the following to the udev rule: ENV{ID_MM_DEVICE_IGNORE}="1", e.g.

SUBSYSTEM=="usb", ATTR{idVendor}=="1b4f", ATTR{idProduct}=="9205", MODE="0660", GROUP="plugdev", ENV{ID_MM_DEVICE_IGNORE}="1"

Cheers,

- Johannes

Don Davis

unread,
Jan 21, 2013, 6:17:33 PM1/21/13
to lufa-s...@googlegroups.com
Wow are they trying to become more apple like?

--
You received this message because you are subscribed to the Google Groups "LUFA Library Support List" group.
To view this discussion on the web visit https://groups.google.com/d/msg/lufa-support/-/kBqsOu-RBeMJ.

To post to this group, send email to lufa-s...@googlegroups.com.
To unsubscribe from this group, send email to lufa-support...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/lufa-support?hl=en.

Stefan Hellermann

unread,
Jan 22, 2013, 1:53:28 AM1/22/13
to lufa-s...@googlegroups.com
Happens on Fedora, too! Seems they probe every CDC device to know if
it's an mobile broadband modem.

2013/1/22 Don Davis <ddelma...@gmail.com>:

Marcin Szczodrak

unread,
Jan 17, 2014, 5:09:25 PM1/17/14
to lufa-s...@googlegroups.com
Thanks Johannes.

This worked for me with a similar problem with Ubuntu 13.10. I was attaching UCMote Proton B and the /dev/ttyACM0 was getting busy for ~35 seconds after plugging in, because of the modem-manager. 

Just to keep it public, for UCMote Proton B, the udev rule to save in

/etc/udev/rules.d/55-ucprotonb.rules 

is

SUBSYSTEM=="usb", ATTR{idVendor}=="04d8", ATTR{idProduct}=="00df", MODE="0660", GROUP="plugdev", ENV{ID_MM_DEVICE_IGNORE}="1"

-Marcin

László Monda

unread,
Jan 21, 2014, 7:04:57 AM1/21/14
to lufa-support
The modem manager suckage is actually a known problem documented at
https://github.com/abcminiuser/lufa/blob/master/Bootloaders/CDC/BootloaderCDC.txt

Sorry for not replying earlier and saving some pain.
> --
> You received this message because you are subscribed to the Google Groups
> "LUFA Library Support List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lufa-support...@googlegroups.com.
>
> To post to this group, send email to lufa-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lufa-support.
> For more options, visit https://groups.google.com/groups/opt_out.



--
László Monda <http://Monda.hu> | <http://UltimateHackingKeyboard.com>
Reply all
Reply to author
Forward
0 new messages