Go Down

Topic: INTERFACING GSM SIM 900 WITH LEONARDO. (Read 1 time) previous topic - next topic

spradeepan92

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

spradeepan92

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

PaulS

Code: [Select]
Serial.begin(9800);
How are you selecting that baud rate in the Serial Monitor?

Code: [Select]
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?

Quote
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.

johnwasser

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:
Code: [Select]

delay(1000);
Serial1.print("+++");  // Start command mode
delay(1000);
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

dannable

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.
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

spradeepan92

where shud i include that line to configure COMMAND MODE.

spradeepan92

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.

PaulS

Quote
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.

johnwasser


where shud i include that line to configure COMMAND MODE.


Before you send an AT command.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

raheem_ehsan

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 :(

Thanks and Regards,
Ehsan.

raheem_ehsan

Code: [Select]
Serial.begin(9800);
How are you selecting that baud rate in the Serial Monitor?

Code: [Select]
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 :(

Thanks and Regards,
Ehsan.

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!

Arduino
via Egeo 16
Torino, 10131
Italy