Sunday, February 29, 2004

communicating to a modem

when i first did tried this it definitely was a "eureka" moment for me. i doubt how many of you broadband guys (yup .. i am still on dial-up) still have a modem though.

basically i'll show you how to issue commands to your modem. the modem can be programmed to perform various tasks.

goto start>>programs>>accessories>>communications>>hyper terminal. you will be asked to create a new connection. just give any name you want. in the connect to option give COM1 or the similar COMx port where your modem is connected. in the next window, you can set Bits per Second to 9600. after ok you are connected to your modem.

now you have a blank text window staring at you and thats all. type in at and voila, you get a reply OK. that was your modem talking. in modems, standard commands have been defined. this protocol is called AT-command set. the command you issued earlier was attention (at). you asked the modem for it's attention. just a sort of are_you_present check. another command is ATDT=xxx which will dial through your modem to the number xxx. there are many other codes which you can google for.

also the modem can reply in numeric or verbose format to your commands. numeric commands are well, numeric like 0 1 2 3 .. each have meaning as described per command. verbose commands are like OK CONNECT RING BUSY etc.

so you can create an app, which communicates with the COM port, and listens for the above strings, after passing the commands. and can talk on the phone through your the pc. there are two modes of communication with a modem actually, a data mode and a command mode. in the command mode the modem respods to stuff like AT etc. when you convert to data mode, everything you send to the modem is just passed through. ATA, ATH, +++ are some more useful commands. i haven't explored or tried this much so not very sure of some things.

and it gets better. for mobile communication there exists a AT+ command set. instead of a normal modem you can connect a Nokia 30 GSM terminal to the pc. now just insert a sim card and communicate wirelessly. the AT+ command set is a super set of the AT commands. advanced commands exist for operations supported by mobile devices, like sending SMS'es. also can use advanced, faster mobile protocols like GPRS etc.

i have just given a brief overview of the stuff within limitations of my knowledge. please google further for more info. also i suggest that you read more on the Nokia 30 terminal. also it seems that Nokia 31 terminal has been released. dinesh could also add on to this blog.

in linux there is an app minicom which is the equivalent of hyper terminal.

No comments: