Bug 1261040 - ModemManager interferes with Arduino upload, udev rule necessary
Summary: ModemManager interferes with Arduino upload, udev rule necessary
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ModemManager
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lubomir Rintel
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-08 13:10 UTC by Georg Sauthoff
Modified: 2016-11-19 21:20 UTC (History)
7 users (show)

Fixed In Version: ModemManager-1.6.4-1.fc25
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-19 21:20:00 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Georg Sauthoff 2015-09-08 13:10:14 UTC
Description of problem:
When trying to upload a 'sketch' to an Arduino Micro device the IDE automatically resets the device, then there is a small time window where the device accepts the upload. By default, ModemManager interferes and tries to find a modem at that serial port - such that the upload fails.


Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1. open Arduino IDE, journal -fa
2. connect Arduino micro
3. upload a sample sketch

Actual results:
You see how the reset works (tty device re-emerges, LED blinks slowly).

Then the ModemManager engages:

ModemManager[904]: <warn>  (ttyACM0) could not open serial device (2)
ModemManager[904]: <warn>  (Plugin Manager) (Iridium) [ttyACM0] error when checking support: '(tty/ttyACM0) failed to open port: Could not open serial device ttyACM0: No such file or directory'
[..]
ModemManager[904]: <warn>  Couldn't find support for device at '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2': not supported by any plugin

During that time the Arduino IDE aborts with:

avrdude: ser_open(): can't open device "/dev/ttyACM0": Device or resource busy
avrdude: ser_send(): write error: Bad file descriptor
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

Expected results:
Upload should succeed, e.g. with something like:
Sketch uses 4,862 bytes (16%) of program storage space. Maximum is 28,672 bytes.
Global variables use 151 bytes (5%) of dynamic memory, leaving 2,409 bytes for local variables. Maximum is 2,560 bytes.

Additional info:

Telling ModemManager to ignore all Arduino devices via udev fixes the situation, e.g.:

# cat /etc/udev/rules.d/77-arduino.rules 
ATTRS{idVendor}=="2a03", ENV{ID_MM_DEVICE_IGNORE}="1"
# udevadm trigger

(snippet is from: http://starter-kit.nettigo.eu/2015/serial-port-busy-for-avrdude-on-ubuntu-with-arduino-leonardo-eth/ )

After that uploading works as expected.

Thus, it would be great if Fedora would include such a udev file.

Either as part of the arduino package, the avrdude package or even as part of the udev base rule set.

Comment 1 Georg Sauthoff 2015-09-08 13:17:44 UTC
Related: The old bug #861620 is about a similar issue.

In that case the exception was added to ModemManager, i.e. to

/usr/lib/udev/rules.d/77-mm-usb-device-blacklist.rules


The current bug is about another vendor string, though.

Comment 2 Fedora End Of Life 2015-11-04 10:35:39 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Gianluca Sforna 2015-11-04 11:16:03 UTC
Updating the bug as it's still relevant in F23

Comment 4 Sébastien Gendre 2016-04-14 17:19:34 UTC
Same problem here.

Comment 5 Lubomir Rintel 2016-07-27 07:30:07 UTC
Thank you.

Submitted upstream: https://bugs.freedesktop.org/show_bug.cgi?id=97093

Comment 6 Fedora Update System 2016-11-15 17:26:32 UTC
libqmi-1.16.2-1.fc25 ModemManager-1.6.4-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-d33ca7cd57

Comment 7 Fedora Update System 2016-11-16 20:24:52 UTC
ModemManager-1.6.4-1.fc25, libqmi-1.16.2-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-d33ca7cd57

Comment 8 Fedora Update System 2016-11-19 21:20:00 UTC
ModemManager-1.6.4-1.fc25, libqmi-1.16.2-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.