Pages: [1] 2   Go Down
Author Topic: GSM Shield weired characters in SMS  (Read 6472 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I just got Arduino Uno running with Arduino GSM shield.
When running example for sending SMS I run into following problem:
SMS is successfully sent but the text message inside is corrupt.

I receive asian characters on my mobile whereas in serial monitor I enter regular english text.
e.g. message string "test" leads to "瑥獴"

I am using a t-mobile SIM registeted (PIN protected) in Germany in case that matters...

Any ideas or anybody experienced the same?
Thanks! Best Regards,
Musterstrasse
« Last Edit: June 03, 2013, 07:43:52 pm by musterstrasse » Logged

Madrid (Spain)
Offline Offline
Full Member
***
Karma: 0
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

it may be a problem with character set configured by default in the modem.

You can check if character set configured is correct:

1 - Upload this code in your Arduino:
Code:
#include <SoftwareSerial.h>
#include <string.h>

char incoming_char=0;      //Will hold the incoming character from the Serial Port.
SoftwareSerial cell(2,3);  //Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.

void setup()
{

  //Initialize serial ports for communication.
  Serial.begin(9600);

  // reset
  Serial.println("Start Reset");
  pinMode(7, OUTPUT);
  digitalWrite(7, HIGH);
  delay(1500);
  //digitalWrite(7, LOW);
  delay(1000);
  Serial.println("End Reset"); 

  cell.begin(9600);

  Serial.println("Ready for commands...");
}

void loop()
{
  //If a character comes in from the cellular module...
  if(cell.available() >0)
  {
    incoming_char=cell.read();    //Get the character from the cellular serial port.
    if((incoming_char >= ' ')&&(incoming_char<='z'))
      Serial.print(incoming_char);
    else
    {
      Serial.print("%");
      Serial.print((int)incoming_char);
      Serial.print("%");
      if(incoming_char==10)
        Serial.println();
    }
  }

  //If a character is coming from the terminal to the Arduino...

  if(Serial.available() >0)
  {
    incoming_char=Serial.read();  //Get the character coming from the terminal
    cell.print(incoming_char);    //Send the character to the cellular module.
  }
}

2 - Open serial monitor with 9600 baud and both NL & CR, and wait for message "Ready for commands...".

3 - Write AT in your serial monitor and push enter, repeatedly until you see the modem response as OK (ignore other messages).

Example:
AT%13%%13%%10%
OK%13%%10%

4 - Enter AT+CSCS? and push enter, you should see a response similar to:
AT+CSCS?%13%%13%%10%
+CSCS: "GSM"%13%%10% // this is character set configured
%13%%10%
OK%13%%10%

5 - If your character set is not GSM, you can change this with command AT+CSCS="GSM", and push enter. After, you can check it with AT+CSCS? and push enter.

Example:
AT+CSCS="GSM"%13%%13%%10%
OK%13%%10%
AT+CSCS?%13%%13%%10%
+CSCS: "GSM"%13%%10%
%13%%10%
OK%13%%10%


Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi davidgoth,

thanks for your reply!
i did the steps you described but the GSM shield behavior stays as it was.

here is what serial monitor said when i entered the commands:


Start Reset
End Reset
Ready for commands...
%-8%AT%13%%13%%10%
OK%13%%10%
AT+CSCS?%13%%13%%10%
+CSCS: "GSM"%13%%10%
%13%%10%
OK%13%%10%
AT+CSCS="GSM"%13%%13%%10%
OK%13%%10%
AT+CSCS?%13%%13%%10%
+CSCS: "GSM"%13%%10%
%13%%10%
OK%13%%10%

When running the SMS example again I still get cryptic characters.

Any other tips to try?
Thanks!
Logged

Madrid (Spain)
Offline Offline
Full Member
***
Karma: 0
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try send a SMS, one with Arduino SendSMS example and other with your mobile phone, and receive it in your Arduino with ReceiveSMS example.
Post your SMS messages received.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi davidgoth,

thanks again for your feedback. here we go:

for both scenarios i am using the code examples from arduino 1.0.5 (SendSMS / ReceiveSMS) and both SIM cards (sending / receiving) are registered in Germany with t-mobile.

scenario SendSMS (arduino sending sms to my mobile):
- i changed the line for #define PINNUMBER "" and entered my 4 digit pin
- i opened serial monitor with 9600 baud and both NL&CR
- here is the results for 7 tests that i ran (<message content entered in serial monitor> --> <content received on my mobile>)

1 --> empty SMS
a --> empty SMS
abc --> 慢
test --> 瑥獴
abc abc --> 慢挠慢
12 12 --> ㄲ‱
12 --> ㄲ

then i changed the parameter to debugging and here is the output in serial monitor for the last example with sending string "12" (i modified the output to mask my pin no. and mobile no.)

- GSM gsmAccess = true;


SMSMS Messages Sender
AT%13%
0 9>AT%13%%13%%10%OK%13%%10%
AT+CPIN=xxxx%13%
9 44>AT+CPIN=xxxx%13%%13%%10%+CPIN: READY%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
44 75>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
75 106>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
106 9>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
23 54>AT+CGREG?%13%%13%%10%+CGREG: 0,1%13%%10%%13%%10%OK%13%%10%
AT+IFC=1,1%13%
54 71>AT+IFC=1,1%13%%13%%10%OK%13%%10%
AT+CMGF=1%13%
71 87>AT+CMGF=1%13%%13%%10%OK%13%%10%
AT+CLIP=1%13%
87 103>AT+CLIP=1%13%%13%%10%OK%13%%10%
ATE0%13%
103 114>ATE0%13%%13%%10%OK%13%%10%
AT+COLP=1%13%
114 120>%13%%10%OK%13%%10%
GSM initialized
Enter a mobile number: 0151xxxxxxxx
Now, enter SMS content: SENDING

Message:
12
AT+CMGS="0151xxxxxxxx"%13%
120 124>%13%%10%>
12%26%%13%
120 16>%13%%10%> %13%%10%+CMGS: 105%13%%10%%13%%10%OK%13%%10%

COMPLETE!

Enter a mobile number:



scenario b (arduino receiving sms from my mobile):

- i changed the line for #define PINNUMBER "" and entered my 4 digit pin
- i opened serial monitor with 9600 baud and both NL&CR
- here is the results for tests that i ran (<message content entered in my mobile> --> <content received in serial monitor of arduino>)

12 --> 12
abc --> abc
1 --> 1
test --> test

test was successful for example SMSreceive
here is the debugging result for the test with string "test"

SMS Messages Receiver
AT%13%
0 9>AT%13%%13%%10%OK%13%%10%
AT+CPIN=xxxx%13%
9 44>AT+CPIN=xxxx%13%%13%%10%+CPIN: READY%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
44 75>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
75 106>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
106 9>AT+CGREG?%13%%13%%10%+CGREG: 0,1%13%%10%%13%%10%OK%13%%10%
AT+IFC=1,1%13%
9 40>AT+IFC=1,1%13%%13%%10%OK%13%%10%%13%%10%Call Ready%13%%10%
AT+CMGF=1%13%
40 56>AT+CMGF=1%13%%13%%10%OK%13%%10%
AT+CLIP=1%13%
56 72>AT+CLIP=1%13%%13%%10%OK%13%%10%
ATE0%13%
72 83>ATE0%13%%13%%10%OK%13%%10%
AT+COLP=1%13%
83 89>%13%%10%OK%13%%10%
GSM initialized
Waiting for messages
AT+CMGL="REC UNREAD",1%13%
89 95>%13%%10%OK%13%%10%
AT+CMGL="REC UNREAD",1%13%
95 101>%13%%10%OK%13%%10%
AT+CMGL="REC UNREAD",1%13%
50 4>%13%%10%+CMGL: 1,"REC UNREAD","+49151xxxxxxxx","","2013/06/05 02:53:27+08"%13%%10%test%13%%10%%13%%10%OK%13%%10%
Message received from:
+49151xxxxxxxx
test
END OF MESSAGE
AT+CMGD=1%13%
4 10>%13%%10%OK%13%%10%
MESSAGE DELETED
AT+CMGL="REC UNREAD",1%13%
10 16>%13%%10%OK%13%%10%



thanks a lot in advance!
musterstrasse
Logged

Madrid (Spain)
Offline Offline
Full Member
***
Karma: 0
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,

Repeat the same steps for check AT+CSCSI command that I posted, now with the command AT+QMGHEX.

The result should be: +QMGHEX: 0

You can change this configuration with AT+QMGHEX=0.
« Last Edit: June 07, 2013, 02:06:46 am by davidgoth » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi davidgoth!

Thanks for your tip.
Unfortunately it didn't work out but I think we are close.

Here is the logging:

Start Reset
End Reset
Ready for commands...
%-8%AT+CSCS="GSM"%13%%13%%10%
OK%13%%10%
AT+CSCS?%13%%13%%10%
+CSCS: "GSM"%13%%10%
%13%%10%
OK%13%%10%
AT+QMGHEX=?%13%%13%%10%
+QMGHEX: (0,1)%13%%10%
%13%%10%
OK%13%%10%
AT+QMGHEX=0%13%%13%%10%
+CME ERROR: 11%13%%10%
AT+QMGHEX=1%13%%13%%10%
+CME ERROR: 11%13%%10%
AT+QMGHEX=0%13%%13%%10%
+CME ERROR: 11%13%%10%
AT+QMGHEX=?%13%%13%%10%
+QMGHEX: (0,1)%13%%10%
%13%%10%
OK%13%%10%

I am getting "+QMGHEX: (0,1)" as a response other than you expected.
When I try to change this value to "0" I am getting an error "+CME ERROR: 11"

Google says that means "SIM PIN required"

It seems that I cannot change QMGHEX value without entering PIN.
Any idea on why that is the case or how to issue the command along with the PIN?

Thanks!
Musterstrasse
« Last Edit: June 09, 2013, 07:52:09 pm by musterstrasse » Logged

Madrid (Spain)
Offline Offline
Full Member
***
Karma: 0
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

The command is AT+QMGHEX? for show actual configuration, not AT+QMGHEX=?.

First, you have to enter your pin with AT+CPIN=1234 where 1234 is your PIN. After, enter AT+CMGF=1 to activate Text mode. At this moment, you will be able to use AT+QMGHEX=0.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!

I ran though your instructions and could set QMGHEX to "0" (the values was already set).
The problem still stays the same. When sending an SMS with Arduino shield it is received in weird  characters on my mobile.

Here is the logging in serial monitor of what I did (1234 masks my PIN)

Start Reset
End Reset
Ready for commands...
%-8%AT%13%%13%%10%
OK%13%%10%
AT%13%%13%%10%
OK%13%%10%
AT+QMGHEX?%13%%13%%10%
+QMGHEX: 0%13%%10%
%13%%10%
OK%13%%10%
AT+CPIN=1234%13%%13%%10%
+CPIN: READY%13%%10%
%13%%10%
OK%13%%10%
%13%%10%
Call Ready%13%%10%
AT+CMGF=1%13%%13%%10%
OK%13%%10%
AT+QMGHEX=0%13%%13%%10%
OK%13%%10%
AT+QMGHEX?%13%%13%%10%
+QMGHEX: 0%13%%10%
%13%%10%
OK%13%%10%

Thank you very much for any new idea on how to solve that issue.
Musterstrasse!
Logged

Madrid (Spain)
Offline Offline
Full Member
***
Karma: 0
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try restart modem to default manufacturer configuration with AT&F.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!

Unfortunately no change in GSM shield behavior even after resetting.
The outbound SMS still do have cryptic characters on them.

Here is the output of the serial monitor when trying to reset:

Code:
Start Reset
End Reset
Ready for commands...
%-8%AT%13%%13%%10%
OK%13%%10%
AT&F%13%%13%%10%
OK%13%%10%

Any more ideas?

I also did activate debugging during sending the sms maybe that helps...

Code:
GSM gsmAccess(true);

Here is the output in serial monitor during sending
Code:
SMS Messages Sender
AT%13%
0 9>AT%13%%13%%10%OK%13%%10%
AT+CPIN=1234%13%
9 44>AT+CPIN=1234%13%%13%%10%+CPIN: READY%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
44 75>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
75 106>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
106 9>AT+CGREG?%13%%13%%10%+CGREG: 0,1%13%%10%%13%%10%OK%13%%10%
AT+IFC=1,1%13%
9 40>AT+IFC=1,1%13%%13%%10%OK%13%%10%%13%%10%Call Ready%13%%10%
AT+CMGF=1%13%
40 56>AT+CMGF=1%13%%13%%10%OK%13%%10%
AT+CLIP=1%13%
56 72>AT+CLIP=1%13%%13%%10%OK%13%%10%
ATE0%13%
72 83>ATE0%13%%13%%10%OK%13%%10%
AT+COLP=1%13%
83 89>%13%%10%OK%13%%10%
GSM initialized
Enter a mobile number: +4915112345678
Now, enter SMS content: SENDING

Message:
test
AT+CMGS="+4915112345678"%13%
89 93>%13%%10%>
test%26%%13%
89 113>%13%%10%> %13%%10%+CMGS: 113%13%%10%%13%%10%OK%13%%10%

COMPLETE!

Enter a mobile number:

As a result I still receive message string "瑥獴" on my mobile. (sms content is "test")
« Last Edit: June 14, 2013, 01:06:56 am by musterstrasse » Logged

Madrid (Spain)
Offline Offline
Full Member
***
Karma: 0
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

To check if modem has a problem. Can you execute this commands and post response?

AT+GMM
AT+GMR
AT&V
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi!,

here is the output in serial monitor when I entered the 3 commands:

Code:
Start Reset
End Reset
Ready for commands...
%-8%AT%13%%13%%10%
OK%13%%10%
AT+GMM%13%%13%%10%
Quectel_M10%13%%10%
%13%%10%
OK%13%%10%
AT+GMR%13%%13%%10%
Revision: M10BR06A06N32%13%%10%
%13%%10%
OK%13%%10%
AT&V%13%%13%%10%
ACTIVE PROFILE%13%%10%
%13%%10%
E: 1%13%%10%
%13%%10%
Q: 0%13%%10%
%13%%10%
V: 1%13%%10%
%13%%10%
X: 4%13%%10%
%13%%10%
S0: 0%13%%10%
%13%%10%
S2: 43%13%%10%
%13%%10%
S3: 13%13%%10%
%10%
5%13%%13%:1%10%
%10%
CLGDR0%10%
+MB%10%
%13%%10%
CI 1+%13%%10%
 %10%
%10%
CAR8CIST %13%%10%
%10%
00%10%
%10%
CA %10%
%10%
%10%
++SME ,%13%%10%
,O21,EHEO,41%10%
+EHI)244EO:8%10%
%10%
QE%13%%13%%10%
%10%
SS0%10%
O%13%

