Sim added / extracted not detected

Aleksander Morgado aleksander at aleksander.es
Thu Oct 17 13:21:33 UTC 2019


Hey,

> >>> >> I am developing an application which makes use of the libmm-glib high level API and I have been making some tests and I have not been able to detect when a SIM is added or removed (I know its not very common to >>add/extract it on runtime but I want to be aware of this in my app).
> >>> >>
> >>>
> >>> >What modem are you using? We don't support SIM hotplug events on every
> >>> > device out there. If I'm not mistaken, it's only available/enabled for
> >>> > Telit and all MBIM based devices for now.
> >>
> >>
> >>   At the moment I am trying to achieve this with a EM7455 Sierra Wireless modem.
> >>
> >>
> >
> >Is the modem being managed in MBIM or QMI mode? If you switch the
> >modem to MBIM mode, you may get SIM hotswap supported.
> >
> >E.g. in my case my MC7455 is in AT+QMI mode:
> >
> >$ sudo qmicli -d /dev/cdc-wdm1 -p --dms-swi-get-usb-composition
> >[/dev/cdc-wdm1] Successfully retrieved USB compositions:
> >    [*] USB composition 6: DM, NMEA, AT, QMI
> >        USB composition 8: DM, NMEA, AT, MBIM
> >        USB composition 9: MBIM
> >
> >And I can switch it to AT+MBIM like this:
> >$ sudo qmicli -d /dev/cdc-wdm1 -p --dms-swi-set-usb-composition=8
> >$ sudo qmicli -d /dev/cdc-wdm1 -p --dms-set-operating-mode=offline
> >$ sudo qmicli -d /dev/cdc-wdm1 -p --dms-set-operating-mode=reset
>
> It seems like it was not a hardware related problem apparently but it was due to the hotswap support , which does not seem to exist in QMI mode as you stated before.
> I tried switching my modem to MBIM mode and it worked. Now it is possible to guess when sim is added/removed while using the device .As you mentioned ,the modemmanager removes the modem from the list and creates another modem with sim-missing and modem failed state.
>
> However, now I am not able to retrieve a valid ip for my modem and  I would like to ask you the following : how shall I connect my modem now ? Previously I launched DHCP after the modem manager reported "connected" state , but now it returns a timeout. I found this old post which may cover this issue : https://lists.freedesktop.org/archives/libmbim-devel/2015-May/000557.html . Shall I assign the IP to the interface manually now ? Is it enough with the following commands ?
>

The way to connect the network interface is specified by ModemManager
in the "bearer object information" that you get once you get the modem
connected. There are 3 possible setups reported: see
https://www.freedesktop.org/software/ModemManager/api/latest/ModemManager-Flags-and-Enumerations.html#MMBearerIpMethod
In your case, for MBIM modems we will always suggest using static IP
addressing, because not all modems out there implement a DHCP server
internally.


> ifconfig <interface_name> <ip>
>
> ifconfig <interface_name> up
>

These are not enough. You need to configure all settings provided in
the "bearer object information", including: address, prefix, gateway,
MTU and if needed also DNS.
See https://www.freedesktop.org/software/ModemManager/api/latest/gdbus-org.freedesktop.ModemManager1.Bearer.html#gdbus-property-org-freedesktop-ModemManager1-Bearer.Ip4Config

>
> Will I find any other "differences" related to the connection or other elements when operating under QMI mode or MBIM mode ?
>

If you look at the settings provided in the bearer after connection
the MBIM modem or the QMI modem, it should have said the same thing,
both should have suggested static IP addressing instead of DHCP,
assuming your EM7455 was running using raw-ip link layer protocol
instead of 802.3, which is definitely the case. We only suggest DHCP
for QMI modems when the link layer protocol is 802.3 because that is
what most DHCP clients support. So really, you shouldn't have seen any
more differences, at least connection wise.

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list