SIM hot swapping - what is the expected behavior?

Aleksander Morgado aleksander at
Tue Sep 25 09:13:17 UTC 2018

> I have a dual SIM hardware setup with a MC7430 in QMI mode where both SIMs are attached to the SIM 1 & SIM 2 pins on the modem.  I do not have any ability to switch SIMs using GPIO or anything in between.
> I have been playing with modem manager to switch the SIMs using the —command parameter like so:
> —command=AT!UIMS=n where n can be 1 or 0, as I have only 2 SIMs.
> The issue I am facing and what my question is about is this:
> When I issue the AT!UIMS=n command, and check it with AT!UIMS? the SIM index seems to switch immediately, but it appears to me that I have to restart modemmanager to use the SIM. (Do I?).  I don’t actually have to reset the modem, I have checked.  The strange part follows: if I then try to enable the modem with -e, modem manager loses the modem until I restart modem manager.   I have waited up to 5 minutes to see if modem manager finds the modem again but it will not.
> I’m happy to script this activity, but I would like to get some clarification as to what the expected behavior is in case I am doing it wrong.  Perhaps if I switch it to MBIM mode?  Is there any way to get the SIM to show up as a SIM object with an index number in mmcli with this setup?

I don't think there is any SIM hotswap support for QMI modems yet, if
I'm not mistaken.

Is AT!UIMS=n a Sierra-specific command? What does "AT!UIMS=?" return?

We do have some support for MBIM modems, though, and we can detect the
SIM going away and a new SIM coming back, and in that case the effect
will be:
 * The modem and sim objects go away.
 * A new modem with a new sim object appears.
This is, for SIM hotswap events, not only the SIM object is
re-created, the whole modem object is recreated (just the MM object,
no modem reset involved!).

While the SIM hotswap support we currently have for different modem
types is defined to detect e.g. the user extracting the SIM and
inserting it again, the same logic can be used to detect SIM slot
selection changes like the one you're testing. But we don't have any
API in MM to trigger the SIM slot selection right now (we could add
new APIs)


More information about the ModemManager-devel mailing list