How to send and receive SMS with GSM/GPRS & GPS shield

By on May 30, 2013
Pin It

 GSM shield_COP_s

This post is one in a series showing you the main features of the GSM /GPRS/GPS shield and of its related library. The examples are great to have inspiration and reuse the material to create your own solutions. We already talked about how to use the shield to make calls, send DTMF tones and check whether the sender of an incoming call and command was in the trusted phonebook.

This is possible thanks to the call.h class contained within the call management library. Here we will show you few examples about how to deal with SMS management. The sms.h file, shows you how to send a text message in correspondence to a particular condition or how to extrapolate the content of a received text message and how to interprete the commands contained within it.

 Download_GSM_library

EXAMPLE 1

Let’s start from a sketch that can be used to send a text message to a preset number in case an alarm condition is happening. This example is similar to the one we shown regarding placing calls, it has been obviously tweaked to send a text message instead of placing a call.

In this case, the triggering condition is reached when the Arduino board reads an analog value that is below to one that has been  preset as a threshold value and the notification is done by sending a text message.

As for each sketch concerning this shield, first thing to do is to include the library (in this case the sms.h file) and then instantiate an object. This procedure can be done with the following commands:

#include “sms.h”

SMSGSM sms;







Each function belonging to this class must be initialized as follows:

object_name.function_name(parameters)

In case the alarm status condition is verified, in order to send a message you simply call the following function:

sms.SendSMS(number,message);

The first parameter contains the message recipient, while the second one is the string containing the message body.

For example:

char message[]=“Hello world”;

char number[]=“3921234567”;

sms.SendSMS(number,message);

In this way the string “Hello world”  will be sent.

 In this example, in addition to sending the static string containing the warning message, we’ve also chosen to communicate the value that triggered the alarm condition: we must therefore transform the analog integer value read from the converter, in a string to be concatenated to the static one.

 

The function that takes care of this conversion is the on that follows:

 itoa(int integer, char* string, int base)

where base is usually 10 since we work in decimal base. If we were to work with numbers in different bases we just need to change this value as appropriate.

 

The function used to concatenate a string to another is:

strcat(char* string1, char* string2)

 

 







As said in the previous post, it is highly recommended to set a hysteresis or a low-pass filter to avoid repeatedly sending text messages in the case of oscillations around the threshold value.

In case you wish to add a message to communicate the return to the starting condition, you just need add the following piece of code before the update of the value_old variable.

 

 

gsm-shield-SIM908_s

EXAMPLE 2

Let’s have a look to the sketch used to interpret the commands received via text message. We’ll check the status of a digital output by sending simple text messages to the shield.

Will be possible, therefore, to give the Arduino some remote commands, by simply sending a text message.

To keep a minimum security level (in order to prevent unauthorized persons to execute commands) without imposing limitations to the sender number, the use of temporary password is provided.strstr(char* string, char* string2)

 

The first step is to check the presence of a new, unread, message and, in case, store the position in which it is stored on the SIM thanks to the following command:

sms.IsSMSPresent(SMS_UNREAD);

which returns an integer containing the position of the first unread message. If no new messages are found it will return 0.

To analyze the content you need to ‘open’ the message and read the contents.

sms.GetSMS((int)pos,number,message,180);

 The GetSMS function takes care of reading the message in the position shown and to save the sender number and the message body (up to a maximum of characters as indicated by the last parameter).

Once this is done you just need to control the text of the message to interpret the commands that have been sent.

First, we’ll verify that the password is contained in the message body (the password used in the examplse is ‘testpwd‘). To do this we’ll use the strstr(char* string, char* string2) function that checks if the second string passed is contained within the first, returning a pointer to the first character of the substring.

p=strstr(message,”testpwd”);

In case the substring is not present, a NULL pointer will be returned.

To verify the correct authentication simply insert the remaining code portion within the condition:

if(p){ […] }

Let’s recall that if(p) is equivalent to writing if (!=NULL).

At this point, when authentication is done, as done previously for the password, we’ll check the presence of predetermined command strings. Once we’ve got the message, we’ll proceed with the interpretation, by enabling or disabling the output.

