Wednesday, December 06, 2006

Option Globetrotter GPRS/EDGE/WiFi (Combo) modem in Linux


First a brief, well not-so-brief, rant.

I recently moved back to Kenya to very miserable Internet conditions. Actually, not miserable, simply disatrously unbearable. The costs of Internet access in this country are triple what I used to pay in Canada with the added misery of poor speed and intermittent connections. There's no such thing as a stable connection in this part of the world with any provider.

Most people here use dial-up Internet. Something I last saw in the mid-nineties. The last time I spoke to an Internet Service Provider in Canada I was complaining about not getting the 2 MBit speed that they were promising. I was benchmarking my performance religeously. Now, I'm very happy for a stable connection that will last more than an hour at anything close to 100 KBits!

My ISP is Safaricom. The largest mobile subscriber in Kenya. They made a profit of over 12 billion Kenya Shillings (roughly $200,000,000 CAD at current exchange rates $1 = KShs 60) this year (2006). Kenyans are phone and text message crazy. For a poor country, Kenyans spend a lot of money talking on phones. I don't have the statistics, but I'm sure the average Kenyan will spend at least 2,000 shillings ($33) per month on their pre-paid phone service. This, in a country where the average person (excluding farm workers) lives on about $1,000 per year. It's blatingly unfair for the developed countries to take advantage of such an obvious weakness. It's tantamount to a fee for breathing.

In any case, Safaricom doesn't gouge too badly. To get a relatively usable connection, and I say usable loosely, you need to cough up roughly 10,000 shillings a month. Say $170 bucks for comparison. This connection may give you 64 Kbps or 128 Kbps depending on the ISP, the time of year, the mood of the salesperson and the stock price of Kenya Breweries. Safaricom uses it's GPRS/GSM network to provide wireless connectivity. Naturally, depending on where you are, you will get different access speeds, but in the best of places, you might get better than 64Kbps. The specs on the access card are great I guess it's Safaricom's network that's jammed. The fact that it's wireless is great. This means that you can take your laptop on the road and work quietly in the open fields. Other ISP's have the odassity to ask for 20,000 shillings a month, or 30,000 shillings for 128 Kbps. There's even one (who will remain nameless) that I called and told me that their dedicated line access, for up to 128 Kbps was 56,000 shillings a month. Can you believe that. I had to ask twice since I thought that I had misheard. But nope. I heard right. They went on to let me know that most of their clients are corporate who have demanding uptime requirements so they have a 99.5% uptime guarantee. I suspect though, if you read in between the lines of the Service Level Agreement (SLA), you'll find that they are "not responsible for incidents beyond their control, like 'lack of electricity,' or 'third-party technical failure,' or 'shifting of the polar ice cap.'" An SLA in this country is a joke!

Anyways, I have an Option EDGE/GPRS/GSM/WLAN Combo Card of the Globetrotter family. You can check out it's specifications at: http://www.option.com/products/edge_spec.shtml. If your laptop has a free PCMCIA slot, then this is a great card. One thing you'll notice, and this should come as no surprise to the Linux folk, is that the manufacturer only supports Windows. There are some "press releases" about Linux, but you'll have to register your card (assuming you got it directly from Option) and ask their technical support crew for the Linux scripts.

But we who live in the Linux world walk dangerously. We fear no hardware manufacturer. No obscurely constructed microcode is a challenge. No statement from the Iron Tower of money (I believe they live in Redmond) will deter us from doing what we want.

And what we really want to do is surf wirelessly with this card.

Now that the rant's over, here's what I did to get my Linux box to work with this card.

I had to install Windows XP to check out the card since there's very little documentation out there on how to set up the serial card. To the discredit of Linux and it's prophets, so much writing about Linux is terribly unreadable. Even the simplest discussions on how to install it start very promising but soon plunge into the world of technobabble, leaving many who would otherwise try it running back to the warm womb of that other bloated software. I checked out a number of sites. The most promising one on this card is: http://www.pharscape.org/. There's a forum there on this card specifically but it seems that most people have been able to get the card to work, but nobody has really documented it properly. It also seems, and this is typical of Linux users, that everyone has very different problems. One person will be able to install it on their RedHat installation without any problems. Another person will fail at installation. A third will install, but the card will hang after five minutes. And so on.

