Search code examples
puttyat-commandmodem3gussd

Error on checking balance via USSD


I've been trying to check my balance from by 3g modem via AT commands and seem to be stuck.

The device infomation is as follows:

Manufacturer: QUALCOMM INCORPORATED
Model: M6281
Revision: SSD_M6281A-0.0.1 1 [Oct 02 2008 07:00:00]

The modem has USSD capability (advertised and also present in the factory installed dashboard).

I am connecting via putty to COM4 serial port which is my modems application port. All AT commands are working fine but I am getting an error on issuing the following via putty:

AT+CUSD=1,"*111#",15

This returns a simple "ERROR". *111# is my carrier's balance check code. I suspect that there is a formatting error somewhere but I can't figure out where.

Note: If I issue a blank ussd command:

AT+CUSD=1,"",15 

then I get an OK (although I later get a response +CME ERROR: retry operation) ... If I write anything within the quotation marks however, it returns an "ERROR".


Solution

  • Ok, I finally found the way to fix this. Apparently there was a problem in the encoding. Here is what I did:

    AT+CSCS="GSM" // change character set to GSM
    AT+CUSD=1,"*111#",15 // Issued balance check ussd code
    

    It now works fine.

    The default encoding was UCS2, I'd appreciate if someone can share how to convert ussd codes to UCS2 encoding in putty.