Go Down

Topic: Problem with accent character and GSM shield (Read 1 time) previous topic - next topic


Oct 01, 2013, 06:23 pm Last Edit: Oct 06, 2013, 10:53 pm by Elby Reason: 1

I'm using the Arduino GSM R3 Shield over an Arduino UNO R3 to send and receive SMS message from the Arduino serial console. I'm using an hybrid code from the two examples for sending and receiving SMS and it works well :

Code: [Select]
// libraries
#include <GSM.h>

// PIN Number
#define PINNUMBER ""

// initialize the library instance
GSM gsmAccess; // include a 'true' parameter for debug enabled
GSM_SMS sms;

char remoteNumber[20];  // Holds the emitting number

void setup()
 // initialize serial communications

 Serial.println("SMS Messages Receiver");

 // connection state
 boolean notConnected = true;

 // Start GSM shield
 // If your SIM has PIN, pass it as a parameter of begin() in quotes
     notConnected = false;
     Serial.println("Not connected");

 Serial.println("GSM initialized");
 Serial.println("Waiting for messages");

void loop()

 //pour envoyer un message texte

 char c;

 // If there are any SMSs available()

 if (sms.available())

   // Get remote number
   sms.remoteNumber(remoteNumber, 20);

   // This is just an example of message disposal    
   // Messages starting with # should be discarded
     Serial.println("Discarded SMS");

   // Read message bytes and print them

  // Serial.println("\nEND OF MESSAGE");

   // delete message from modem memory
  // Serial.println("MESSAGE DELETED");
  // Serial.println("Waiting for messages");

 if (Serial.available() > 0)
 char remoteNumber[20];  // telephone number to send sms

 // sms text
 Serial.print("Now, enter SMS content: ");
 char txtMsg[200];

 // send the message
 Serial.println("Waiting for messages");


 Read input serial
int readSerial(char result[])
 int i = 0;
   while (Serial.available() > 0)
     char inChar = Serial.read();
     if (inChar == '\n')
       result[i] = '\0';
       return 0;
       result[i] = inChar;

My problem is when I'm sending SMS with accent character (I'm form Quebec, Canada, we all speak french in here) the text is displayed as HEX value of the ASCII character instead of the ASCII value itself. It does this only with certain character like ô and à, but not with è.

Here is a print of the serial console for a test without and with accents :

With accent :

test without accents

Without accents :


The HEX sentence is this one : "test with accents : é à è ô"

00E9 = é

00E0 = à

00E8 = è

00F4 = ô


In the same way, when I want to send a sentence with some accent character, it doesn't works.

Can someone help me with this problem? I would like the shield to send my the correct ASCII character in the same format all the time, and I would want it to be able to send all the different characters in the same format too.





I did some more search and noticed that there is an AT command to configure the GSM modem in ISO 8859 Latin 1, witch is the ASCII chart I think I need.

My problem is that I don't know how to send direct AT command to the shield. I would like to do this at the beginning of my code :

send to GSM shield : AT+CSCS="8859-1"
Print what I get back
send to GSM shield : AT+CSCS?
print what I get back

I succeed wit this code :

Code: [Select]
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2,3);

void setup()

void loop()
  if (mySerial.available())
  if (Serial.available())


But when I try to implement it with the code with the GSM.h library it doesn't work because there is a conflict between GSM.h and SoftwareSerial.h (I read a lot about it on the forum).

So, is there a way to send simple and direct AT command to the GSM modem?



Ok, I succeeded in changing the character set by using this command at the beginning of my code :


But it does not solve my problem with accent character. I tried all character set and I have the same problem with all of them.

Is someone have an idea of what could cause this and what would be the solution?


Hi! I know its an old Tread, but have you fix your problem? I just ask because i got the exact same problem here with my GSM module...

Salut, je sais que c'est un vieux tread, mais as-tu résolu ton problème? Je te demande car j'ai exactement le même problème avec mon module GSM

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131