My luck with this card finally came to fruition when I ran into a script/program called "comgt." It used to be called "gcom." Using that script, together with bits and pieces of advice from the forum and the Internet, I have a card that's relatively stable. It hangs from time to time, very sporadically, but I have been able to use it on very many occasions for more than 2 hours. I haven't tested over 2 hours, but even in Windows, from time to time, I found that it would hang and I would have to disconnect. I believe that the configuration that I have right now is stable enough for publishing!

My laptop is:

IBM ThinkPad T20
Pentium III, 700 Mhz, 512 MB RAM, 40 GB
CD-RW/DVD combo drive

Fedora Core 5
Linux kernel 2.6.15
KDE 3.5.1
gcc 4.1.0

Connecting is a THREE stage process. I use three programs to make the connection. They are:

  • minicom (communications program)

  • comgt (Globetrotter communications program)

  • Kppp (KDE's ppp configurator/dialer)


That's all you need. And you'll fire them up and use them in that sequence.

Special Note: If you don't know where your globetrotter device is, see the end of this document. You'll need to know where it is!

For the rest of these steps, I'll assume that the globetrotter modem is a serial modem at /dev/ttyS1. That's actually my configuration.

minicom
Firstly, there's a problem with the Globetrotter card working at high speeds, i.e., 100,000. It can, but it needs a fix. So the first step is to fire up minicom and run a simple command. Start minicom with the following command:

minicom /dev/ttyS1

You may get some warnings/errors when minicom launches. They are safe to ignore. Then type in the following:

AT+CFUN=1

You'll get a message saying that the request was completed successfully. On my machine, the following message is displayed:

*MRDY: 4
OK

Now, quit minicom WITHOUT resetting the modem. To do this in minicom, you have to click on the following key sequences.

Ctrl+A, Q

Now onto the next step...

comgt
If you don't have comgt installed you'll need to download it from sourceforge. You can get it at the following URL, http://sourceforge...../ Once you download it, extract it, compile it and install it. To do all of that you'll have to make sure you have a C compiler installed. Mine is gcc version 4.1.0 and it works. To compile and install the software, you'll find a file in the package you downloaded named COMPILING.

Once you've got comgt installed, run the following two commands.

comgt -d /dev/ttyS1 GTEDGE
comgt -d /dev/ttyS1

After the first step, there will be no response from the system. Your command prompt will come back. After the second step, if your globetrotter modem has a SIM that has a PIN enabled, you'll be prompted for the PIN by the program. If that happens, type it in and press the enter key.

You should register successfully. If you don't something went wrong. Just go over the steps again. You might need to eject the card, re-insert it and try again but you should get a successful registration with your ISP... like I did.

Kppp
The final step is to use ppp to create an Internet connection. Assuming you're using KDE, launch kppp. It's under the "Internet" menu item. If you're not the super user (root) you will be asked to provide root's password. Type it in and continue.

There are two things you need to do in Kppp. You need to create an account and you also need to create a modem device. Do the following.

Click the "Configure..." button.

There are four tabs along the top. Make sure that the "Accounts" tab is selected and click "New..."

There are a number of tabs along the top of the next dialog make sure the "Dial" tab is selected. Type in any "Connection name." For example, the name of your Internet Service Provider. Click on the "Add..." button to type in a Phone number.

Select "PAP/CHAP" as the Authentication method.

For callback type, select "none." This should be the default.

Everything else should be a default on that tab so click on OK.

Next click on the Modem tab. Click on "New" to create a new modem device. Give the new modem any name. Select the right device for your modem. In my case it's /dev/ttyS1. Select Hardware [CRTSCTS] flow control. Select a connection speed of 230,400. Verify that "Use lock file" is checked. Finally, increase the Modem timeout to 120 seconds.

Save the configuration by clicking on OK.

Close the Kppp configuration window by clicking on OK.

You can now connect to the Internet. Type in your "Login ID:" and "Password" and click "Connect" If you selected "Show log window" in the Kppp connect window, a second window will appear and show you what's going on during the connection process.

That's pretty much all I have to offer. The method above works for me. I'm able to get a connection and it's fairly steady. I do get dropped from time to time, not very frequently, but it happens. I'm still trying to solve that but for now, whenever I get dumped off the Internet, I reconnect by ejecting the card and re-inserting it. I have a script that does all of the above for me.

If you have any additional information regarding these random disconnects, I'd be happy to hear from you.