Can you read anything unusual from that?
Thanks for your help!
Logged

Madrid (Spain)
Offline Offline
Full Member
***
Karma: 0
Posts: 108
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Sorry for late response,

Can you execute this commands and post response?

AT+CSCS?
AT+CSMP?
AT+CMGF?
AT+QSMSCODE?

Thanks!.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi davidgoth,

i startet with AT+CPIN=1234 and entered my PIN in case that was needed...
here is what Arduino outputs to serial monitor:

Code:
Start Reset
End Reset
Ready for commands...
AT+CPIN=1234%13%%13%%10%
+CPIN: READY%13%%10%
%13%%10%
OK%13%%10%
%13%%10%
Call Ready%13%%10%
AT+CSCS? %13%%13%%10%
+CSCS: "GSM"%13%%10%
%13%%10%
OK%13%%10%
AT+CSMP?%13%%13%%10%
+CSMP: 17,255,0,8%13%%10%
%13%%10%
OK%13%%10%
AT+CMGF? %13%%13%%10%
+CMGF: 0%13%%10%
%13%%10%
OK%13%%10%
AT+QSMSCODE?%13%%13%%10%
+QSMSCODE: 1%13%%10%
%13%%10%
OK%13%%10%

thanks for your feedback!
Logged

Pages: [1] 2   Go Up
Jump to: