INTERFACING GSM SIM 900 WITH LEONARDO.

actually i am trying to sent a message with the help of arduino leonardo and Sim 900 gsm modem(sms application note:http://www.nskelectronics.com/files/sim900_sms_app_note.pdf)but i couldn't.i am using this code
void setup()
{
Serial.begin(9800);
Serial1.begin(115200);
delay(10000);
Serial.println("set up comms");
delay(5000);

Serial.println("Switching to text mode");
delay(2000);
Serial1.println("AT+CMGF=1");
delay(2000);
Serial1.println("AT+CSCS="GSM"");
delay(500);
Serial1.println("AT+CSCA="919840011003"");
delay(500);
Serial1.println("AT+CSMP=17, 167, 0, 240");
delay(500);
Serial.println("Selecting number");
delay(500);
Serial1.println("AT+CMGS="9092830876"");
delay(500);

Serial.println("Typing message");
delay(500);
Serial1.println("TEST.");
delay(500);

Serial.println("sending ctrl-z");
delay(500);
Serial1.write(0x1A);
delay(500);

Serial1.println();
}

void loop()
{
if (Serial1.available())
Serial.write(Serial1.read());
}
and the response is

set up comms
Switching to text mode
Selecting number
Typing message
sending ctrl-z
AT+CMGF=1
AT+CSCS="GSM"
AT+CSCA="919840011003"
AT+CSMP=17, 1

actually i am trying to sent a message with the help of arduino leonardo and Sim 900 gsm modem(sms application note:http://www.nskelectronics.com/files/sim900_sms_app_note.pdf)but i couldn't.i am using this code
void setup()
{
Serial.begin(9800);
Serial1.begin(115200);
delay(10000);
Serial.println("set up comms");
delay(5000);

Serial.println("Switching to text mode");
delay(2000);
Serial1.println("AT+CMGF=1");
delay(2000);
Serial1.println("AT+CSCS="GSM"");
delay(500);
Serial1.println("AT+CSCA="919840011003"");
delay(500);
Serial1.println("AT+CSMP=17, 167, 0, 240");
delay(500);
Serial.println("Selecting number");
delay(500);
Serial1.println("AT+CMGS="9092830876"");
delay(500);

Serial.println("Typing message");
delay(500);
Serial1.println("TEST.");
delay(500);
Serial.println("sending ctrl-z");
delay(500);
Serial1.write(0x1A);
delay(500);

Serial1.println();
}

void loop()
{
if (Serial1.available())
Serial.write(Serial1.read());
}
and the response is

set up comms
Switching to text mode
Selecting number
Typing message
sending ctrl-z
AT+CMGF=1
AT+CSCS="GSM"
AT+CSCA="919840011003"
AT+CSMP=17, 1

 Serial.begin(9800);

How are you selecting that baud rate in the Serial Monitor?

 Serial1.begin(115200);

Is that the correct baud rate to talk to you GSM device? How IS the GSM device connected to the Arduino? Is the GSM device using pins 0 and 1?

sms application note:http://www.nskelectronics.com/files/sim900_sms_app_note.pdf)but i couldn't.i am using this code

It would be a lot better if YOU used the space key now and then. Your"link"doesn'tworkbecauseyoudidn'tleavespacesaroundit.

It looks like the SIM 900 is just echoing everything it sees. Perhaps it has to be switched to Command Mode. Often this is done with:

delay(1000);
Serial1.print("+++");  // Start command mode
delay(1000);
  1. Which SIM900 based device are you using?
  2. Have you confirmed that said device is functioning? If not, and it is the common shield, go here and follow the instructions to check it using Serial Relay
  3. Is the SIM card activated? Can you send a text / sms from a 'phone?
  4. Post ALL your code using the code (#) tags.

where shud i include that line to configure COMMAND MODE.

how to select the baudrate?i dnt have any idea in selecting baud rate for system Serial.println(9800).and for gsm modem the maximum configurable rate is 115200().thats y Serial1.println(115200).if it is wrong correct it with the correct code.

how to select the baudrate?

Use Serial.begin(), as you were doing, but you must pick a value that matches what the other end is expecting (9600, maybe, not 9800).

The other baud rate might be right.

spradeepan92:
where shud i include that line to configure COMMAND MODE.

Before you send an AT command.

Hi,

Would you generous people please help me, I need to interface SIM900 GSM module with arduino LEONARDO and GPS shield at the same time. Please please please help me :frowning:

Thanks and Regards,
Ehsan.

PaulS:

 Serial.begin(9800);

How are you selecting that baud rate in the Serial Monitor?

 Serial1.begin(115200);

Is that the correct baud rate to talk to you GSM device? How IS the GSM device connected to the Arduino? Is the GSM device using pins 0 and 1?
It would be a lot better if YOU used the space key now and then. Your"link"doesn'tworkbecauseyoudidn'tleavespacesaroundit.

Hi,

Would you generous people please help me, I need to interface SIM900 GSM module with arduino LEONARDO and GPS shield at the same time. Please please please help me :frowning:

Thanks and Regards,
Ehsan.