Entering the PIN for USB UMTS Modems on OS X

From time to time I have to use my UMTS modem (a Huawei e270) to connect to the internet. It does not occur often but when I need it it has to work. For this reason I purchased a license for Novamedia's launch2net some years ago. Sadly their DRM is somewhat restrictive and you may use your license on only one Mac. And as I sold my old mac book this summer and forgot to unregister it with Novamedia's DRM servers I could not use my license on my new MBP this weekend. E-Mail support tends to be slow on weekends so I had to come up with a way to use my modem without launch2net.


Huawei offers OS X 10.6 drivers and they work flawlessly - if your SIM card does not use PIN authentication. Sadly (or luckily) my SIM is protected by such a PIN. So using the OS X network dialog to connect through my Huawei e270 won't work as the connection scripts don't offer any PIN-entry dialog.

But you can authenticate manually before dialing out. In theory you just need a terminal emulation app like ZTerm or Minicom to send your modem the AT+CPIN=yourpin\r command. After sending this command (if you sent the correct PIN) you can use the OS X network dialog to dial out to your ISP. (CMDA/UMTS/GPRS/EDGE does not matter - it works for all network types your modem supports.)

So do you really have to install Minicom just for this?
No. You can use the 'screen' shell utility to connect to your modem. It's simple. You just need the name of your modem's device in /dev. It most likely starts with "cu.". For my Huawei e270 it's /dev/cu.Huawei-Modem - so here is what I have to do to send it the PIN:

1. Start the Terminal.app
2. enter:screen /dev/cu.Huawei-Modem 7200
3. type AT (followed by enter) to see if the modem responds. It should answer with 'OK'.
4. Now type: (followed by enter)
AT+CPIN=YOURPIN
Note: You can not use BACKSPACE to correct what you have typed. So watch out that you don't enter the wrong PIN 3 times. (My SIM will get locked after 3 wrong PINs and I will have to unlock it using the PUK code. Depending on your Carrier this may be troublesome.)
5. If you have entered the correct PIN your modem should answer with "OK". Otherwise you will get a more or less clear ERROR statement. My modem will stop flashing it's LED twice and will flash now only one. In addition it will change the LED's color to blue to indicate that it's checked into the carrier's network.
6. Now you have to exit the screen utility - otherwise your modem will stay locked for any other app. (Don't close the terminal window! It will not kill the screen process!.) To exit you will have to type the following:
CTRL + a
CTRL + \
y

7. Now you can use the standard OS X network dialog to connect to the internet.

So this is somewhat complicated but it works.

Oh, and you could use my KingPIN app that does exactly this for you :)

King Pin Screenshot