Finally, we will delete the message, to avoid filling up the memory available on the SIM card. This will be done with the command:

sms.DeleteSMS((int)pos);

 

 gsm-shield-TDGGSM_900_s

EXAMPLE 3

As previously mentioned, we can provide authentication also by checking the sender.

In the same way as, in previous examples, we checked whether the sender of an incoming call was authorized, you can do the same operation with SMS sender.

sms.GetAuthorizedSMS((int)pos,number,message,180,8,10);

Saving the trusted contacts on the within a specific range of the SIM will be enough: we just need to check what’s returned by the function in which we pass the range using the last two parameters.

In this case the authorized number is saved between position 8 and position 10 (both included) of the SIM.

if(stat==GETSMS_AUTH_SMS){

Thanks to the previous condition we will enter the routine associated with the condition in which the SMS is received from a trusted number.

Differently from the previous case, in this example we will analyze a string containing the logic states (0 or 1) that must be set on the digital outputs (for example: “LEDCONF0000” or “LEDCONF1001” and so on.)

Using the substrings search function we will identify the command for the allocation of the states and then we will move forward analyzing it character by character and then setting the appropriate status to its output.

In this example, the “LEDCONF0000” string, sent to turn off all outputs, is composed of the first part (LEDCONF) that relates to the command type (in fact we could send different commands within a single message) and by a following part containining 0000 as the states to be set on the outputs ranging from 9 to 12.

Recalling that the search function, if successful, returns a pointer to the first character of the substring, you will need to move forward of a number of characters that is sufficient to reach the first value containing the information on the first output.

We’ll do this thanks to the strlen(char* string) function that gives back an integer with the length of the string passed as a parameter.

Then we translate the pointer of a number of characters that is equal to the length of the command:

p=p+strlen(“LEDCONF”);

In this way the p pointer will refer to the first numeric character.

will be sufficient to check if this is equal to 1 or 0 to activate or not the output to it associated with it.

if(p[0]==’1′)

For your convenience we will put everything in a loop equipped with some diagnostic messages (not strictly necessary) sent to the hardware serial port.

As we did before, at the end of the cycle we first delete the SMS and then add a a few seconds delay to avoid making continuous queries to the shield.

 

 







EXAMPLE 4

In this last example we chosen to create a sketch using both the classes we created: that for the management of phone calls and that to manage SMS.

Upon the reception of a call from a trusted number, the program will check the status of the inputs (digital ones have been chosen but you can be easily extend to analog ones) and will communicate this information through an SMS to a specified number.

Since this sketch uses functions already explained in this and in the previous article, we will just post the code without explaining in detail each step.

 

About Boris Landoni

Boris Landoni is the technical manager of Open-Electronics.org. Skilled in the GSM field, embraces the Open Source philosophy and its projects are available to the community.

99
Leave a Reply

avatar
57 Comment threads
42 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
50 Comment authors
sayeodi aliShaira GarciaJeff in 92833cafunhatviettin Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
trackback

[…] This post is one in a series showing you the main features of the GSM /GPRS/GPS shield and of its related library. The examples are great to have inspiration and reuse the material to create your own solutions.  […]

trackback

[…] How to send and receive SMS with GSM/GPRS & GPS shieldPosted 12 days ago […]

trackback

[…] examples related to the GSM/GPRS & GPS shield. In previous posts we have seen how to handle SMS, make calls and use the GPRS connection to send email  or download data from Internet […]

Filippos
Guest
Filippos

Hi there,

I keep getting this error:

Trying to force the baud-rate to 9600

ERROR: SIM900 doesn’t answer. Check power and serial pins in GSM.cpp

status=IDLE

I am using the GSM shield sold by OpenElectronics and your code but nothing seems to work! I changed 6 arduino Uno and tried 3 different power supply units.

Any Idea why it doesn’t work

Thanks in advance

BorisLandoni
Guest
BorisLandoni

Have you chose the soft serial?
There are two jumper to select hardware serial or soft.
Please select soft

Kostas
Guest
Kostas

Hello there,I try example2 and wrks perfect.But when ill try to change the pin number that i want to make HIGH, nothing happent.For example if I change pin13 to pin12 on pin12 i havent HIGH when I send sms.Any saggestions?
Wait answer asap.
Have a nice day.
Kostas

BorisLandoni
Guest
BorisLandoni

Try to set the pin as output
pinMode(12,OUTPUT);

Nazmul Hasan Pias
Guest
Nazmul Hasan Pias

Hi , I’m a beginner . I want to use your library without aurduino , in any avr microcontroller using available compilers . How can I do this ?

4routing (ADMIN)
Guest
4routing (ADMIN)

did you implement something on atmega?

Tom
Guest
Tom

Hi there,

I can send SMS messages but whenever I try and read a new SMS it doesn’t return the text message (it returns nothing at all). The GetSMS function returns GETSMS_OTHER_SMS. I know the message is on the phone as I can put the SIM in a standard phone and it shows up. Any ideas?

Martin
Guest
Martin

I have the same problem, but when I active DEBUG it prints one message over and over again.

How do I fix this?

Martin
Guest
Martin

I ended up using this code; char position; char phone_num[20]; // array for the phone number string char sms_text[15]; // array for the SMS text string if (started){ position = 1; if (position) { // there is new SMS => read it sms.GetSMS(position, phone_num, sms_text, 100); /* #ifdef DEBUG_PRINT sms.DebugPrint(“DEBUG SMS phone number: “, 0); sms.DebugPrint(phone_num, 0); sms.DebugPrint(“rn SMS text: “, 0); sms.DebugPrint(sms_text, 1); #endif*/ }} Since I was only looking for one message thats always the first one. It contains settings for gprs.

karlcedrick
Guest
karlcedrick

what programming tool is used in developing the program?

BorisLandoni
Guest
BorisLandoni

? Arduino IDE

Juan Alexis Vidal Gonzales
Guest
Juan Alexis Vidal Gonzales

I’m connecting a gps and sd card ublox whith gprs shield (separated work well) and together the gprs shield does not turn on, please help

BorisLandoni
Guest
BorisLandoni

Be sure that the memory doesn’t overflow

Martín
Guest
Martín

Hello, I need some help please.
I’m trying to get to work example 2 without success.
I tried with a power supply of 12 V @ 1,5 A and the jumper are configured as software serial.
Is it possible obtain a detailed step by step to check this shield and get to work example 2?
Thanks in advance for your help.
Best regards

BorisLandoni
Guest
BorisLandoni

The other examples work?
What the problem?

Martín
Guest
Martín

Hi Boris, I tried example 4 too without success.
The problem is I have no idea why doesnt work, there is no response from the shield and Arduino Uno.
There is anything I can do in order to check the shield?
There is a guide step by step in order to make work these shield with example 2 or 4?
Merry christmas by the way!!!
Thank for your help.
Regards

BorisLandoni
Guest
BorisLandoni

Check the power, the serial connection anche the library installation.
The compiler works?

Martín
Guest
Martín

The power supply is 12V 1.5 A.
The jumper are configured as software serial.
The library is OK and the compiler work fine, without errors.
This shield came with a guide in italian, that I cant understand.
How I can activate the DEBUG? and where I can see what’s happening.
Do you have any ideas?
Thanks!!!

BorisLandoni
Guest
BorisLandoni

From the terminal you can see the debug.
You can also enable other debug message modifing the library

Martín
Guest
Martín

Hi Boris, Now I can see the debug in the serial monitor.
I tried example 3, from call examples, and works very good.
Thanks for your help.
Best regards

Murad Hijjawe
Guest
Murad Hijjawe

How to program the arduino uno with gsm/gprs sim900A which I am connecting the following sensors to them :
1- tech sensor
2- temp. sensor
3-co2 sensor
4-pulse sensor
please ?

benzon sunday
Guest
benzon sunday

Hello, I’m a student and currently building my design project. I want to ask if i can use AT commands while using the library?. For example i want to check the battery level, I want to issue AT command to the SIM908 : gsm.println(“AT+CBC”). Is this possible? thank you. This post is very helpful, i’ve learned a lot.

BorisLandoni
Guest
BorisLandoni

Hi, yes of course, in the examples you can find a sketch to do that

Julia Pérez del Río
Guest
Julia Pérez del Río

Hi, Boris Firstly, I wanted to congratulate you on your wonderful posts, they are very clear and easy to follow! Secondly, I wanted to ask you a few questions. I have a customer who wanted to make voice calls from the location of its installation, in case an alarm happened. So I don’t need the ability to make a lost call, but to be able to perform a real conversation. I understand that with the GSM/GPRS & GPS Shield and the SIM900 or SIM908 it’s possible, right? The Arduino can be powered to the installation’s power, but in case of… Read more »

BorisLandoni
Guest
BorisLandoni

Hi,
With both SIM900 and SIM908 you can perform audio comunication, but only SIM908 includes can manage the battery.
You can add an external battery to the shield but not controlled by SIM90x.
The shield can be used with UNO, 2009, mega. We tested these devices.

Julia Pérez del Río
Guest
Julia Pérez del Río

Great, thanks for your answer! I was thinking of buying the 1A lithium battery charging module with a Polymeter Lithium Ion Battery. I understand that this can only be done with the SIM908, right?
But if I power my Arduino with the 1A lithium battery charging module and then the shiedl through the Arduino? Would I be able to use the SIM900 then?

Bhanu teja
Guest
Bhanu teja

Hey, I brought Sim900 module from local store. Trying to use your library with MEGA, Changed library for MEGA’s compatibility but no Response,
Connecting it to pins 2 & 3 of mega and also to 4 & 5

Getting this error:

DB:NO RESP

DB:NO RESP

Please help!!

BorisLandoni
Guest
BorisLandoni

Are you using our shield?

DeanSaunders
Guest
DeanSaunders

I had the same problem. I solved it with more volt (9v), and less serial speed (9600)

Gordon
Guest
Gordon

Hi Boris

I have the GPRS Shield V2.0 and the Intel Galileo Board, I need to receive an sms to

my GPRS Shield and be able to recognize the number of the sender and the body of

the message.

How can I do it?

I tried to use the sotwareserial but it doesn’t work on Galileo.

BorisLandoni
Guest
BorisLandoni
Shahanaz babu
Guest
Shahanaz babu

no matching function for call to ‘SMSGSM::GetSMS(int, char [11], char [180], int)’

Carvelle Smith
Guest
Carvelle Smith

Boris, Please Help, bought the Arduino UNO R3 SIM908 and the GSM/GPRS and GPS shield a month ago. But now we can’t even get Exmaple 2 on your demonstration to work. when we send an sms for the 1st time, it turns on the Lamp, but when we try to send LEDOFF, the arduino freezes and prints out this junk on the serial monitor:

ATT: OK

RIC: ààààààðààààààðàààààààààààðààààààðààààààààààðàààààààààààðààààààààðàààààààààðàààààààààààààààààððààààààààààðààààààðàààààààààààðààààààðààààààààààðàààààààààààðààààààààðààààààààðààààààààààààààààààðààààààààà

when we doing the test, both the USB and external 12VDC are plugged in. What are we doing wrong, Please help

BorisLandoni
Guest
BorisLandoni

Hi, Are you using our shield?
The power supply?

Ankit
Guest

Hi,
If a message is sent to a GSM module interfaced with a micro-controller through UART, can the information about the message (text, number) be read on the UART lines? Is it possible to wake the MCU after receiving any message?

BorisLandoni
Guest
BorisLandoni

There is a function to get the Sender and the Message.
You have to call this function

supra footwear usa
Guest

thank you for share!

air max 90 cheap
Guest

thanks for share!

jordan baby
Guest

nice articles

ysl downtown bag
Guest

thank you for share!

buy christian louboutin
Guest

thanks for share!

christian louboutin cheap
Guest

good articles

cheap louboutin
Guest

nice articles

jordan outlet
Guest

thank you for share!

Chathuranga
Guest
Chathuranga

Hi.. an example code on the library gives this error ” avrdude: stk500_getsync(): not in sync: resp=0x00 ”

what is this about.. please help me…

BorisLandoni
Guest
BorisLandoni

This is a comunication problem. Not due to library

Siddharth
Guest
Siddharth

Disconnect your gsm module with arduino and then upload the code.

sayeodi ali
Guest
sayeodi ali

plz how u fix this error?

Adrian Sima
Guest
Adrian Sima

Hello Boris, Problem: I can not use the shield, neither the small breakout to send an SMS. Description: I have Arduino UNO. I have purchased http://www.open-electronics.org/small-breakout-for-sim900-gsm-module/ and the shield that works with this breakout. I tried the library you provide but it keeps on reseting, which is a know issue due to insuficient memory capacity. The next thing I tried is to open up a software serial communication using this code: #include SoftwareSerial SIM900(2, 3); void setup() { SIM900.begin(19200); SIM900power(); delay(20000); // give time to log on to network. } void SIM900power() // software equivalent of pressing the GSM shield… Read more »

BorisLandoni
Guest
BorisLandoni

And the current of the power supply?
You need >1A

Enrique Ramirez
Guest
Enrique Ramirez

Hello Boris, please how I can pass the gsm.SimpleRead() to an string variable. I want display this value on lcd.

Velt
Guest
Velt

Hello Boris, I’ve tried your code on example2, it compiled successfully but nothing was shown in the serial monitor…can you please guide me, Im new in this programming and Id be greatful if you help me, thank you in advance

Velt
Guest
Velt

Ive tried and tried but nothing is shown in the serial monitor, im using your code on example2

BorisLandoni
Guest
BorisLandoni

Other examples works?

samrat
Guest
samrat

hi guys i m making my semester project fingerprint and gsm lock it is not working properly finger print works great but mu gsm in put is not working nice once i start the audrino. Gsm works nice after that when program runs another time it wont work can any one tell me how to check conditions again and again and plz dont say that us if else condition

Tor Ocsalev
Guest
Tor Ocsalev

Why am I getting this? right pin allocations and right volts and amperes. At first I used the readSMS commad and I did not get this from my serial monitor. It was able to go status=ready but keeps on complaining that I should use the GetSMS. When I used the GetSMS, this is what I got. WHY?

GSM Shield testing.
DB:NO RESP
DB:NO RESP
DB:NO RESP
Trying to force the baud-rate to 9600

1200
2400
4800
9600
19200
38400
57600
115200
ERROR: SIM900 doesn’t answer. Check power and serial pins in GSM.cpp

status=IDLE

BorisLandoni
Guest
BorisLandoni

Power supply?

Siddharth
Guest
Siddharth

Hi,

I am getting the same serial output.
The power is correct.
Also, to change the pins in GSM.cpp, I opened that file in dev c++ and changed the pins and saved it.

Is that the right way to do it?

Regards

Tom
Guest
Tom

Hi,

I got the same output too.
I’ve followed every single steps with the help of youtube videos, but still no luck.
Btw, i can use adruino mega without a problem.
But my project need to use arduino uno instead.
any help will be much appreciated.

Thanks

BorisLandoni
Guest
BorisLandoni

Sorry for my late.
With Mega it works?
For uno check the setting beacuse Mega use the Serial Hardware and UNO the soft serial.
Also I suggest you to use the softserial from the distribution, not from the Arduino IDE

eva
Guest
eva

Hi,

Me too got the some output. i use arduino uno.
however, i didnt face any problem when i use arduino mega.
i followed all the steps provided. i use 9V/2A adapter.

looking forward for you kind help..thanks

Abhimanyu Muraleedhara Warrier
Guest
Abhimanyu Muraleedhara Warrier

pls help me..my project is access control system,if un authorized entry is detected(by RFID & PIC),i just want to send a sms from SIM900A. how can i do it ???

Nazmul Hasan Pias
Guest
Nazmul Hasan Pias

you can use this function to send sms , its simple . you need to connect your gsm modem with arduino via TX and RX pin or you can also use software Serial library for doing this . void send_sms( char *m , char *cm ) { Serial.println(cm); delay(300); Serial.println(m); Serial.write(26); delay(300); }

Dan G.
Guest
Dan G.

Hi,

I uploaded GSM_GPRSLibrary_SMS.ino on my Arduino Uno.

I have an issue, after module is ready (status=READY), I receive in continuous mode (in serial monitor), the following lines:

This method is deprecated! Please use GetSMS in the SMS class.
ATT: +CMGL
RIC:
OK

And I’m not able to send any other commands. Any Idea?

The GPS library is working well!

Vineeth Cherupalath Illam
Guest
Vineeth Cherupalath Illam

Can Any one post the MikroC code for sim900a with pic16f877a to send message and recieve msg???
kindly help

Rahul Maheshwari
Guest
Rahul Maheshwari

hello, my question is through any at command send sms to all in which number stored in sim memory

Siddharth
Guest
Siddharth

Hi,

I tried using the code that you have posted but got the following error –

sketch_apr07a.cpp.o: In function __static_initialization_and_destruction_0':

/Streaming.h:27: undefined reference to LOG::LOG(int)’

sketch_apr07a.cpp.o: In function loop':

C:UsersnishantAppDataLocalTempbuild3685541356291295312.tmp/sketch_apr07a.cpp:70: undefined reference to gsm’

C:UsersnishantAppDataLocalTempbuild3685541356291295312.tmp/sketch_apr07a.cpp:70: undefined reference to gsm'

C:UsersnishantAppDataLocalTempbuild3685541356291295312.tmp/sketch_apr07a.cpp:70: undefined reference to SIMCOM900::read()’

sketch_apr07a.cpp.o: In function setup':

C:UsersnishantAppDataLocalTempbuild3685541356291295312.tmp/sketch_apr07a.cpp:40: undefined reference to gsm’

C:UsersnishantAppDataLocalTempbuild3685541356291295312.tmp/sketch_apr07a.cpp:40: undefined reference to gsm'

C:UsersnishantAppDataLocalTempbuild3685541356291295312.tmp/sketch_apr07a.cpp:40: undefined reference to GSM::begin(long)’

C:UsersnishantAppDataLocalTempbuild3685541356291295312.tmp/sketch_apr07a.cpp:52: undefined reference to InetGSM::attachGPRS(char*, char*, char*)'

C:UsersnishantAppDataLocalTempbuild3685541356291295312.tmp/sketch_apr07a.cpp:60: undefined reference to InetGSM::httpGET(char const*, int, char const*, char*, int)’

Can you please help me out?

Thanking you

Siddharth
Guest
Siddharth
BorisLandoni
Guest
BorisLandoni

have you installed the library?

Have you create a roght folder?

I see: C:UsersnishantAppDataLocalTempbuild3685541356291295312.tmp …………

Siddharth
Guest
Siddharth

Hi,

I downloaded the zip folder from this link https://github.com/MarcoMartines/GSM-GPRS-GPS-Shield

I have downloaded it in the libraries folder and imported the library from sketch–>import library

What is roght folder?

M Hilmi Shah
Guest
M Hilmi Shah

hi,,i don’t know what to say..there are these errors when i’m compiling the example..what should i do?? :(

Murad Hijjawe
Guest
Murad Hijjawe

How to program the arduino uno with gsm/gprs sim900A which I am connecting the following sensors to them :
1- tech sensor
2- temp. sensor
3-co2 sensor
4-pulse sensor
please ?

mehdi
Guest
mehdi

I try with example 2 but when I send an sms to the module sim900 I only receive in serial monitoring consul 0 over and over…….why I can not receive sms with that …..other function is perfect

Deepak CG
Guest
Deepak CG

Trying to force the baud-rate to 9600

ERROR: SIM900 doesn’t answer. Check power and serial pins in GSM.cpp

status=IDLE

why the serial monitor gives this

Michael Kimollo
Guest
Michael Kimollo

The most possible cause would be RX and TX pin serial pin configurations in GSM.cpp,

If you are using UNO, try to change these two line from GSM.cpp

#define _GSM_TXPIN_ 2 ——-> #define _GSM_TXPIN_ 7

#define _GSM_RXPIN_ 3 ——–> #define _GSM_RXPIN_ 8

Then tell me how it responds!!

wooja kurosaki
Guest
wooja kurosaki

good day sir! i tried to display the text that the GSM shield sends out on the serial monitor. the output was this

+CMT: “+639XXXXXXXX”,””,”16/03/02,8:31:09:+32″
hello world

what does +32 mean? and where is it from?

franck Moussounda
Guest
franck Moussounda

Hi! i want to send a int data with sms gsm shield SIm900. i send the first message but i don’t send the value with itoa function; please could you help me #include “SIM900.h” #include “SoftwareSerial.h” #include “sms.h” SMSGSM sms; #include “call.h” CallGSM call; #include “GSM.h” int numdata; boolean started=false; char smsbuffer[160]; char n[20]; char sms_position; char phone_number[20]; char sms_text[600]; int i; char P1_apres_cpr_str [6]; char P2_apres_secheur_str[6]; char P3_apres_filtre_str[6]; int analogPin5=A0; int analogPin6=A1; int analogPin7=A5; int analogValue5=0; int analogValue6=0; int analogValue7=0; int P1_apres_cpr=0; int P2_apres_secheur=0; int P3_apres_filtre=0; int voltageP1=0; int voltageP2=0; int voltageP3=0; unsigned long previousTime=0; unsigned long interval1=140000; unsigned… Read more »

franck Moussounda
Guest
franck Moussounda

Hi!, so i want to send to multiple receiver. It’s possible to send in same time the same sms to multple receivers?

franck Moussounda
Guest
franck Moussounda

How i can send to multiple receivers in the same time?

Bo Herrmannsen
Guest
Bo Herrmannsen

sms.SendSMS(number1,message);
sms.SendSMS(number2,message);
……

you get the idea…. just change the number you want to send to

Ronnel
Guest
Ronnel

Hi sir Good Day! im having a difficulty on the code that you have provided above.. it says…(picture below).. i have used the library from https://github.com/MarcoMartines/GSM-GPRS-GPS-Shield
hoping to get your reply

Ronnel
Guest
Ronnel

i have used your example 2 bdw

Bo Herrmannsen
Guest
Bo Herrmannsen

arduino ide has a GSM lib and you need to remove that one first

this is just a guess :-D

Muhammad Usman Khan
Guest
Muhammad Usman Khan

where is the Library sms.h. means from where to download?

Bo Herrmannsen
Guest
Bo Herrmannsen
trackback

[…] نوشته اصلی توسط peyman180 سلام کسی کد دریافت sms توسط sim900a رو داره ؟؟؟؟؟؟ این تاپیک رو مطالعه کنید: How to send and receive SMS with GSM/GPRS & GPS shield | Open Electronics […]

Bo Herrmannsen
Guest
Bo Herrmannsen

Hi

Got the shield and want to build a remote control with it

i use example 3 to start with and i wonder what the purpose of this line is:

char number[]=”3921234567″;

the sketch use pos 8 to 10 to auth what numbers are allowed

so why the need to supply the sketch with a phone number

Bo Herrmannsen
Guest
Bo Herrmannsen

stat=sms.GetAuthorizedSMS((int)pos,number,message,180,8,10);

that one gives the error:

no matching function for call to ‘SMSGSM::GetAuthorizedSMS(int, char [11], char [180], int, int, int)

taken from example 3

em ef
Guest
em ef

Hi.
On example 2, when i sends testpwd LEDON, it turns on, but when i sends testpwd LEDOFF, it doesnt turn off, and in serial moitor, no more NUOVO MESSAGGIO, POS=, and no PSWD OK, only at first message it works.
I need some help, thanks.
..