Advertisment

Cellphone meets the PC

author-image
PCQ Bureau
New Update

Communication has come a long way since Alexander Graham Bell invented the telephone. Cellphones have relieved people of the need to be dependent on a landline by providing wireless communication. Email has almost become the mode of written communication. And then there was the marriage of written and verbal communication–the Short Message Service over cellphones. SMS has been the key application for cellphones in India and several south Asian countries. It started off as a casual way of keying in short personal messages to others. Later, several enhancements were made, such as group SMS, chatting, SMS over email, etc. Then a lot of companies started offering various services over SMS, like email alerts, dating and astrology advice. During the cricket World Cup, one could keep themselves updated on scores over SMS. Now, you can also make your own applications using a cellphone and SMS. For instance, you can incorporate SMS in your organization and send mail alerts to your employees. You can also create SMS-based polls, or even give your dealers the status of your product shipments, launch dates, payments, etc over SMS. You could even carry out

SMS-based advertising.

Advertisment

Read on to see how to create your own SMS-based applications. 

What you need



You’ll need a computer and of course, a cell phone that has computer connectivity. We used a Nokia 6510, which boasts of an IR connection. A lot of laptops have an IR port, but if you’re going to use it with a PC, then you’ll need an IR module for it. We used a USB-to-IR module, which is easily available from the market for around Rs 1,500. For cellphones without IR, you’ll need to find a data cable that can connect it to a PC. 

On the computer’s side, you have a choice of using either Linux or Windows. There are commercial as well as open source applications available on both OSs. Nokia for instance, provides a SDK for the job (visit www.forum.nokia.com for details).

Advertisment

On the open source side, there’s Gnokii www.gnokii.org (Gnu Nokia) for Linux (Essentially for Nokia cell phones) and Gammu for Windows. We’ve provided the source code for both, and the Windows application for

Gammu on this month’s CD. 

The functionality



The basic objective of any such system would be to get an SMS from the cellphone, which would get transferred to the PC, get processed and a reply would be sent back via SMS. In this issue, we’ll talk about how to use Gammu for Windows. In the next issue, we’ll build an application using the software. 

If you’re using Windows on your

PC
, then you can get a USB-to-IR connector for the IR functionality.
Advertisment

Gammu stands for GNU All Mobile Management Utilities, and is basically a command line application that lets you do a variety of things using your cell phone such as downloading your SMSs and phonebook. This software undergoes frequent updates, and you can download the latest version from http://www.mwiacek.com. The file we’ve given on the CD is called gammu_win32.zip. Unzip it to a single directory, and the first step is to configure it, which is very easy. First, set the connection type. If you’re using a Nokia phone with a data cable, then set it to Fbus, and set it to irda if using Infrared.

Gammu is a command-line utility that can be used to control the cellphone. You can download all SMS messages to your PC, obtain information about your cellphone, and much more. 

Usually Gammu will be able to detect your cellphone. But if it doesn’t, then enter your cellphones model number. Some non-Nokia phones can create problems, in which case you should use the atXXX option available for the connection type.

Advertisment

Once set, run a dry test by firing up a command prompt window and typing: 

gammu —identify 



You will see the basic information about your cell phone eg manufacturer, model name, firmware etc. Amazed? This is just the first thing. You can even get a lot more information using the –monitor option, which runs in a loop and gives information like battery and network level (the two bars you see on your nokia screen), your service provide, and even your SIM status. Use ctrl-c to quit.

For receiving SMS, you can use: 

Advertisment

gammu —getallsms 



This will dump all SMSs stored on your cell to the screen. To actually use the output you have to divert all of them to a file using “>” eg gammu —getallsms >

mysms. 

Achtung Linux users!!
If you want an IR module for your Linux system, be warned. Nowadays, the markets are flooded with USB-to-IR converters based on the Sigmatel 4200 chipset. This will not work on Linux as it’s not IrDA compliant. However, an alpha driver is available on the net for this, which hasn’t yet been included into the alpha kernel tree. So unless you’re the adventurous type who wants to try out everything, we suggest you stay away for USB IR devices if you’re using Linux. A serial to IR adaptor will be a better bet.

Alternatively, to download a single sms, you can use the —getsms option 



e.g. gammu —getsms 1 1. This will download the first or your oldest SMS in your cellphone’s inbox and gammu –getsms 1 2– for downloading the second sms, and so on.

There are many other features available in gammu, but it depends on whether your cellphone supports them all or not. For instance, we could set the vibration level on the 6510, and if your cellphone doesn’t support vibration, it will not work. You can browse the documentation text provided with gammu and experiment with other options in it. Next time, we’ll talk about how to send SMS messages using Gammu, and also create a simple application. 

Ankit Khare

Advertisment