mmdbus: improve eSIM detection using EID and handle missing slot paths#5697
Open
milan-zededa wants to merge 1 commit intolf-edge:masterfrom
Open
mmdbus: improve eSIM detection using EID and handle missing slot paths#5697milan-zededa wants to merge 1 commit intolf-edge:masterfrom
milan-zededa wants to merge 1 commit intolf-edge:masterfrom
Conversation
Without proper eSIM detection, EVE cannot identify that the active slot is an eSIM and remains stuck on the unsupported eSIM slot instead of automatically switching to a physical SIM slot. ModemManager often fails to report SIM slot types (SIMPropertyType returns "unknown"/unspecified), making it impossible to distinguish eSIM from physical SIM. Improve detection by querying the EID (eUICC Identifier) — only eSIM chips carry one, so its presence reliably identifies an eSIM. Additionally, ModemPropertySIMSlots returns empty D-Bus paths for slots with no SIM or no active eSIM profile. For the currently active slot, fall back to ModemPropertySIM which often still provides a valid object even when the slot array entry is empty. Unify SIM presence detection for unknown and physical SIM types: use the slot array path (hasSlotPath) as the common presence indicator instead of checking ICCID for unknown types separately. In preferPhysSimOverESim, prefer a confirmed physical slot over an unspecified-type candidate. When the active slot is a detected eSIM, it is very unlikely for a modem to have multiple eUICCs, so the remaining slots with unknown type are almost certainly physical — but only used as a fallback. Signed-off-by: Milan Lenco <milan@zededa.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5697 +/- ##
==========================================
+ Coverage 19.52% 29.45% +9.92%
==========================================
Files 19 18 -1
Lines 3021 2417 -604
==========================================
+ Hits 590 712 +122
+ Misses 2310 1554 -756
- Partials 121 151 +30 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Without proper eSIM detection, EVE cannot identify that the active slot is an eSIM and remains stuck on the unsupported eSIM slot instead of automatically switching to a physical SIM slot.
ModemManager often fails to report SIM slot types (
SIMPropertyTypereturnsunspecified), making it impossible to distinguish eSIM from physical SIM. Improve detection by querying the EID (eUICC Identifier) -- only eSIM chips carry one, so its presence reliably identifies an eSIM.Additionally,
ModemPropertySIMSlotsreturns empty D-Bus paths for slots with no SIM or no active eSIM profile. For the currently active slot, fall back toModemPropertySIMwhich often still provides a valid object even when the slot array entry is empty.Unify SIM presence detection for unknown and physical SIM types: use the slot array path (
hasSlotPath) as the common presence indicator instead of checking ICCID for unknown types separately.In
preferPhysSimOverESim, prefer a confirmed physical slot over an unspecified-type candidate. When the active slot is a detected eSIM, it is very unlikely for a modem to have multiple eUICCs, so the remaining slots with unknown type are almost certainly physical -- but only used as a fallback.How to test and validate this PR
Onboard device with a cellular modem that has both an eSIM (eUICC) and a physical SIM slot.
At first, do not attach any network configuration to the cellular modem.
SSH into the node, enter the
wwancontainer and intentionally set the eSIM slot as active:Next, attach proper network configuration to the cellular adapter and after a while confirm that EVE automatically
changed active SIM slot back to the physical one. Use
mmcli -m <modem-index>and check theSIMsection (look for(active)flag).EVE will also log a message informing about this automatic SIM slot switch:
Changelog notes
Improved eSIM detection: query EID (eUICC Identifier) to reliably identify eSIM slots when ModemManager reports SIM type as
unspecified. Without this, EVE could not recognize the active slot as eSIM and remained stuck on the unsupported eSIM slot instead of automatically switching to a physical SIM.PR Backports
Checklist