Help with ModemManager and modem on UART port

nabelekt-vl

New Member
Joined
Feb 25, 2025
Messages
4
Reaction score
0
Credits
50
I have a SARA-R52M10 cellular modem attached to a Raspberry Pi CM4 running Ubuntu 24.04 on UART3:
Code:
    root@GATEWAY-0x00000028:~# ll /dev/ttyAMA3
    crw-rw---- 1 root dialout 204, 67 Feb 25 01:21 /dev/ttyAMA3

I can get responses from it fine with
Code:
    screen /dev/ttyAMA3 115200
or by running
Code:
    stty -F /dev/ttyAMA3 115200 && cat /dev/ttyAMA3
in one terminal and
Code:
    echo -e "AT\r" > /dev/ttyAMA3
in another.

But I am trying to get ModemManager to talk to it, and I cannot.

I am running:
Code:
    echo 'ACTION!="add|change|move|bind", GOTO="mm_sara_r52m10_end"
    SUBSYSTEMS=="tty", DEVPATH=="/devices/platform/soc/fe201600.serial/fe201600.serial:0/fe201600.serial:0.0/tty/ttyAMA3"
    LABEL="mm_sara_r52m10_end"
    
    # Rule for ModemManager to handle the device on ttyAMA3
    ACTION=="add|change|move", SUBSYSTEM=="tty", KERNEL=="ttyAMA3", \
        ENV{ID_MM_DEVICE_PROCESS}="1", \
        ENV{ID_MM_TTY_BAUDRATE}="115200", \
        ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1", \
        ENV{ID_MM_TTY_FLOW_CONTROL}="rts-cts"
    ' > /etc/udev/rules.d/99-sara-r52m10.rules
    udevadm control --reload && udevadm trigger
    
    systemctl restart ModemManager
    mmcli --scan-modems
    mmcli --list-modems
and get
Code:
    successfully requested to scan devices
    No modems were found
And
Code:
    journalctl -u ModemManager --no-pager --since "$(systemctl show -p ActiveEnterTimestamp ModemManager | cut -d'=' -f2)"
shows:
Code:
    Feb 25 01:27:02 GATEWAY-0x00000028 systemd[1]: Starting ModemManager.service - Modem Manager...
    Feb 25 01:27:02 GATEWAY-0x00000028 ModemManager[1737]: <msg> ModemManager (version 1.23.4) starting in system bus...
    Feb 25 01:27:02 GATEWAY-0x00000028 systemd[1]: Started ModemManager.service - Modem Manager.
    Feb 25 01:27:09 GATEWAY-0x00000028 ModemManager[1737]: <msg> [base-manager] couldn't check support for device '/sys/devices/platform/scb/fd580000.ethernet': not supported by any plugin
    Feb 25 01:27:09 GATEWAY-0x00000028 ModemManager[1737]: <msg> [base-manager] couldn't check support for device '/sys/devices/platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1': not supported by any plugin
    Feb 25 01:27:18 GATEWAY-0x00000028 ModemManager[1737]: <msg> [device /sys/devices/platform/soc] creating modem with plugin 'generic' and '1' ports
    Feb 25 01:27:18 GATEWAY-0x00000028 ModemManager[1737]: <wrn> [plugin/generic] could not grab port ttyAMA3: Cannot add port 'tty/ttyAMA3', unhandled port type
    Feb 25 01:27:18 GATEWAY-0x00000028 ModemManager[1737]: <wrn> [base-manager] couldn't create modem for device '/sys/devices/platform/soc': Failed to find primary AT port
Do my rules look ok? I am pretty unconfident in them.

How can I resolve the issue shown in the last couple lines of that output and get ModemManager talking to my modem?

Any thoughts are appreciated. Thanks!
 


Wow, it's a looooonnnng time I've tried this.

Make sure you are using a version of ModemManager that supports your modem. Sometimes, newer versions include better support for various devices.

Your udev rules seem mostly correct, but you might want to ensure that the rules are being applied correctly. You can add some logging to verify this:
Code:
echo 'ACTION!="add|change|move|bind", GOTO="mm_sara_r52m10_end"
SUBSYSTEMS=="tty", DEVPATH=="/devices/platform/soc/fe201600.serial/fe201600.serial:0/fe201600.serial:0.0/tty/ttyAMA3"
LABEL="mm_sara_r52m10_end"

# Rule for ModemManager to handle the device on ttyAMA3
ACTION=="add|change|move", SUBSYSTEM=="tty", KERNEL=="ttyAMA3", \
    ENV{ID_MM_DEVICE_PROCESS}="1", \
    ENV{ID_MM_TTY_BAUDRATE}="115200", \
    ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1", \
    ENV{ID_MM_TTY_FLOW_CONTROL}="rts-cts", \
    RUN+="/usr/bin/logger -t udev 'ModemManager rule applied to ttyAMA3'"
