USSD not returning data if not English - encoding

I have E180 Huawei GSM modem. I need to use USSD code to get some info from operator. I use this command
----- at+cusd=1,"*225#",15 -----------
It works very well for all USSD codes that return English results. But , when the USSD code regturn is in Arabic , then modem returns only OK , and no more messages
I tried different encoding using AT+CSCS="GSM" , or AT+CSCS="UCS2" , and also changed the *225# to UCS2 code (which is ) at+cusd=1,"2A99AC3602",15 >>> but same issue.
one last thing, I have other modems, and USSD returns data correctly.
Thanks for support

Related

How do I translate the following POST request into ESP8266 AT-command format?

I've got a working local website that takes in HTML form data.
The fields are:
Temperature
Humidity
The server successfully receives the data and spits out a graph updated with the new entries.
Using a browser tool, I was able to capture the actual POST request as follows:
http://127.0.0.1:5000/add_data
Temperature=25.4&Humidity=52.2
Content-Length:30
Now, I want to migrate from using the human interface browser with manual entries to an ESP01 device using AT commands.
According to the ESP AT-commands documentation, a POST request is performed using the following command:
AT+HTTPCPOST=
Find the link below for the full description of the command.
I cannot seem to get this POST request working. The ESP01 device immediately returns an "ERROR" message without any delay, as though it did not even try to send the request, that the syntax might be wrong.
Among many variations, the following is my best attempt:
AT+HTTPCPOST="http://MYIPADDR:5000/add_data",30,2,"Temperature: 25.4","Humidity: 52.2"
With MYIPADDR above replaced with my IP address.
How do I translate a post request into ESP01 AT command format, and are there any prerequisites needed to be in place to perform such a request?
I did connect the ESP01 device to the WiFi network.
Here's the link to the POST AT command description:
https://docs.espressif.com/projects/esp-at/en/release-v2.2.0.0_esp8266/AT_Command_Set/HTTP_AT_Commands.html#cmd-httpcpost
The documentation says:
AT+HTTPCPOST=url,length[,<http_req_header_cnt>][,<http_req_header>..<http_req_header>]
Response:
OK
The symbol > indicates that AT is ready for receiving serial data, and you can enter the data now. When the requirement of message length
determined by the parameter is met, the transmission starts.
...
Parameters
: HTTP URL. : HTTP data length to POST. The maximum
length is equal to the system allocable heap size.
<http_req_header_cnt>: the number of <http_req_header> parameters.
[<http_req_header>]: you can send more than one request header to the
server.
You're sending:
AT+HTTPCPOST="http://MYIPADDR:5000/add_data",30,2,"Temperature: 25.4","Humidity: 52.2"
The length is 30. The problem is that everything after the length is HTTP header fields; you need to send the variables in the body. So the command is:
AT+HTTPCPOST="http://MYIPADDR:5000/add_data",30
followed on the next line by after the ESP-01 send the > character:
Temperature=25.4&Humidity=52.2
Because you passed 30 as the body length, the ESP-01 will read exactly 30 characters after the end of the AT command and send that data as the post body. If the size of that data changes (for instance, maybe the temperature is 2.2, so one digit less), you'll need to send the new length rather than 30.

issuing an USSD command /wt trailing encoding argument

I am using smstools3 for operating an USB-based surf stick for sending SMSes. I am working on querying the balance of a prepaid SIM card. The stick is a ZTE MF112 from China, the provider is eplus from Germany. This seems relevant as the response to a balance query contains an umlaut (ä).
Speaking directly to the modem (via cu /dev/ttyU0.2) I can perform a query:
AT+CUSD=1,"*100#",15
OK
+CUSD: 0,"00490068007200200047007500740068006100620065006E0020006200650074007200E400670074003A00200039002C003900370020002E",72
which response eventually translates to
Ihr Guthaben beträgt: 9,97 .
However, smstools3 has problems whith this. It appears that the encoding (,15) is omitted in the request and I have no way of supplying it.
Question: is there a way of setting the encoding globally in an init command like AT+CSCS?

AT+CMGS returns ERROR 302

I'm trying to send a SMS using AT commands and after typing the cellphone number it show the CMS: ERROR 302.
What I'm doing:
AT
OK
AT+CMGF=1
OK
AT+CMGS="<3 digit local area code><7 digit cellphone number>"<Enter>
+CMS: ERROR 302
I've found this post: AT+CMGS returns ERROR but couldn't find a solution. Am I typing something wrong? I've changed SMS-encoding to GMS as the post describes.
Try this:
AT
AT+CMGF=1
AT+CSCA="sms tel. service",145
AT+CMGS="tel. number"
text message here
^Z
Some modems need set CSCA (SMS Service Center Address) always.
And look here for a examples and descriptions.
I found out that sending exactly the same AT commands by hand worked, but sending them from a controller did not (with waiting for the correct answers). Getting the 302 error. But then doing all commands a lot slower with waits of 2 secs in between it suddenly started to work. Apparantly the SIM900 needs more time after it answers, or something.

Gammu and PostgreSQL send 8bit sms

I'm working with Gammu and PostgreSQL to send sms from my computer.
I have success sending a normal text sms.
But i have some problem now when trying to send 8bit (Binary) message to my devices. Here's my simple query to inject message to gammu 'outbox' table.
INSERT INTO outbox (
"DestinationNumber",
"Text",
"TextDecoded",
"Coding",
"UDH",
"CreatorID") VALUES (
'202555xxxx',
'02616A03776C66JF010000198C000403E800013003F200013003F30002323003F400023230',
'',
'8bit',
'06050407d50000',
'ConfigurationSMS');
as you can see 02616A03776C66JF010000198C000403E800013003F200013003F30002323003F400023230 is my SMS text encoded using hex values. The value is correct while in outbox table.
But when the message has been sent and i'm look on my inbox table, the Text value change to this 02616A03776C66BF0100000D8C000203E800013103F2000131FD00 00007400650073007400
Does anyone know why Gammu send different text? and how to prevent the changes occur? Thanks.
As mentioned before, there is invalid char in the HEX encoded string.
But I think Gammu should complain on such error, so I'll work on fixing that upstream, see https://github.com/gammu/gammu/issues/185 for progress.

unable to sent SMS using AT Commands in hyperterminal by using TCAM GSM Modem

I am facing the problem while running the AT-commands in Hyperterminal when i enter the following commands
AT
AT+CMGF=1
AT+CSCS="GSM"
AT+CMGS="03215836031"
>TEST <CTRL-Z>
it returns the following result
Result: +CMGS: 136
and i received the sms on my cell.
but when i use the following sequence of commands it gives me the error
AT
AT+CMGF=1
AT+CSMP=17,167,0,8
AT+CSCS="UCS2"
AT+CMGS="03215836031"
Result: +CMS ERROR: 305
I don't know what is going wrong with these commands. i have googled a lot but not find any solution.
+CMS ERROR: 305 is a text format mode error.
AT
AT+CMGF=1
AT+CSMP=17,167,0,8
AT+CSCS="UCS2"
AT+CMGS="Unicode" Mobile no and SMS text must be convert to hex code.
I have tested successfully and sent SMS to any language.