Getting Errors even though I downloaded sample code...NEED HELP ASAP PLZ!

so i am using a gsm shield sim900 with a tmobile sim card and an arduino uno...I used the SMS Sender code from this youtube link: Arduino Tutorial: GSM/GPRS SHIELD (SIM900) SMS Send and Receive Tutorial on Arduino Uno - YouTube

However I get these errors liste below. IF YOU COULD PLEASE HELP ME ASAP I WOULD GREATLY APPRECIATE IT!

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino: In function 'void setup()':

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino:49:54: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

if (sms.SendSMS("+19569758590", "Arduino SMS"))

^

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino:49:54: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino: In function 'void loop()':

SMSSender:69: error: no matching function for call to 'SMSGSM::GetSMS(char&, char [20], char [100], int)'

sms.GetSMS(sms_position, phone_number, sms_text, 100);

^

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino:69:65: note: candidate is:

In file included from C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino:8:0:

C:\Users\Saad\Documents\Arduino\libraries\GSM-GPRS-GPS-Shield-GSMSHIELD/sms.h:12:11: note: char SMSGSM::GetSMS(byte, char*, byte, char*, byte)

char GetSMS(byte position, char *phone_number,byte max_phone_len, char *SMS_text, byte max_SMS_len);

^

C:\Users\Saad\Documents\Arduino\libraries\GSM-GPRS-GPS-Shield-GSMSHIELD/sms.h:12:11: note: candidate expects 5 arguments, 4 provided

exit status 1
no matching function for call to 'SMSGSM::GetSMS(char&, char [20], char [100], int)'

I'd love to help you, but you didn't post your code.

candidate expects 5 arguments, 4 provided

Seems pretty clear to me.

here is my code:

#include <call.h>
#include <gps.h>
#include <GSM.h>
#include <HWSerial.h>
#include <inetGSM.h>
#include <LOG.h>
#include <SIM900.h>
#include <sms.h>
#include <Streaming.h>
#include <WideTextFinder.h>

//////////////////////////////////////////////
// Arduino GSM SHIELD SMS //
// Tutorial by //
// http://www.educ8s.tv //
/////////////////////////////////////////////

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"
SMSGSM sms;

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];

char sms_position;
char phone_number[20];
char sms_text[100];
int i;

void setup()
{
Serial.begin(9600);

if (gsm.begin(9600))
{
Serial.println("\nstatus=READY");
started=true;
}
else
Serial.println("\nstatus=IDLE");

if(started)
{
if (sms.SendSMS("+19569758590", "Arduino SMS"))
{
Serial.println("\nSMS sent OK.");
}
else
{
Serial.println("\nError sending SMS.");
}
}
};

void loop()
{
if(started)
{
sms_position=sms.IsSMSPresent(SMS_UNREAD);
if (sms_position)
{
Serial.print("SMS postion:");
Serial.println(sms_position,DEC);
sms.GetSMS(sms_position, phone_number, sms_text, 100);
Serial.println(phone_number);
Serial.println(sms_text);
}
delay(2000);
}
};

If you look at the example code you based your sketch on, you need to compare the call to the GetSMS function in the example with your call to the same function.

The compiler has already given you plenty of clues.

so would i add call into this code: sms.GetSMS(sms_position, phone_number, sms_text, 100);

i am sorry but i am a complete beginner at this :cry:

That's just four arguments again (count them), and the compiler doesn't like it.

Ok so my goal here is to try to text and call a number by the way lol.

So I updated my code:

#include <call.h>
#include <gps.h>
#include <GSM.h>
#include <HWSerial.h>
#include <inetGSM.h>
#include <LOG.h>
#include <SIM900.h>
#include <sms.h>
#include <Streaming.h>
#include <WideTextFinder.h>

//////////////////////////////////////////////
// Arduino GSM SHIELD SMS //
// Tutorial by //
// http://www.educ8s.tv //
/////////////////////////////////////////////

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"
#include <call.h>
SMSGSM sms;

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];

char sms_position;
char phone_number[20];
char sms_text[100];
int i;

void setup()
{
Serial.begin(9600);

if (gsm.begin(9600))
{
Serial.println("\nstatus=READY");
started=true;
}
else
Serial.println("\nstatus=IDLE");

if(started)
{
if (sms.SendSMS("+19569758590", "Arduino SMS"))
{
Serial.println("\nSMS sent OK.");
}
else
{
Serial.println("\nError sending SMS.");
}
}
};

void loop()
{
if(started)
{
sms_position=sms.IsSMSPresent(SMS_UNREAD);
if (sms_position)
{
Serial.print("SMS postion:");
Serial.println(sms_position,DEC);
sms.GetSMS(call, sms_position, phone_number, sms_text, 100);
Serial.println(phone_number);
Serial.println(sms_text);
}
delay(2000);
}
};

