If you’re working with embedded devices which present themselves as UARTs, you’ve
probably already noticed an annoying thing called ModemManager which tries to
talk to anything called
/dev/ttyACM*. This can cause ‘device in use’ errors when
you first configure the device, or mysterious hangs while using the device.
It used to be you could prevent this using a udev rule, but for some reason this wasn’t working.
After ages trying to work out what was going on, I found this article on Ask Ubuntu: udev rules seem ignored; can not prevent modem manager from grabbing device and also this irregular flash error thread and everything became horribly clear. The udev rules mechanism you’re used to using to prevent this happening no longer works.
If you just try to remove ModemManager it may stop your 4G modem etc working as well.
Assuming you don’t actually have any UART based modems the easiest thing is just to tell
ModemManager to leave
/etc/udev/rules.d/99-ttyacm.ruleswith the content:
Reload udevd rules with
sudo udevadm control --reload
/lib/systemd/system/ModemManager.service and change
ExecStart=/usr/sbin/ModemManager --filter-policy=strict to
This policy tells ModemManager to actually respect the
Frustratingly, the default policy is not “default” but “strict”, which ignores the flag
telling it to ignore the device.
Either way, reload the ModemManager configuration:
sudo systemctl daemon-reload sudo systemctl restart ModemManager
… and you should be working again!
Previously this article suggested edting
and adding to the
But for some reason ModemManager was still starting on my laptop, so I think the other technique is better.