TransWikia.com

Enabling serial network devices with ModemManager

Ask Ubuntu Asked by Chris Watts on November 19, 2021

When enabling ModemManager, I don’t see my serial-based SIM808 FONA in the list of available modems even though I’m able to get it working with pppd.

If I start ModemManager with service stop ModemManager && ModemManager --debug I see that it scans past serial devices when searching for modems but for every device I see:

modem-manager: (tty/ttyO4): port's parent platform driver is not whitelisted

Looking at the source code, I see that it checks the device for the udev flag ID_MM_PLATFORM_DRIVER_PROBE. If this flag does not exist, the serial port will not be scanned. It also checks for the ID_MM_CANDIDATE flag to see if it’s a supported port further up, so I know it’s at least able to read that.

So I added this flag as a new rule in a new file /etc/udev/rules.d/78-mm-uart4-enable.rules

ACTION=="add", KERNEL=="ttyO4", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1"

After reboot, I see this in udevadm info /dev/ttyO4

P: /devices/ocp.3/481a8000.serial/tty/ttyO4
N: ttyO4
E: DEVNAME=/dev/ttyO4
E: DEVPATH=/devices/ocp.3/481a8000.serial/tty/ttyO4
E: ID_MM_CANDIDATE=1
E: ID_MM_PLATFORM_DRIVER_PROBE=1
E: MAJOR=247
E: MINOR=4
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=30104

But I still get the same error from modem-manager even though I clearly have the flag set. How do I whitelist ttyO4 correctly?

One Answer

In the source code, the first check for ID_MM_CANDIDATE is done on the port (i.e. /dev/ttyO4). After this, ModemManager will retrieve the physical platform device (the serial port itself) which we can see is /devices/ocp.3/481a800.serial, and then check this for the ID_MM_PLATFORM_DRIVER_PROBE flag.

If instead the udev rule is changed to

ACTION=="add", KERNEL=="481a800.serial", ENV{ID_MM_DEVICE_PROCESS}="1"

then ModemManager will correctly see the flag on the parent device (note: ID_MM_PLATFORM_DRIVER_PROBE doesn't exist anymore).

# udevadm info /sys/devices/ocp.3/481a8000.serial
P: /devices/ocp.3/481a8000.serial
E: DEVPATH=/devices/ocp.3/481a8000.serial
E: DRIVER=omap_uart
E: ID_MM_PLATFORM_DRIVER_PROBE=1
E: MODALIAS=of:NserialT<NULL>Cti,omap3-uart
E: OF_COMPATIBLE_0=ti,omap3-uart
E: OF_COMPATIBLE_N=1
E: OF_FULLNAME=/ocp/serial@481a8000
E: OF_NAME=serial
E: SUBSYSTEM=platform
E: USEC_INITIALIZED=990701

The device now appears in mmcli -L and nmcli device status.

Answered by Chris Watts on November 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP