Re: How to save pin number and auto-connect on startup?



On Thu, 2010-10-21 at 19:53 +0200, Marcel Holtmann wrote:
> Hi Dan,
> 
> > > >> can you please explain why the PIN is needed before dialling the connection.
> > > >> Which functionality needs the PIN?
> > > > 
> > > > Many things:
> > > > 
> > > > 1) registration status
> > > > 2) signal strength
> > > > 3) access technology status
> > > > 4) SMS
> > > > 5) location-based services
> > > > 6) IMEI/IMSI (often)
> > > > 
> > > > On most "consumer" modems that I have in my possession (see [1]; some
> > > > are more functional than others) you are unable to do much of anything
> > > > beyond AT+GCAP or ATI before entering the PIN.  All other commands
> > > > return ERROR.  Most consumer modems have a "limited" AT command parser
> > > > that is used until the SIM is unlocked, at which point the full AT
> > > > command parser is available.  Until the PIN is entered the modem is
> > > > effectively unusable.
> > > 
> > > Ok.
> > > 
> > > > Without entering the PIN before connecting, you have no indication if
> > > > the device has any signal, whether you're roaming, etc.  So most of the
> > > > time you *do* want to unlock the device long before actually dialing up
> > > > the connection, if only to make sure you're not roaming so you don't get
> > > > charged $$$ the second you connect.
> > > 
> > > Ok. I'm normally only in my home country (Germany) where you have no roaming
> > > between the available/local networks/providers. So you have only the chance to
> > > connect to *your* provider. Too (to my knowledge) here in germany there is no
> > > difference (by now/in the way you get charged) if you connect via GSM/UMTS or
> > > something different.
> > > 
> > > When I need access to the internet, I try do dial, if I have a signal: fine
> > > (with high/fast signal: even better), if not: :-(
> > > Currently I only use the modem to dial/connect when I need to. I don't use SMS,
> > > GPS or anything else.
> > > Only 1/3 of the times I boot/resume, I want to use the modem/connect to the
> > > internet via ModemManager, but as my modem doesn't go to S3 atm, the dialog with
> > > PIN request is shown every boot/resume.
> > > 
> > > > What I think we'll end up doing here is probably some combination of
> > > > "best effort" (ie, if we can get the IMSI we use that to identify the
> > > > SIM), maybe fall back to IMEI or USB IDs, and finally just have a
> > > > "Always ask me later" checkbox in the initial PIN dialog that suppresses
> > > > the initial dialog based on USB IDs or such.
> > > 
> > > So as you can see in my comments above, I only need to unlock the modem in the
> > > moment I want to connect via ModemManager (independent of signal strength,
> > > roaming, access technology). So if you would add those features like "Always ask
> > > me later" or "best effort" would be very cool and a big timesaver (at least for
> > > me) because there where no more annoying popups which asks for the PIN even I
> > > don't want to use the Modem.
> > 
> > I went through all my 3G cards yesterday morning and built up a
> > spreadsheet of what identifying information we can get before the PIN is
> > unlocked.  Remember, the PIN is specific to the *SIM* itself, not to the
> > phone.
> > 
> > The result is that no modem allows access to the IMSI (the SIM's unique
> > ID) before the PIN is entered, which is expected, though unfortunate.
> > Most modems allow access to the IMEI of the card with the exception of
> > some ZTE, Ericsson, and Huawei devices.
> > 
> > With a combination of AT+GSN, ATI, AT+GMR, and AT+GMM, we should be able
> > to build up a "device identifier" in ModemManager that NM/nm-applet can
> > use to save the PIN, retrieve the PIN using that ID, and automatically
> > unlock the device when it's plugged in.
> > 
> > The downside of this is that you'll need to re-enter your PIN if you
> > move the SIM card between devices, or if you flash the firmware of your
> > device.  But I think that's rare enough that it's acceptable.  Does that
> > sound like an acceptable approach?
> 
> I think this is the wrong approach. You mentioned yourself that the PIN
> is bound to the SIM. And unless you base this of the ICCID you should
> not be allowing storing of a PIN based on modem specific features. The
> only exception would be if the SIM card is physically integrated into
> the device. However this is only done for M2M devices anyway and not for
> normal desktop devices.

Unfortunately the ICCID is only available before PIN entry on some
devices (Sierra, Option, Longcheer).  All others (Huawei, ZTE, Ericsson,
Novatel) have no method of retrieving any identifying information about
the SIM before unlocking it.

So we *can* tie the automatic unlock to the SIM in some cases, but
clearly not all.

> Keep in mind that if entering the PIN wrongly you potentially have to
> then also deal with the PUK. Not everybody has the PUK remembered or
> quickly available. So potentially you can render a modem broken. Even if
> it is might be for a limited period of time, it is still something you
> don't wanna burden the user with.

Obviously.  And that's why NM/MM would only attempt to enter the PIN
once, and if that failed, explicitly as the user for the actual PIN
before continuing.  Furthermore, users could certainly opt-out of the
automatic unlocking and continue to manually enter the PIN themselves,
or disable the PIN entirely.

> And the PIN is meant to be entered by the user. It is not meant to be
> entered automatically. If you want that, then disable the PIN all
> together.

Yes, PINs are meant to be entered by the user.  But I've had many, many
requests to enter the PIN code automatically and this is a case of
listening to user complaints and then trying to adequately resolve them.
I've tried to tell users to disable their PIN, but users often don't
want to do that if they swap the SIM around between mobiles and data
sticks.  Which is understandable.

Part of the problem is that we need to enter the PIN so we can enable
the modem and retrieve signal quality, roaming status, do SMS stuff, and
get operator names, and you don't always want to start a packet data
session (and thus spend $$) to do any of that.  The PIN isn't associated
in any way with the data connection details, so storing the PIN along
with the APN, PPP username/password, etc isn't the right thing to do...
it's orthogonal to that.

Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]