' > /etc/udev/rules.d/99-sara-r52m10.rules
udevadm control --reload && udevadm trigger

You could also enable debug logging for ModemManager to get more detailed information:
Code:
sudo systemctl stop ModemManager
sudo ModemManager --debug
 
Thank you for your reply!

Code:
root@GATEWAY-0x00000028:~# ModemManager --version
ModemManager 1.23.4
Copyright (C) 2008-2023 The ModemManager authors
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Is there a particular distribution of ModemManager that I should have installed? The only list of supported modems that I have been able to find is https://www.freedesktop.org/wiki/Software/ModemManager/SupportedDevices/ which seems rather dated and does not include any u-blox modems.
Could the issue be simply that ModemManager doesn't support this modem? Wouldn't at least basic/common 'AT' commands work?
I do see some references to u-blox in the output below.

Where would you expect to see the ModemManager rule applied to ttyAMA3 output?

ModemManager --debug produces ~1600 lines of output, but I do see some related to ttyAMA3. With most other lines removed, here those are:
Code:
ModemManager[1383]: <dbg> [1740505518.810013] [ttyAMA3] port contents loaded:
ModemManager[1383]: <dbg> [1740505518.810160] [ttyAMA3]   bus: platform
ModemManager[1383]: <dbg> [1740505518.810201] [ttyAMA3]   device: /sys/devices/platform/soc
ModemManager[1383]: <dbg> [1740505518.810232] [ttyAMA3]   driver: port
ModemManager[1383]: <dbg> [1740505518.810266] [base-manager] adding port ttyAMA3 at sysfs path: /sys/devices/platform/soc/fe201600.serial/fe201600.serial:0/fe201600.serial:0.0/tty/ttyAMA3
ModemManager[1383]: <dbg> [1740505518.810331] [filter] (tty/ttyAMA3) port allowed: device is allowlisted
ModemManager[1383]: <dbg> [1740505518.810368] [base-manager] port ttyAMA3 is first in device /sys/devices/platform/soc
ModemManager[1383]: <dbg> [1740505518.810588] [plugin-manager] task 0: new support task for device: /sys/devices/platform/soc
ModemManager[1383]: <dbg> [1740505518.810781] [ttyAMA3/probe] port type hint detected in udev tag: ID_MM_PORT_TYPE_AT_PRIMARY
ModemManager[1383]: <dbg> [1740505518.810847] [ttyAMA3/probe] port type hints loaded: AT yes, QMI no, MBIM no, QCDM no, AUDIO no, GPS no
ModemManager[1383]: <dbg> [1740505518.810906] [plugin-manager] task 0: port grabbed: ttyAMA3
ModemManager[1383]: <dbg> [1740505518.810957] [plugin-manager] task 0,ttyAMA3: new support task for port
ModemManager[1383]: <dbg> [1740505518.810998] [plugin-manager] task 0,ttyAMA3: deferred until min wait time elapsed
ModemManager[1383]: <dbg> [1740505518.812958] [ttyS0] port contents loaded:
ModemManager[1383]: <dbg> [1740505520.812684] [plugin/broadmobi] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.812801] [plugin/thuraya] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.812892] [plugin/zte] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.813001] [plugin/intel] port ttyAMA3 filtered by subsystem
ModemManager[1383]: <dbg> [1740505520.813095] [plugin/anydata] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.813186] [plugin/option-hso] port ttyAMA3 filtered by drivers
ModemManager[1383]: <dbg> [1740505520.813280] [plugin/sierra] port ttyAMA3 filtered by drivers
ModemManager[1383]: <dbg> [1740505520.813367] [plugin/novatel] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.813462] [plugin/altair-lte] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.813553] [plugin/huawei] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.813676] [plugin/fibocom] port ttyAMA3 filtered by drivers
ModemManager[1383]: <dbg> [1740505520.813773] [plugin/wavecom] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.813869] [plugin/gosuncn] port ttyAMA3 filtered by drivers
ModemManager[1383]: <dbg> [1740505520.813957] [plugin/option] port ttyAMA3 filtered by drivers
ModemManager[1383]: <dbg> [1740505520.814049] [plugin/linktop] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.814147] [plugin/samsung] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.814235] [plugin/foxconn] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.814325] [plugin/novatel-lte] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.814433] [plugin/ericsson-mbm] port ttyAMA3 filtered by udev tags
ModemManager[1383]: <dbg> [1740505520.814533] [plugin/nokia-icera] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.814649] [plugin/mtk] port ttyAMA3 filtered by subsystem
ModemManager[1383]: <dbg> [1740505520.814750] [plugin/mtk-legacy] port ttyAMA3 filtered by udev tags
ModemManager[1383]: <dbg> [1740505520.814844] [plugin/simtech] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.814933] [plugin/motorola] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.815026] [plugin/tp-link] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.815137] [plugin/haier] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.815221] [plugin/qcom-soc] port ttyAMA3 filtered by subsystem
ModemManager[1383]: <dbg> [1740505520.815303] [plugin/d-link] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.815408] [plugin/x22x] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.815529] [plugin/dell] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.815661] [plugin/sierra-legacy] port ttyAMA3 filtered by drivers
ModemManager[1383]: <dbg> [1740505520.815752] [plugin/pantech] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.815851] [plugin/longcheer] port ttyAMA3 filtered by vendor/product IDs
ModemManager[1383]: <dbg> [1740505520.815950] [plugin-manager] task 0,ttyAMA3: found '8' plugins to try
ModemManager[1383]: <dbg> [1740505520.816047] [plugin-manager] task 0,ttyAMA3: will try with plugin 'nokia'
ModemManager[1383]: <dbg> [1740505520.816141] [plugin-manager] task 0,ttyAMA3: will try with plugin 'quectel'
ModemManager[1383]: <dbg> [1740505520.816230] [plugin-manager] task 0,ttyAMA3: will try with plugin 'iridium'
ModemManager[1383]: <dbg> [1740505520.816316] [plugin-manager] task 0,ttyAMA3: will try with plugin 'telit'
ModemManager[1383]: <dbg> [1740505520.816403] [plugin-manager] task 0,ttyAMA3: will try with plugin 'cinterion'
ModemManager[1383]: <dbg> [1740505520.816482] [plugin-manager] task 0,ttyAMA3: will try with plugin 'u-blox'
ModemManager[1383]: <dbg> [1740505520.816564] [plugin-manager] task 0,ttyAMA3: will try with plugin 'via'
ModemManager[1383]: <dbg> [1740505520.816681] [plugin-manager] task 0,ttyAMA3: will try with plugin 'generic'
ModemManager[1383]: <dbg> [1740505520.816785] [plugin-manager] task 0,ttyAMA3: started
ModemManager[1383]: <dbg> [1740505520.816871] [plugin-manager] task 0,ttyAMA3: checking with plugin 'nokia'
ModemManager[1383]: <dbg> [1740505520.817002] [plugin/nokia] probes required for port ttyAMA3: 'at, at-vendor, at-icera'
ModemManager[1383]: <dbg> [1740505520.817136] [ttyAMA3/probe] no QCDM/QMI/MBIM probing in possible AT port
ModemManager[1383]: <dbg> [1740505520.817228] [ttyAMA3/probe] port is not QCDM-capable
ModemManager[1383]: <dbg> [1740505520.817307] [ttyAMA3/probe] port is not QMI-capable
ModemManager[1383]: <dbg> [1740505520.817385] [ttyAMA3/probe] port is not MBIM-capable
ModemManager[1383]: <dbg> [1740505520.817472] [ttyAMA3/probe] launching port probing: 'at, at-vendor, at-icera'
ModemManager[1383]: <dbg> [1740505520.817680] [plugin-manager] task 0: extra probing time elapsed
ModemManager[1383]: <dbg> [1740505520.817783] [plugin-manager] task 0: still 1 running probes (1 active): ttyAMA3
ModemManager[1383]: <dbg> [1740505520.819110] [ttyAMA3/at] opening serial port...
ModemManager[1383]: <dbg> [1740505520.819396] [ttyAMA3/at] setting up baudrate: 115200
ModemManager[1383]: <dbg> [1740505520.819511] [ttyAMA3/at] flow control explicitly requested for device is: rts-cts
ModemManager[1383]: <dbg> [1740505520.819631] [ttyAMA3/at] enabling RTS/CTS flow control
ModemManager[1383]: <dbg> [1740505520.819826] [ttyAMA3/at] device open count is 1 (open)
ModemManager[1383]: <dbg> [1740505520.820076] [ttyAMA3/at] --> 'ATE1 E0<CR>'
ModemManager[1383]: <dbg> [1740505521.299754] [plugin-manager] task 1: min wait time elapsed
ModemManager[1383]: <dbg> [1740505522.813034] [plugin-manager] task 0: still 1 running probes (1 active): ttyAMA3
ModemManager[1383]: <dbg> [1740505523.300791] [plugin-manager] task 1: min probing time elapsed
ModemManager[1383]: <dbg> [1740505524.972459] [ttyAMA3/at] --> 'ATE1 E0<CR>'
ModemManager[1383]: <dbg> [1740505528.974460] [ttyAMA3/at] --> 'ATE1 E0<CR>'
ModemManager[1383]: <dbg> [1740505532.974253] [ttyAMA3/probe] port is not AT-capable
ModemManager[1383]: <dbg> [1740505532.974445] [plugin/nokia] port ttyAMA3 filtered by vendor strings
ModemManager[1383]: <dbg> [1740505532.974566] [plugin-manager] task 0,ttyAMA3: checking with plugin 'quectel'
ModemManager[1383]: <dbg> [1740505532.974790] [plugin/quectel] probes required for port ttyAMA3: 'at, at-vendor, qcdm'
ModemManager[1383]: <dbg> [1740505532.974913] [ttyAMA3/probe] no QCDM/QMI/MBIM probing in possible AT port
ModemManager[1383]: <dbg> [1740505532.974995] [ttyAMA3/probe] port is not QCDM-capable
ModemManager[1383]: <dbg> [1740505532.975073] [ttyAMA3/probe] port is not QMI-capable
ModemManager[1383]: <dbg> [1740505532.975152] [ttyAMA3/probe] port is not MBIM-capable
ModemManager[1383]: <dbg> [1740505532.975222] [ttyAMA3/probe] port probing finished: no more probings needed
ModemManager[1383]: <dbg> [1740505532.975374] [ttyAMA3/at] device open count is 0 (close)
ModemManager[1383]: <dbg> [1740505532.975477] [ttyAMA3/at] closing serial port...
ModemManager[1383]: <dbg> [1740505532.975688] [ttyAMA3/at] serial port closed
ModemManager[1383]: <dbg> [1740505532.975871] [ttyAMA3/at] forced to close port
ModemManager[1383]: <dbg> [1740505532.976057] [plugin/quectel] port ttyAMA3 filtered by vendor strings
ModemManager[1383]: <dbg> [1740505532.976163] [plugin-manager] task 0,ttyAMA3: checking with plugin 'iridium'
ModemManager[1383]: <dbg> [1740505532.976293] [plugin/iridium] probes required for port ttyAMA3: 'at, at-vendor, at-product'
ModemManager[1383]: <dbg> [1740505532.976397] [ttyAMA3/probe] no QCDM/QMI/MBIM probing in possible AT port
ModemManager[1383]: <dbg> [1740505532.976486] [ttyAMA3/probe] port is not QCDM-capable
ModemManager[1383]: <dbg> [1740505532.976579] [ttyAMA3/probe] port is not QMI-capable
ModemManager[1383]: <dbg> [1740505532.976793] [ttyAMA3/probe] port is not MBIM-capable
ModemManager[1383]: <dbg> [1740505532.976870] [ttyAMA3/probe] port probing finished: no more probings needed
ModemManager[1383]: <dbg> [1740505532.977062] [plugin/iridium] port ttyAMA3 filtered as no vendor/product strings given
ModemManager[1383]: <dbg> [1740505532.977169] [plugin-manager] task 0,ttyAMA3: checking with plugin 'telit'
ModemManager[1383]: <dbg> [1740505532.977302] [plugin/telit] probes required for port ttyAMA3: 'at, at-vendor, qcdm'
ModemManager[1383]: <dbg> [1740505532.977396] [ttyAMA3/probe] no QCDM/QMI/MBIM probing in possible AT port
ModemManager[1383]: <dbg> [1740505532.977478] [ttyAMA3/probe] port is not QCDM-capable
ModemManager[1383]: <dbg> [1740505532.977556] [ttyAMA3/probe] port is not QMI-capable
ModemManager[1383]: <dbg> [1740505532.977683] [ttyAMA3/probe] port is not MBIM-capable
ModemManager[1383]: <dbg> [1740505532.977766] [ttyAMA3/probe] port probing finished: no more probings needed
ModemManager[1383]: <dbg> [1740505532.977929] [plugin/telit] port ttyAMA3 filtered by vendor strings
ModemManager[1383]: <dbg> [1740505532.978028] [plugin-manager] task 0,ttyAMA3: checking with plugin 'cinterion'
ModemManager[1383]: <dbg> [1740505532.978139] [plugin/cinterion] probes required for port ttyAMA3: 'at, at-vendor'
ModemManager[1383]: <dbg> [1740505532.978234] [ttyAMA3/probe] no QCDM/QMI/MBIM probing in possible AT port
ModemManager[1383]: <dbg> [1740505532.978326] [ttyAMA3/probe] port is not QCDM-capable
ModemManager[1383]: <dbg> [1740505532.978411] [ttyAMA3/probe] port is not QMI-capable
ModemManager[1383]: <dbg> [1740505532.978487] [ttyAMA3/probe] port is not MBIM-capable
ModemManager[1383]: <dbg> [1740505532.978561] [ttyAMA3/probe] port probing finished: no more probings needed
ModemManager[1383]: <dbg> [1740505532.978757] [plugin/cinterion] port ttyAMA3 filtered by vendor strings
ModemManager[1383]: <dbg> [1740505532.978861] [plugin-manager] task 0,ttyAMA3: checking with plugin 'u-blox'
ModemManager[1383]: <dbg> [1740505532.978974] [plugin/u-blox] probes required for port ttyAMA3: 'at, at-vendor'
ModemManager[1383]: <dbg> [1740505532.979072] [ttyAMA3/probe] no QCDM/QMI/MBIM probing in possible AT port
ModemManager[1383]: <dbg> [1740505532.979156] [ttyAMA3/probe] port is not QCDM-capable
ModemManager[1383]: <dbg> [1740505532.979235] [ttyAMA3/probe] port is not QMI-capable
ModemManager[1383]: <dbg> [1740505532.979311] [ttyAMA3/probe] port is not MBIM-capable
ModemManager[1383]: <dbg> [1740505532.979393] [ttyAMA3/probe] port probing finished: no more probings needed
ModemManager[1383]: <dbg> [1740505532.979549] [plugin/u-blox] port ttyAMA3 filtered by vendor strings
ModemManager[1383]: <dbg> [1740505532.979675] [plugin-manager] task 0,ttyAMA3: checking with plugin 'via'
ModemManager[1383]: <dbg> [1740505532.979794] [plugin/via] probes required for port ttyAMA3: 'at, at-vendor, at-product, qcdm'
ModemManager[1383]: <dbg> [1740505532.979892] [ttyAMA3/probe] no QCDM/QMI/MBIM probing in possible AT port
ModemManager[1383]: <dbg> [1740505532.979986] [ttyAMA3/probe] port is not QCDM-capable
ModemManager[1383]: <dbg> [1740505532.980070] [ttyAMA3/probe] port is not QMI-capable
ModemManager[1383]: <dbg> [1740505532.980146] [ttyAMA3/probe] port is not MBIM-capable
ModemManager[1383]: <dbg> [1740505532.980221] [ttyAMA3/probe] port probing finished: no more probings needed
ModemManager[1383]: <dbg> [1740505532.980382] [plugin/via] port ttyAMA3 filtered as no vendor/product strings given
ModemManager[1383]: <dbg> [1740505532.980483] [plugin-manager] task 0,ttyAMA3: checking with plugin 'generic'
ModemManager[1383]: <dbg> [1740505532.980591] [plugin/generic] probes required for port ttyAMA3: 'at, qcdm'
ModemManager[1383]: <dbg> [1740505532.980725] [ttyAMA3/probe] no QCDM/QMI/MBIM probing in possible AT port
ModemManager[1383]: <dbg> [1740505532.980807] [ttyAMA3/probe] port is not QCDM-capable
ModemManager[1383]: <dbg> [1740505532.980885] [ttyAMA3/probe] port is not QMI-capable
ModemManager[1383]: <dbg> [1740505532.980967] [ttyAMA3/probe] port is not MBIM-capable
ModemManager[1383]: <dbg> [1740505532.981043] [ttyAMA3/probe] port probing finished: no more probings needed
ModemManager[1383]: <dbg> [1740505532.981214] [plugin-manager] task 0,ttyAMA3: found best plugin for port (generic)
ModemManager[1383]: <dbg> [1740505532.981305] [plugin-manager] task 0,ttyAMA3: finished in '14.170347' seconds
ModemManager[1383]: <dbg> [1740505532.981427] [plugin-manager] task 0: no more ports to probe
ModemManager[1383]: <wrn> [1740505532.987021] [plugin/generic] could not grab port ttyAMA3: Cannot add port 'tty/ttyAMA3', unhandled port type
ModemManager[1383]: <dbg> [1740505532.987224] [modem0] completely disposed
With that going, if I then also run mmcli --list-modems, I also see
Code:
ModemManager[1383]: <wrn> [1740505955.977483] [base-manager] couldn't create modem for device '/sys/devices/platform/soc': Failed to find primary AT port
as the journal output showed.

What does 'port ttyAMA3 filtered by vendor strings' mean?
 


Members online


Latest posts

Top