Friday, May 22, 2009

Calling phones through Minicom and CDMA ruim card/PCMCIA

I needed a cheap PCMCIA Express card for my CDMA card to access the Internet. I bought this one. Called SEP 6000, the application only works in Windows and unfortunately is a piece of junk. Most of the times, it would stop immediately after I start the application (by the way executable is srt.exe) telling me that ruim card is not found. The choices are abort, ok and cancel. If I click abort, sometimes I can use the internet but that's it. I can't call or send or receive SMS.

But I don't need the call and SMS features right? After all, I bought the card for Internet. Not true, turned out that the only way I can charge (or recharge) money in the phone account is by calling. No other way. A really crappy telephone company.

So I needed to charge the account last week but the windows application refused to work. Maybe it is Vista, the worst operating system in the world, or maybe it is that awful application that the crappy Chinese company made -no quality control, no testing, and no feedbacks. Immediately after I started the application, it would hang and the ominous windows message- the application needs to close- pops up.

Most of the times I use Linux, right now Mandriva 2009.1 to be precise, and I need to reboot to Vista to do these stupid things (like recharge account) and use applications that don't work in Linux (like this one). Since the windows application would not work,I had no choice but to do something in Linux.

First I downloaded BitPim and then Gammu and Gnokii . Through BitPim, with a little bit of tweaking I can access the ruim memory to see the SMSs and that's all. I could not get the phone to work from either Gammu and Gnokii even though I tried a lot.

Then I had no choice but to go to Minicom, the common serial console program in Linux. So I loaded it up. My /etc/minicom.dfl file is:
pu port /dev/ttyUSB0
pu callin
pu baudrate 230400
pu mnocon1 NO CARRIER
pu mnocon2 BUSY
pu mnocon3
pu mnocon4 VOICE
pu rtscts No

/dev/ttyUSB0 because the PCMCIA card uses a USB serial emulation.


Now I needed a set of AT commands for CDMA and I got them at this site. To call phones the standard way (through AT) is ATD number in CDMA. After I connected the card through Minicom, I tried ATD number which did not work- threw out a bunch of unreadable data, and then I looked around the commands until I stumbled into at+cdv=number. It worked perfectly. Now I could call phones from minicom. But I also needed to dial numbers after the call is initiated - DTMF and even though the commands for DTMF are AT+VDS=Tone (Tone example: At+VDS=1 for dialing 1 after the call is initiated) and AT+WSTD=Tone both of them did not work. I cursed the Chinese manufacturer but what could I do. I needed to charge the account and to enter the numbers, I needed DTMF to work.

Then it stuck me, reverse engineering. I opened srt.exe in Vim, my favorite text and hex editor, and voila -there it is- in clear text- no need for reverse engineering- the commands. And here they are:
AT+CDV%s
AT+CHV0
AT$DTMF%c
AT$VOL=%d
AT$VOL?



Clearly the AT+CHV is for hanging up the phone. It could also be found in the AT command set. But that set did not have AT$DTMF. Therefore, AT$DTMF%c must specify the DTMF with %c being the tone (1-9#*) and AT$VOL=%d must specify the volume of the phone. I tried it and it worked. Now I can send and receive phones and SMSs, check signal strength and recharge through Minicom, the Chinese SEP 6000 PCMCIA card and my RUIM CDMA card.

Next blog, how I send and received SMSs from Minicom

No comments:

Post a Comment