Skip to content

ModemManager: read 5G SA registration reported with two-digit AcT - #12

Merged
pjeweb merged 3 commits into
osb/release/v1.4.0-osb1from
osb/pr/creg-two-digit-act
Nov 25, 2026
Merged

pjeweb merged 3 commits into
osb/release/v1.4.0-osb1from
osb/pr/creg-two-digit-act

Conversation

@pjeweb

@pjeweb pjeweb commented Nov 25, 2026 •

Copy link
Copy Markdown

This makes ModemManager read a 5G standalone registration that the FM350-GL reports in +CREG, +CGREG and +CEREG. Today, when the module registers on NR after ModemManager's first registration check (for example after a replug), ModemManager keeps showing searching and never connects until someone runs mmcli -m <n> --3gpp-register-home by hand.

What it adds:

  • Patch 0004 for ModemManager 1.24.2: the six +CREG/+CGREG/+CEREG patterns that capture an AcT field accept the 27.007 values 10 to 13 (5G core and NR), unpadded, where the line has no competing reading, and nothing else new. The +CREG/+CGREG <lac> is read as a TAC on NR.
  • Tests in src/tests/test-modem-helpers.c with the module's line layouts, two replayed sequences (searching then registered by polling, and by URCs only), and five layouts a looser pattern misreads. Each runs in forward order and in the reverse order the AT port tries URC handlers.
  • A static check in ci/test-fm350-patch-contract.sh that keeps the patch in the series, and doc updates (ADR section 2.4, a release-line waiver in POLICY, packaging README, suite adaptations).

How: the module answers +CEREG: 2,2,"FFFF","0FFFFFFF",0 while searching and +CEREG: 2,1,"<tac>","<nr cell id>",11 once registered. ModemManager's patterns only take one AcT digit, so the searching lines parse and the registered ones match nothing, URCs included. Only 10 to 13 are added, and only where the line can't also be read in another layout. The AT port tries URC patterns in reverse order and responses in forward order, so otherwise a padded <stat>, a two-digit cell id or an unquoted RAC can pass for an AcT. In patterns 5, 9 and 10 the field after <stat> must not be a padded digit, and in pattern 7 the cell id must not be 0 to 13. Periodic registration checks only run when unsolicited reports can't be enabled, so nothing polls again and the state stays at searching. The solicited +CGREG with its trailing RAC happens to fall through to a six-field pattern that takes any AcT, which is why one manual register request fixes it. The fix is in the generic parser rather than the plugin because any modem that reports AcT 10 to 13 there hits the same thing, and upstream main has the same one-digit patterns.

Validation and limits
  • ModemManager 1.24.2 with the full series (0001 to 0004) applied with patch -p1 to the pinned orig tarball (sha256 matches upstream-pins.yaml): build, meson test 30 of 30 suites pass, test-modem-helpers 214 of 214.
  • The new tests discriminate: on plain 1.24.2 the FM350 and replay tests fail and the collision test passes; with an open-ended [0-9]+ AcT (the first version of this PR) the collision test fails; with this version all pass.
  • The strings in the 1.24.2 helper tests plus about 52,000 generated +CREG/+CGREG/+CEREG lines (padded and unpadded fields, 4 to 6 fields), each parsed as response and as URC in both orders (206,552 parses): no line that parsed before changes its result, the order-dependent lines are the same set as before, and every newly parsed line carries an unpadded 10 to 13.
  • packaging/ci/contract.sh in debian:trixie: passes. The contract check fails when the series line is dropped or a pattern loses the 10 to 13 capture or takes an open-ended number.
  • Two independent review rounds; the findings of both are addressed in this head.
  • Recorded lines come from the module on firmware 81600.0000.00.29.18.01; TAC and cell id values in the tests are synthetic. No URC from this module was captured, so the URC sequence is built from the recorded answers in their 27.007 unsolicited form; the parser defect is confirmed, the field timeline is inferred.
  • +C5GREG stays unused for this module: 1.24.2 enables only +CREG/+CGREG/+CEREG reports, and the module lists no 5G mode in AT+WS46=?. The firmware mirrors 5GS registration into the legacy reports, so that's not needed for this fix.
  • Not run on hardware yet. No package version or image pin changes here; a +osb rebuild comes after review.
  • Not offered to upstream ModemManager or CERALIVE yet.

After a replug on a 5G SA network the FM350-GL registered on NR, but
ModemManager stayed at 'searching' until the registration was polled by
hand. The module reports 5GS registration through +CREG/+CGREG/+CEREG
with AcT 11, and every one of ModemManager's patterns that captures an
AcT field accepts one digit only. The searching answers (AcT 0) parse,
the registered ones match nothing, the URCs are dropped, and no periodic
registration check runs while unsolicited reports are enabled.

Patch 0004 accepts one or more digits there and adds replay tests that
fail without it. The same change applies to upstream main, where it is
not filed yet. The docs record it as a fork carry next to the FM350-GL
series, and the static patch contract keeps it in the series.
@pjeweb pjeweb added the upstream: waits for intent Needs an issue or maintainer agreement before an upstream proposal. label Nov 25, 2026
Accepting any number of AcT digits let a padded cell id or an unquoted
RAC pass for an AcT. "+CGREG: 2,05,000B,0011,3" as a URC and
"+CGREG: 1,0005,2816,3,11" as a response then changed state and access
technology, depending on which pattern the AT port tried first.

Patch 0004 now accepts only the unpadded values 10 to 13, and pattern 7
takes a two-digit AcT only after an unpadded <stat>. The tests run each
line in forward order and in the reverse order the AT port tries URC
handlers, and cover both layouts. The +CREG/+CGREG <lac> is read as a
TAC on NR, so the three reports agree on the location.

The patch header uses a plain "Forwarded: no". POLICY records the
release-line waiver in both sections, and the ADR says which parts of
the field diagnosis are inferred.
A padded <stat> still let a two-digit field pass for an AcT:
"+CGREG: 2,05,000B,11,3" as a URC read the cell id as AcT 11, and
"+CEREG: 2,01,"1F00",...,11" read the padded <stat> as a TAC.

In patterns 5, 9 and 10 the field after <stat> must now not be a
(padded) digit, and in pattern 7 the <ci> must not be a value 0 to 13;
pattern 7 accepts a padded <stat> again. Both lines are in the collision
test. Over the existing test strings and a generated set of about 52,000
+CREG/+CGREG/+CEREG lines, parsed as response and as URC in both orders,
no line that parsed before changes its result.

The ADR now says the registration is re-read only by event-driven
checks, of which a registration attempt and the location check are two.
@pjeweb
pjeweb merged commit e12cc07 into osb/release/v1.4.0-osb1 Nov 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream: waits for intent Needs an issue or maintainer agreement before an upstream proposal.

Development

Successfully merging this pull request may close these issues.

1 participant