Go Down

Topic: sim900 library (Read 19240 times) previous topic - next topic

merci


I tried to send sms and reply using the serila monitor, but it doesn't work,, I added the library but it still don't
I followed a tutorial from youtube
here is the attachment (the error and library)

how about the library name??
does we can named it everything we want (for the zip file)???

please help me,,
I am new in arduino...

dannable

#1
Jun 28, 2015, 03:45 pm Last Edit: Jun 28, 2015, 03:47 pm by dannable
You haven't included your code so the following is based on assumptions!

First assumption is that you are using a SIM900 based shield, not the official Arduino one, which uses an M10 chip.

Unpack that file to a folder in your libraries folder. Rename the folder GSM_Shield.

That library is quite old, intended for use with compilers pre 1.0, so edit the file GSM_Shield.cpp and replace the line
Code: [Select]
#include "WProgram.h"
with
Code: [Select]
#include <Arduino.h>

At the top of your code, in stead of #include <SIM900.h> add

Code: [Select]
#include <GSM_Shield.h>

and then declare an instance:

Code: [Select]
GSM_Shield sms;
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

merci

hello, thanks for your reply, but I still really confused about:
you said:
Quote
You haven't included your code so the following is based on assumptions!

First assumption is that you are using a SIM900 based shield, not the official Arduino one, which uses an M10 chip.

Unpack that file to a folder in your libraries folder. Rename the folder GSM_Shield.

That library is quite old, intended for use with compilers pre 1.0, so edit the file GSM_Shield.cpp and replace the line

#include "WProgram.h"

with

#include <Arduino.h>


At the top of your code, in stead of #include <SIM900.h> add


#include <GSM_Shield.h>


and then declare an instance:


GSM_Shield sms;
  • In my library its name GSM.cpp not GSM_Shield.cpp, should I change it to GSM_Shield.cpp?
  • in my GSM.cpp at very top line are #include "GSM.h"

#include "WideTextFinder.h"
should the #include "GSM.h" change to "GSM_Shield.h"?
and
should the #include "WideTextFinder.h" change to #include <Arduino.h>?
  • where I add the #include <GSM_Shield.h>? Is it put in the GSM_Shield.cpp?

here I attached the libarry
  • and how about the pin,, if my code pin 6,7, should I change the pin to 6,7 in my GSM.cpp?


I've tried many tutorials include the link that you given and about to receive sms, using serial monitor and etc,, but doesn't work. I really confused, I hope you can help

many thanks before

merci

here the library attachement

nikhiljoji

Hi,
Please provide details of your project. Is it just a sms reception and sending project using sim 900 and arduino?

merci

hello nikhiljoji,,
actually I want to make LEDs controler using sms  wtih switch buttos,,
maybe about 4 led & 4 buttons,
to turn on & off, we can command with sms,,
and also we can turn it on & off using the button of each led,
if we turn on & off by the button, the system will send sms which the button has turned on/off,, and the we can send the sms to turn on/off it again.

I had tried many tutorials about it, but doesnt work....
I really confuse with the library
how about the question that I posted above,,
please help me...

merci

#6
Jul 17, 2015, 01:55 pm Last Edit: Jul 17, 2015, 02:09 pm by merci
this the one of the tutorials that I had tried

Quote
//Serial Relay - Arduino will patch a
//serial link between the computer and the GPRS Shield
//at 19200 bps 8-N-1
//Computer is connected to Hardware UART
//GPRS Shield is connected to the Software UART

#include <SoftwareSerial.h>

SoftwareSerial GPRS( 7, 8 );

unsigned char buffer[64];  // buffer array for data receive over serial port
int count=0;               // counter for buffer array

void setup()
{
  GPRS.begin(19200);
  Serial.begin(19200);
}

void loop()
{
  if (GPRS.available())
  {
    while(GPRS.available())
    {
      buffer[count++]=GPRS.read();
      if(count == 64)break;
    }
    Serial.write(buffer,count);
    clearBufferArray();
    count = 0;
  }
  if (Serial.available())
    GPRS.write(Serial.read());
}

void clearBufferArray()
{
  for (int i=0; i<count;i++)
  {
    buffer=NULL;
  }
}
I changes the pin with 6,7, because my sim900 just has 7 pins,, but it doesn't work
there's nothing showed on the serial monitor

dannable

Right, rather than reinvent the wheel I did a Google search for 'WideTextFinder.h' and found a zip file called GSM_GPRS_GPS_IDE100_v307.zip. I unpacked this and put it in my libraries folder, renaming the folder GPS. I had already renamed the one that comes with the IDE to avoid confusion.

I loaded the file GSM_GPRSLibrary_SMS.ino, unremarked the lines at 41 & 42 to enable it to send an SMS and tried to compile it. It failed. I edited gps.cpp and remarked out the two functions at the bottom, convertLat and convertLong. I tried again and it compiled, uploaded and sent the SMS to my phone.

I used Arduino Uno, IDE 1.0.4, IcomSat with jumper Tx on 2 and Rx on 3.
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

pizzamen27

Can anyone help me to program arduino with gsm shield to send sms when olants are dry

young_skywalker

Hi, I'm also having problems with the sim900 module! i can't even connect to it directly via the UART pins it seems.
i've followed this guide but now the compiler is giving me the following error:

Code: [Select]
/Users/ljarrald/Documents/Arduino/libraries/GSM_Shield/NewSoftSerial.cpp:39:24: fatal error: WConstants.h: No such file or directory
 #include "WConstants.h"


do i need to change that bit too?

Thanks again...

Go Up