On Wed, 2024-12-11 at 09:59 +0100, Robert Marko wrote: > On Wed, Dec 11, 2024 at 9:45 AM Aleksander Morgado > <aleksande...@chromium.org> wrote: > > > > Hey Dominik, > > > > > > > > I am currently trying to unlock my Quectel RM520N-GL on Linux > > > Debian with the ModemManager (Version 1.20.4). > > > > > > > > > > > > mmcli -i any --pin=<SIMPIN> > > > > > > > > error: couldn't send PIN code to the SIM: 'Timeout was > > > > > reached' > > > > > > > > > > > > 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. 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? Dan > > Regards, > Robert > > > > > > > > > > > > Please run MM with debug logs (use "mmcli -G DEBUG" or follow > > https://modemmanager.org/docs/modemmanager/debugging/), as that > > will give us much more information about the specific sequence in > > place here. > > > > -- > > Aleksander > > >