and got a different error this time; if you could adress each problem i would greatly appreciate it...i am very sorry for this trouble. Following shows error messages:

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino: In function 'void setup()':

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino:50:54: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

if (sms.SendSMS("+19569758590", "Arduino SMS"))

^

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino:50:54: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino: In function 'void loop()':

SMSSender:70: error: 'call' was not declared in this scope

sms.GetSMS(call, sms_position, phone_number, sms_text, 100);

^

exit status 1
'call' was not declared in this scope

You have one error - the others are warning.

The code has a byte variable called "call", but you haven't defined it.
Look again at the example and see how "call" is defined and used.

It may even be a function returning byte.

ah ok

so in the example, i dont think call was used but I am trying to do it by myself

what if I just wanted to send SMS for the first part...like i would like to get that part configured first before going to call...what do i need to do for the sneding messages to work

I have absolutely no idea - I don't have your hardware, so I don't have the library either

can i send the code for just the SMS and you can let me know what I am doing wrong?

so this is code for just sms:

//////////////////////////////////////////////
// Arduino GSM SHIELD SMS //
// Tutorial by //
// http://www.educ8s.tv //
/////////////////////////////////////////////

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"
SMSGSM sms;

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];

char sms_position;
char phone_number[20];
char sms_text[100];
int i;

void setup()
{
Serial.begin(9600);

if (gsm.begin(9600))
{
Serial.println("\nstatus=READY");
started=true;
}
else
Serial.println("\nstatus=IDLE");

if(started)
{
if (sms.SendSMS("+19569758590", "Arduino SMS"))
{
Serial.println("\nSMS sent OK.");
}
else
{
Serial.println("\nError sending SMS.");
}
}
};

void loop()
{
if(started)
{
sms_position=sms.IsSMSPresent(SMS_UNREAD);
if (sms_position)
{
Serial.print("SMS postion:");
Serial.println(sms_position,DEC);
sms.GetSMS(sms_position, phone_number, sms_text, 100);
Serial.println(phone_number);
Serial.println(sms_text);
}
delay(2000);
}
};

and i get this error:

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino: In function 'void setup()':

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino:39:54: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

if (sms.SendSMS("+19569758590", "Arduino SMS"))

^

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino:39:54: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino: In function 'void loop()':

SMSSender:59: error: no matching function for call to 'SMSGSM::GetSMS(char&, char [20], char [100], int)'

sms.GetSMS(sms_position, phone_number, sms_text, 100);

^

C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino:59:65: note: candidate is:

In file included from C:\Users\Saad\Desktop\EDD\SMSSender\SMSSender.ino:12:0:

C:\Users\Saad\Documents\Arduino\libraries\GSM-GPRS-GPS-Shield-GSMSHIELD/sms.h:12:11: note: char SMSGSM::GetSMS(byte, char*, byte, char*, byte)

char GetSMS(byte position, char *phone_number,byte max_phone_len, char *SMS_text, byte max_SMS_len);

^

C:\Users\Saad\Documents\Arduino\libraries\GSM-GPRS-GPS-Shield-GSMSHIELD/sms.h:12:11: note: candidate expects 5 arguments, 4 provided

Multiple libraries were found for "SIM900.h"
Used: C:\Users\Saad\Documents\Arduino\libraries\SIM900
Not used: C:\Users\Saad\Documents\Arduino\libraries\GSM-GPRS-GPS-Shield-GSMSHIELD
exit status 1
no matching function for call to 'SMSGSM::GetSMS(char&, char [20], char [100], int)'

i copied exactly from the video example i dont know why i am getting an error?

We seem to be back where we started.
The function GetSMS expects/requires five arguments, and you're giving it four.

how can i get it to only require four arguments or what is the fifth argument that i need to add?

Please, just post the example code you based this on, but please use code tags this time.

this is the link for the example code i used: http://educ8s.tv/arduino-gsm-shield/

the example code is in there unless you want me to post it here though i do not know how to used code tags

#include "SIM900.h" #include #include "sms.h" SMSGSM sms;

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];

char sms_position;
char phone_number[20];
char sms_text[100];
int i;

void setup()
{
Serial.begin(9600);

if (gsm.begin(9600))
{
Serial.println("\nstatus=READY");
started=true;
}
else
Serial.println("\nstatus=IDLE");

if(started)
{
if (sms.SendSMS("+300000000000", "Arduino SMS"))
{
Serial.println("\nSMS sent OK.");
}
else
{
Serial.println("\nError sending SMS.");
}
}
};

void loop()
{
if(started)
{
sms_position=sms.IsSMSPresent(SMS_UNREAD);
if (sms_position)
{
Serial.print("SMS postion:");
Serial.println(sms_position,DEC);
sms.GetSMS(sms_position, phone_number, sms_text, 100);
Serial.println(phone_number);
Serial.println(sms_text);
}
delay(2000);
}
};

