5
votes

I'm trying to check the SIM Card Balance via USSD using Huawei E1550 3G modem

But when i always send

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

I Get

   +CME Error: 100

And yes my modem support USSD because i have a dashboard application for the modem and i can check the balance and also recharge the SIM Card.

I'm using GSMComm library in C# i've also tried it in putty termainl but keep getting the same error

I searched for the error 100 and found that it's "Unknown Error" no really helpful :)

I did also tried changing text mode to pdu mode before sending but nothing changed

   AT+CMGF=0

Note: I've also tried

  AT+CUSD=1,"*100#"

the same error

and the response of

   AT+CUSD=?

is

  (0-2)

UPDATE

I've Converted the request "*100#" to 7bit "2A31303023" like this

 AT+CUSD=1,"2A31303023" ,15

response

 +CUSD: 2

I believe that the problem is about to be solved but what the response mean ?

2
What do you get in response to AT+CUSD=? Are you sure that the USSD code *100# is supported by your operator?user1725145
Have you tried AT+CUSD=1,"*100#" i.e. without setting the 3rd parameter to 15? Also, I assume the SIM is unlocked.user1725145
@SList the response of AT+CUSD=? is (0-2) and yes a tried at+cusd without the third parameter and i'm sure that the code is supportedanon
@SList but what do you mean that the SIM is unlocked ?? but i tried other commands like sending SMS and everything works findanon
I meant, that you have entered the PIN and unlocked the SIM. Just trying to eliminate obvious causes! It's hard to deduce people's level of expertise from a question on SO. Not all mobile operators use the same USSD string for retrieving the balance, you do know that don't you? For example, in Germany, Telekom, Vodafone and E Plus use *100#, but O2 uses another string. These points are annoying if you know them already, but your AT command is correct, and should work, so it could be some really small thing that is stopping it from working.user1725145

2 Answers

2
votes

I solve this problem by using atz it's like this

AT+CMGF=1
ATZ
At+cusd=1,"*100#",15

And it works great

2
votes

You have to encode the message to PDU format

gsmcomm PDUConverter can be used to do this

https://github.com/welly87/GSMComm/blob/master/PDUConverter/GsmComm.PduConverter/SmsPdu.cs