Disable ModemManager from container

I have a weird use case where I’m using a USB Bluetooth dongle as a BLE controller connected to a Pi Zero running Balena.

An issue I’m having is ModemManager seems to be flooding my USB serial port with AT commands, essentially reducing the useful data I can get out of it.

I’ve tried using dbus to disable ModemManager from inside a Debain container using:

DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket \
    dbus-send \
    --system \
    --reply-timeout=2000 \
    --dest=org.freedesktop.systemd1 \
    /org/freedesktop/systemd1 \
    org.freedesktop.systemd1.Manager.StopUnit \
    string:ModemManager.service string:fail

but it doesn’t seem to work - still a bunch of random AT commands being fed through that serial port (/dev/ttyACM0).

Any ideas?

Hello @jordanhardy1 ,

Have you tried adding an UDEV rule to disable ModemManager for that device in particular? There’s information on how to do so here.
That might be a solution for your use case.

Cheers!