Where did you get the library?

Please try to use code tags - it ensures that we can see what you can see.
Their use IS documented - it isn't hard.

so i tried using the library that they gave in that link but i dont know if it works because their gsm maker is tinysine while mine is SIMCOM. Do you think that could be the problem?

also i used this random library: GitHub - MarcoMartines/GSM-GPRS-GPS-Shield: GSM/GPRS & GPS Shield Library for modules using SIM900/SIM908

but i am still getting the same error

Here's the example code for the library I asked you to post earlier.
Look, five arguments.

#include "SIM900.h"
#include <SoftwareSerial.h>
//If not used, is better to exclude the HTTP library,
//for RAM saving.
//If your sketch reboots itself proprably you have finished,
//your memory available.
//#include "inetGSM.h"

//If you want to use the Arduino functions to manage SMS, uncomment the lines below.
#include "sms.h"
SMSGSM sms;

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//www.open-electronics.org
//this code is based on the example of Arduino Labs.

//Simple sketch to send and receive SMS.

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];

void setup()
{
     //Serial connection.
     Serial.begin(9600);
     Serial.println("GSM Shield testing.");
     //Start configuration of shield with baudrate.
     //For http uses is raccomanded to use 4800 or slower.
     if (gsm.begin(2400)) {
          Serial.println("\nstatus=READY");
          started=true;
     } else Serial.println("\nstatus=IDLE");

     if(started) {
          //Enable this two lines if you want to send an SMS.
          //if (sms.SendSMS("3471234567", "Arduino SMS"))
          //Serial.println("\nSMS sent OK");
     }

};

void loop()
{
     if(started) {
          //Read if there are messages on SIM card and print them.
        /**  deprecated method
        if(gsm.readSMS(smsbuffer, 160, n, 20)) {
               Serial.println(n);
               Serial.println(smsbuffer);
          }
          **/
          //get 1st sms
          sms.GetSMS(1,n,20,smsbuffer,160);
          Serial.println(n);
          Serial.println(smsbuffer);
          
          delay(1000);
     }
};

so i copied the code into a new program and I got a bunch load of errors that i cant past them all:

here are some of them:

libraries\SIM900\SIM900.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\GSM-GPRS-GPS-Shield-GSMSHIELD\SIM900.cpp.o (symbol from plugin): In function `SIMCOM900::forceON()':

(.text+0x0): multiple definition of `GSM::ComparePhoneNumber(unsigned char, char*)'

libraries\SIM900\SIM900.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\GSM-GPRS-GPS-Shield-GSMSHIELD\SIM900.cpp.o (symbol from plugin): In function `SIMCOM900::forceON()':

(.text+0x0): multiple definition of `SIMCOM900::configandwait(char*)'

libraries\SIM900\SIM900.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\GSM-GPRS-GPS-Shield-GSMSHIELD\SIM900.cpp.o (symbol from plugin): In function `SIMCOM900::forceON()':

(.text+0x0): multiple definition of `SIMCOM900::readCellData(int&, int&, long&, long&)'

libraries\SIM900\SIM900.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\GSM-GPRS-GPS-Shield-GSMSHIELD\SIM900.cpp.o (symbol from plugin): In function `SIMCOM900::forceON()':

(.text+0x0): multiple definition of `SIMCOM900::read()'

libraries\SIM900\SIM900.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\GSM-GPRS-GPS-Shield-GSMSHIELD\SIM900.cpp.o (symbol from plugin): In function `SIMCOM900::forceON()':

(.text+0x0): multiple definition of `SIMCOM900::SimpleRead()'

libraries\SIM900\SIM900.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\GSM-GPRS-GPS-Shield-GSMSHIELD\SIM900.cpp.o (symbol from plugin): In function `SIMCOM900::forceON()':

(.text+0x0): multiple definition of `SIMCOM900::available()'

libraries\SIM900\SIM900.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\GSM-GPRS-GPS-Shield-GSMSHIELD\SIM900.cpp.o (symbol from plugin): In function `SIMCOM900::forceON()':

(.text+0x0): multiple definition of `SIMCOM900::read(char*, int)'

Multiple libraries were found for "SIM900.h"
libraries\SIM900\SIM900.cpp.o (symbol from plugin):(.text+0x0): first defined here

Used: C:\Users\Saad\Documents\Arduino\libraries\SIM900
Not used: C:\Users\Saad\Documents\Arduino\libraries\GSM-GPRS-GPS-Shield-GSMSHIELD
libraries\GSM-GPRS-GPS-Shield-GSMSHIELD\SIM900.cpp.o (symbol from plugin): In function `SIMCOM900::forceON()':

(.text+0x0): multiple definition of `SIMCOM900::WhileSimpleRead()'

libraries\SIM900\SIM900.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

Error messages but no code.
Useless