> > > > > > Runs into a timeout and still manages to unlock the SIM-Card. > > > > Afterwards the state changes from “locked” to “registered”. > > > > Hi, I think you are hitting the same issue as I am: > > > https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/919 > > > Looking at that log, I think the issue there is that before the SIM is > unlocked MM cannot read the IMSI. > > Then when the SIM is unlocked that triggers the Quectel plugin SIM > hotswap logic due to the AT+QUSIM URC. That causes MM to re-read the > ICCID and IMSI to figure out if the SIM has been swapped. > > Since the SIM is unlocked now MM can read the IMSI which is a change > from before. That causes the hotswap logic to trigger, which tears down > the modem and recreates it. That cancels running operations like the > SIM PIN entry because of how teardown works. > > Perhaps MM should be more selective in how it decides the SIM has been > swapped. For example, if the modem is in the "locked" state and the > IMSI changes from NULL -> [something valid] but the ICCID hasn't > changed, we probably didn't have a SIM swap. > > I agree with that, and I'm not sure if that's the current approach in git main or not.
> But that might not cover cases like ejecting the SIM, changing the IMSI > in a SIM programmer, and re-inserting. Or OTA reprogramming. Not sure > if that's a valid use-case or not. > > Aleksander, any thoughts here? > > I would definitely test with git main. I know several improvements were done in that specific area in the past years; 1.20.4 is relatively old.