Hi to everyone. I’m new in this Arduino World but i think it’s a great community. I’m doing my final career project. I have to send a sms to a number when an event occurs. For that I have bought two Arduino components: the Arduino UNO and the Icomsat v1.1 SIM900 GSM/GPRS shield for arduino. I started learning how to use the Arduino UNO with some simple programs and modifying them. No problem there. In fact, it’s very intuitive; but I’m having some troubles in making the shield to work. I have read the shield guide but it’s no very complete in my opinion. I have read some forums but I didn’t found the solution for my problem. The library I’m using is the one called GSM_Shield_ide_1.0 ; the version of the ide I’m using is 1.0.5. The ide compiles the example but when I try to download it to the arduino UNO with the shield it gives me this error: “avrdude: stk500_getsync(): not in sync: resp=0x00”. Can anyone help me?. The things I know is that the status led of the shield tells me that the network is working ok and the program can be compiled.
The example im trying to use from the librarie is the one called:"Gsm_Shield_Test". Thanks in advanced for the answers.
Juan Ignacio
Hi there,
I had the same issue, and as soon as I remove the shield from my uno, the program uploads fine with no issue.
Behind the scenes the GSM library is using the SoftwareSerial library to handle the serial comms between your arduino uno and the GSM shield.
If you have not yet tried it, change the pin selection on your shield to use pins 2 and 3. 2 for TX and 3 for rx.
I have found then that there is no communication error when trying to upload while the shield is attached to the uno.
I bought mine two days ago, but I on the other hand struggle to get mine connected to the cellular carrier.
Good luck further and please let me know if my info helped you.
Thank you very much Rudolf. In fact you helped me a lot. I tell you what i did. I change the jumpers in the shield as you told me(i put them in 2 Tx, 3 Rx) and then i don´t know if you did it but you have to change the GSM_Shield.cpp ( c plus plus file) and go to line where Software Serial is configurated and changed the numbers of the pins to Rx 2 and Tx 3(yes, opposite to the jumpers). Please let me know if you have any advance on you project. One more thing, this is the link were i donwload the library: OpenHacks | Open Source Hardware | Productos | IComSat v1.1 SIM900 GSM GPRS Shield (the one that says ide1.0 i have).
If you need anything else let me know,
Good luck,
Jhon
Hi there.
Great, glad I could help.
Just a quick question regarding your advise. Is this to solve the issue that my shield is not connecting to the cellular carrier?
I have not tried since I text you...
Did you call your movil service to see if the chip could function in another device rather than your cell phone? Let me know if thath help you.
Hi,
I came right. I did not change my pin jumpers on the shield though. It connected to the cell network fine.
Thanks for the help.
just a quick question though, the cell number, in what format should it be entered when wanting to send sms's.
Here in South Africa we have two ways and sometimes the one is accepted and the other not:
- 0723457658
- +2723457658
Hi, here are some issues I am having with my GSM/GPRS shield.
Problem statement 1: >>>
I cannot send an SMS
Problem statement 2: >>>
The GSM shield only connects to the carrier network when the USB cable is plugged to the pc, when I plug it out, it stays connected, but once I reset the modem and arduino it never connects again until I connect to the pc with usb cable and repeat the reset process.
The following are in place and have been tested:
- The pin is correct
- Used some diagnostics sketches and it displayed that it is connected to Vodacom-SA, which is correct. This tells me that the
arduino is correctly communicating with the gsm modem. - Signal strength is 27/32 or something. A really good number.
- The sim is allowed data and voice connections. It can send smses.
- the send sms sketch executes with no issue, but the sms is just never sent/received, i don't know.
- the sms.beginSMS(number) returns 0
- the sms.endSMS() returns a 0 as well
- the gsmAccess.begin(pin) returns a 3 or a 0 sometimes. <0 = IDLE and 3 = GSM_READY>
- I am sure the modem is running in synchronous mode, as when i change the mode to asynchronous, it never connects to the the carrier. Thus the above values fall under the values for asynchronous mode values.
I am sure there is someone out there whos sms's have gone through, please help me get my sms sent. I don't know where to look anymore, or what to look for.
Thanks
Sending an SMS is very simple.All you need is to write the right AT commands and make sure you are connecting it to the right softserial pins.
Note that the SIM900 and another modems need about 2 A when they are transmitting or receiving something.
Your usb port should not be able to deliver 2A so an external power is needed to power the modem.That is explicit described on the datasheet of the SIM900
On the code below adapt you sms number to where you want to send the sms, upload the code to the arduino, open your serial port on IDE and press t do send a message or d do dial to your number
This will give you an hint how you could handle it
Hope it helps
#include <SoftwareSerial.h>
//#include <String.h>
SoftwareSerial mySerial(2, 3);
void setup()
{
mySerial.begin(19200); // the GPRS baud rate
Serial.begin(19200); // the GPRS baud rate
delay(500);
}
void loop()
{
if (Serial.available())
switch(Serial.read())
{
case 't':
SendTextMessage();
break;
case 'd':
DialVoiceCall();
break;
}
if (mySerial.available())
Serial.write(mySerial.read());
}
///SendTextMessage()
///this function is to send a sms message
void SendTextMessage()
{
mySerial.print("AT+CMGF=1\r"); //Because we want to send the SMS in text mode
delay(100);
mySerial.println("AT + CMGS = \"+3519XXXXXXXX\"");//send sms message, be careful need to add a country code before the cellphone number
delay(100);
mySerial.println("A test message!");//the content of the message
delay(100);
mySerial.println((char)26);//the ASCII code of the ctrl+z is 26
delay(100);
mySerial.println();
}
///DialVoiceCall
///this function is to dial a voice call
void DialVoiceCall()
{
mySerial.println("ATD + +3519XXXXXXXX;");//dial the number
delay(100);
mySerial.println();
}
Hi, thanks for the reply.
Reading your post and your code, I have one question, one thing I have been wondering about the whole time.
I know GSM Modem interacts with the Arduino using the Software Serial library on pins 2 and 3, but my understanding is that the GSM library already uses the Software Serial calls when I call up GSM library code. Or am I wrong, must I program the software serial communication myself and GSM library does not use it?
I'll go and try the code you gave me and see what happens
Speak later again.
Oh, and I am using an external power supply of 5v 2.5A. I believe that should be enough, as per the technical specs?
I know GSM Modem interacts with the Arduino using the Software Serial library on pins 2 and 3, but my understanding is that the GSM library already uses the Software Serial calls when I call up GSM library code.
Your answer is inside the library.I believe it should be using it there inside in the constructor ...
I always use my modems without any library, I use direct AT commands to it.
Apart of that did you successful send the sms?
Oh, and I am using an external power supply of 5v 2.5A. I believe that should be enough, as per the technical specs?
It should be enough but if you want to make sure if that insert a amperimeter between you power supply and modem and measure how much amps does it drain when you are sending messages or receiving a call.
SIM900 based Phoneboard : Phoneboard http://1d7.1a9.myftpupload.com/wp-content/uploads/2015/01/5.jpg
SM5100b based Super Link shield & derivatives http://1d7.1a9.myftpupload.com/wp-content/uploads/2015/01/4.jpg
HugoPT:
Sending an SMS is very simple.All you need is to write the right AT commands and make sure you are connecting it to the right softserial pins.
Note that the SIM900 and another modems need about 2 A when they are transmitting or receiving something.
Your usb port should not be able to deliver 2A so an external power is needed to power the modem.That is explicit described on the datasheet of the SIM900
On the code below adapt you sms number to where you want to send the sms, upload the code to the arduino, open your serial port on IDE and press t do send a message or d do dial to your number
This will give you an hint how you could handle it
Hope it helps#include <SoftwareSerial.h>
//#include <String.h>
SoftwareSerial mySerial(2, 3);
void setup()
{
mySerial.begin(19200); // the GPRS baud rate
Serial.begin(19200); // the GPRS baud rate
delay(500);
}
void loop()
{
if (Serial.available())
switch(Serial.read())
{
case 't':
SendTextMessage();
break;
case 'd':
DialVoiceCall();
break;
}
if (mySerial.available())
Serial.write(mySerial.read());
}
///SendTextMessage()
///this function is to send a sms message
void SendTextMessage()
{
mySerial.print("AT+CMGF=1\r"); //Because we want to send the SMS in text mode
delay(100);
mySerial.println("AT + CMGS = "+3519XXXXXXXX"");//send sms message, be careful need to add a country code before the cellphone number
delay(100);
mySerial.println("A test message!");//the content of the message
delay(100);
mySerial.println((char)26);//the ASCII code of the ctrl+z is 26
delay(100);
mySerial.println();
}
///DialVoiceCall
///this function is to dial a voice call
void DialVoiceCall()
{
mySerial.println("ATD + +3519XXXXXXXX;");//dial the number
delay(100);
mySerial.println();
}
where to press t and d to make it send message and make call ....