Giter Site home page Giter Site logo

gsm-gprs-gps-shield's Introduction

GSM/GPRS & GPS Shield Library for modules using SIM900/SIM908

NOTE: This repo has been migrated from google code repo: http://code.google.com/p/gsm-shield-arduino/

For informations and support:

Basic Function overview: Overview

Install Notes:

  • Download current release:
  • Extract to your arduino/libraries folder

LICENSE:

GNU GPL v3 except where noted otherwise.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Contributers:

Contributions have been made by the following organizations:

As well as, but not limited to, the following individuals:

gsm-gprs-gps-shield's People

Contributors

alcomposer avatar inche-ali avatar madmaze avatar marcomartines avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gsm-gprs-gps-shield's Issues

Library with Nano and sim900 breakout (not shield)

I have a sim900 module (http://www.sainsmart.com/sim900-gprs-gsm-board-quad-band-module-kit-for-arduino-high-quality-new.html), not shield.

I have an issue where the library works with the Mega using the sendsms() method. I can see all the debug commands which work and the sms is received. I call this the Mega/Library sketch.

Ive tried to use the nano with the library and directly with AT commands, this is what Ive found:

Library
With the nano, I cant upload the sketch with references to Serial1 in HWSerial, so I changed them all to Serial instead. I can see the debug logs and I noticed that CPMS returns error whenever it doesnt work on the nano. When it works in the Mega, CPMS returns OK in the logs.

AT Commands
I tried sending the sms with CMGS but the sms is never received. I started looking at the library and noticed that Im not using the pulse method, forceON(). I googled it and found this thread and others where its mentioned that pulsing is required. The problem is I dont have the shield, I have a SIM900 breakout and thus cant really access the powerkey pin.

So the Mega/Library works everytime. I've tried the Nano/Modified library and the nano/at commands.

I have made it work with the nano/mod library and with the nano/at commands. I dont know how, but I think switching to the mega/library sketch must have done something and i managed to receive a couple of sms from the nano/at sketch. That only worked for that session and when I tried to repeat it it stopped working.

Ive' posted about the issue here:http://forum.arduino.cc/index.php?topic=428200.msg2952179#msg2952179

I'm either missing something that the original library does that makes cpms return OK instead of Error, which I think might be the pulse, but that would only be true of the nano/at commands and not of the nano/Library.

Please help.

GSM AND Esp8266

Hello everybody.
I been struggling 3 days now to make my project work ...

first of all i want to read a value from a PHP page and if page reply a mobile phone , the arduino call that mobile phone. or sms it .

what i use is

Arduino UNO
SIM900 GSM SHIELD
ESP8266

first a broke it in two projects the

first with ESP8266 that Get Request from that PHP page and store the phone into a variable.(is working fine )

Second Project was only the GSM shield Sim900 which i used call.h and sms.h wich working fine too...

When i combine the two projects especially when i add into the ESP8266 project the sim900.h Library the ESP is not working good any more. It is connecting to the Rooter , gets IP , but when i call the GET request from site , i am not getting anything back.
I also checked the RX TX ports that GSM using , and they are correct.

The ESP8266 using the 4,5
The GSM using the 2,3

I also checked another libraries for GSM , also i used Just AT commands. i guess the problem is when i add a second SoftwareSerial "device" except the ESP8266

Library doesn't work on MEGA 2560?

What I need to do to make this library work on Arduino MEGA 2560?
I've followed the instructions, but still not work.
this is the error i got
====================================ERROR================================
GSMSHIELD\HWSerial.cpp:63:12: error: 'prog_char' does not name a type

  const prog_char *p = (const prog_char *)ifsh;

I also have tried to change "prog_char" to "char PROGMEM"
and ... this is what i got in terminal..

ATT: OK
RIC:
DB:NO RESP
DB:NO RESP

What is wrong?

Don't know how to make httpPOST request to Ubidots REST API

Hello. What exactly is the proper syntax of the httpPOST request to Ubidots REST API? Here are the info provided by Ubidots to be able to post value to their web app:

#include <UbidotsArduinoGPRS.h>
#include <SoftwareSerial.h>

//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
#define APN "Put_the_APN_here" // Assign the APN
#define USER "Put_the_APN_user_herer" // If your apn doesnt have username just put ""
#define PASS "Put_the_APN_pwd_here" // If your apn doesnt have password just put ""
#define TOKEN "Put_your_Ubidots_token_here" // Replace it with your Ubidots token
#define VARIABLE_LABEL "temperature" // Assign the variable label

Ubidots client(TOKEN);
SoftwareSerial gprs = SoftwareSerial(7, 8);
SoftwareSerial *GPRSSerial = &gprs;

void setup() {
Serial.begin(115200);
GPRSSerial->begin(19200);
if (! client.init(*GPRSSerial)) {
Serial.println(F("Couldn't find FONA"));
while (1);
}
client.setApn(APN,USER,PASS);
//client.setDebug(false);
}

void loop() {
float value = analogRead(A0); // Reading analog pin A0
client.add(VARIABLE_LABEL, value);
client.sendAll();
}`

Using library with Arduino Due

I am trying to use this library with Arduino Due (Programming Port) but not getting any results.

Please guide me through the necessary changes in the header and cpp files.

I am using the example programs with Arduino Uno and it works great but not working with Arduino Due.

Please Help. It's urgent. I'm on the clock with my project work.

Clean HTLM result ("httpGETHTML")

Hi!

It is not an issue but an improvement. I'm trying to get a "clean" HTML (the page without the headers). If I run the GSM_GPRSLibrary_Client example it will return something like

......................................................

HTTP/1.0 200 OK
Date: Sat, 22 Nov 2014 18:57:10 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=3a222686aa17f6e6:FF=0:TM=1416682
630:LM=1416682630:S=w2GbmezulmVW3GZO; expires=Mon, 21-Nov-2016 X3OjREhJS9bNM4kGs2BzPS01l3iXFV85h-Ssmf7T39w3WMxx8NjPxp6Giam0RaDBhG2g0me5_C74NdqM37I-evSKfIY56b0; expires=Sun, 24-May-2015 18:57:10 GMT; path=/; domain=.google.com.br; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 80:quic,p=0.02

<html>
<body>
...
...
...
</html>

......................................................

And I just want the "<html>...</html>" stuff.

So, If I send the folowing AT sequence I get what I want:

AT+CGATT?
AT+SAPBR=3,1,"CONTYPE","GPRS"
AT+SAPBR=3,1,"APN","CMNET"
AT+SAPBR=1,1
AT+HTTPINIT
AT+HTTPPARA="URL","http://www.google.com"
AT+HTTPACTION=0
AT+HTTPREAD

Result:
......................................................

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.com.br/?gfe_rd=cr&amp;ei=yNpwVMbPI4qk8weQk4GACA">here</A>.
</BODY></HTML>

OK

......................................................

So... how could I modify the lib to create a new "httpGETHTML" method? I'm not sure the best way to do this (and if there is not another way to do this).

Thanks!

Running GPRS Shield V1.1(B) on Arduino Due

Hi and thanks for a great project!

I try to use the code for my Arduino Due and my SIM900 GPRS Shield V1.1 (B). Will it work? How do I solve the problem?

I changed the code for MEGA GSM.h and HWSerial.h as you described. Do I need to connect the shield som different?

I get the following Compile error when I run the example code for calling:
C: \ Program Files (x86) \ Arduino \ libraries \ GSM GPRS GPS Shield 3.07.1 / SIM900.h: 3: 28: fatal error: SoftwareSerial.h: No such file or directory
  #include <SoftwareSerial.h>

Please help me :)

Send Custom AT Commands

Hello. I'm trying to get the current SIM's mobile number. I believe this is done via sending AT commands to the GSM Shield. However I am very much a newbie with Arduino and C++. How do I send my own AT commands to the GSM Shield using the functions in the library?

I believe I will use something like gsm.SimpleWriteln() and gsm.read() but I can't make it work. I want it to particularly get the mobile number (I believe it is AT+CNUM). I want to send this command and then read the response to get the mobile number. How can I do this? Thank you.

Use httpPOST or httpGet in a Loop

Hi,
I want to use httpPost in Arduino loop. But it don't work. Can you tell or confirm whether it is working in loop?
If it is possible can you give me code how to do it. I need urgent help.

NOTE: httpPost is working only in Setup. But i want it to work in loop

What i want to do is to send ECG signals through httpPost and there a graph is generated from that ECG data.

Thx in advance.

SendATCmdWaitResp problem

Hi,
char GSM::SendATCmdWaitResp(const __FlashStringHelper *AT_cmd_string, ....
you close with:
return (ret_val);

BUT:
char GSM::SendATCmdWaitResp(char const *AT_cmd_string, ...
you close with:
WaitResp(1000, 5000);
return (ret_val);

It took me quite some hours to figure out why the comm_buf is empty after calling SendATCmdWaitResp(AT_cmnd_str,....

I removed
WaitResp(1000, 5000);
and now it works OK.

I think you should remove it also. Or not?

Getting IMEI

I use : Arduino Mega and SIM900 GSM Breakout board,
My problem is getting IMEI from SIM900, but although all trials like
gsm.SimpleWriteln("AT+GSN=?");
gsm.SimpleWriteln(F("AT+GSN"));
gsm.getIMEI(imei);
They do not work, what can I do?
Thanks

Push Data to server

Hi, How can i use inet.GetHttp function to push data to Server for example if I use sparkfun push data. How can i merge that in the function and use it. Please help!

problem library errors

In file included from E:\Meus documentos\ARDUINO\arduino-1.8.1\libraries\GSM-GPRS-GPS-Shield-GSMSHIELD/Streaming.h:24:0,

             from E:\Meus documentos\ARDUINO\arduino-1.8.1\libraries\GSM-GPRS-GPS-Shield-GSMSHIELD/HWSerial.h:7,

             from E:\Meus documentos\ARDUINO\arduino-1.8.1\libraries\GSM-GPRS-GPS-Shield-GSMSHIELD/SIM900.h:4,

             from C:\Users\FERNAN~1\AppData\Local\Temp\arduino_modified_sketch_366459\Alimentador_automatico.ino:183:

E:\Meus documentos\ARDUINO\arduino-1.8.1\libraries\GSM-GPRS-GPS-Shield-GSMSHIELD/LOG.h:15:17: error: expected unqualified-id before 'const'

  void DEBUG(const char* string);

             ^

E:\Meus documentos\ARDUINO\arduino-1.8.1\libraries\GSM-GPRS-GPS-Shield-GSMSHIELD/LOG.h:15:17: error: expected ')' before 'const'

In file included from E:\Meus documentos\ARDUINO\arduino-1.8.1\libraries\GSM-GPRS-GPS-Shield-GSMSHIELD/HWSerial.h:7:0,

in the compilation gives me this error on Arduino Mega

Regarding use for arduino nano

Hi Marco,

Thanks for this code...i am trying to assemble a gps device, with sim900, skg13c(gps) and arduino nano. My question is can i use this on the arduino nano as well ?

If yes, how do i put all this code (steps please) into the nano, and test the device. I'm trying to learn. Kinda feel bad to ask you this question but I really do not know !

If you can link me to certain tutorial videos relevant to your project where I can get to learn all the steps that would be great.

Thanks in advance Marco

Help: How to turn on LED,....

Hi

I'm trying to build a GSM remote control for my car preheater....

What i want is to turn on the unit with a sms, but subsequent i will also want to send some status sms back.

of course i could just send the status text back to a list of numbers.

but ideal i want to send the status to the phone that started the unit.

for most uses we will only be 2 phones controlling the unit but it might change later

what i had in mind is that the sketch runs a loop where it checks for an incoming text

if there is one grap the number and then if the text says start do "blablabla" and delete the text

for starters i will just turn on a LED

now if i try to turn it off from the other phone it should just send back a text saying i did not turn it on and then delete the text

in the same loop i will pull stats from the heater and when thing happens i will send the stats to the phone that turned on the unit... hence my idea of grapping the number of the phone that starts the unit

any ideas?

gsm shield SIM900 Tinysine + ethernet shield (arduino MEGA)

I followed all instructions and the gsmshield works fine with mega.
I'm trying to use ehternet shield with gsm shield together:

  • pin 11, 12, 13 not conneted to gsm shield but connect to SPI pins
  • pin 4 (microSD) seems to me doesn't create problems with gsmshield (in gms.cpp rxpin=3 and txpin=2 and on=8 reset=9)
    Result: nothing works...no gsm, no ethernet.
    Any suggestions?
    Thanks a lot.

Pin Configurations

I would like to use pins (0,1)as Rx and Tx.but data is not transmitting .
Serial monitor output=DB:NO RESP.
Please help me in this regard .
Tell me where i need to modify the library,I have modified pins in GSM.cpp

how to use a String in the function inet.httpGET

Hi,

thank you for that nice library!
I succeeded to establish a connection to my server with
inet.httpGET("my.server.com",80,"/some/path",response,200);

But the path "/some/path" should contain a variable, so i did build a string with the variable before and wrote only the name of the string there instead of "/some/path"

String myString = "/test/123/";
inet.httpGET("my.server.com",80,myString,response,200);

But that's not working, I get the following error message:
no matching function for call to 'InetGSM::httpGET(const char [16], int, String&, char [200], int)'

I'd be very glad for any hint how to achieve that!

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

Hi

i use this lib and example 3 from http://www.open-electronics.org/how-to-send-and-receive-sms-with-gsmgprs-gps-shield/

sketch_sep18a:419: error: no matching function for call to 'SMSGSM::GetAuthorizedSMS(int, char [11], char [180], int, int, int)'

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

my sketch: http://pastebin.com/ie806tp5

what have i done wrong here?

open-electronics do point to this lib so i assumed that their examples are correct.

Can't parse sms more 140 characters

I have a project with an Arduino SIM900 shield and an Arduino Uno R3. I use this library code!

It worked very well but have 1 problem with receiving SMS of more than 140 characters.

For example if I send an SMS with 150 characters to my Arduino SIM900, it just parses 138 characters (not the full SMS).

Not accepting certain characters

Hi,
First off, thank you to all the contributors to this page - without you my current project would not have been possible.
I have been using the example SMS code to receive SMS into MaxMSP in oder to trigger sound files. I was having a problem with a looped message so I added this to the code:
**/
//get 1st sms
sms.GetSMS(1,n,20,smsbuffer,160);
if(n[0] == '+') {
Serial.print(n);
Serial.print(": ");
Serial.println(smsbuffer);
}
sms.DeleteSMS(1);

      delay(1000);
 }

};
It is working fairly consistently, just loosing serial communication after a few days, and seems to miss messages fairly frequently. My current issue is that it does not accept certain specific french characters such as ç, in the word français, and will send out a series of numbers instead of the message.

I am using the ITEAD SIM900 /GSM module with an arduino uno and a 2012 MAC mini 10.8.5. Is there any way to fix this? Has anyone run into the same issues I have mentioned above? Any help or suggestions would be greatly appreciated.
Thanks again.

Arduino Mega + sim900

Dear, I am trying to connect to the internet using:
Arduino MEGA
SIM900, powered separately with a 9 volt source.
Bookseller: MarcoMartines / GSM-GPRS-GPS-Shield

I manage to send sms, make calls, etc., but I can not connect to the internet using the example:
GSM_GPRSLibrary_Client.ino

The sim900 raises ok, but at the time of making the connection it gives me status: ERROR.

I configure the apn of ancel.lte of uruguay.
It does not have a username or password.

Any suggestions ???
Of course, thank you very much to everyone!!
regards
Juan

How to receive/send data from/to TCP connection

Hi,
I am trying to send/get data from the to my tcp server powered by NodeJS. I found connectTCP, and connected to the server. But did not found any useful method to send and receive data.

Please suggest me.

httpGET always connects to port 80

Expected Behavior:

  • inet.attachGPRS()
  • inet.httpGET("", 8080, "/", txtbuffer, bufsize);
  • connect to on port 8080 and stick result in txtbuffer

Actual Behavior

  • inet.attachGPRS()
  • inet.httpGET("", 8080, "/", txtbuffer, bufsize);
  • Actually connects to on port 80 and sticks result in txtbuffer

I have looked through the code a bit, it looks like it writes the right things to module, but still it connects to port 80 and not 8080..

Need to double check how the connection is setup, reference here, around page 12: http://www.ele.tut.fi/teaching/ele-2000/sim900_tcpip.pdf

AT+CMGR=1 returns only headers

Hey there!
I enable messages about new SMS

AT+CNMI=2,2,0,0,0

OK

and when received sms, output like this.

+CMT: "+79XXXXXXXXX","1","15/09/23,01:34:03+24"
Test

But when I read message, output only before <CR><LF>
I don't see text of message.

AT+CMGR=1

+CMGR: "REC READ","+79XXXXXXXXX","1","15/09/23,00:34:17+24"

AT+CMGL="ALL"

+CMGL: 1,"REC READ","+79XXXXXXXXX","1","15/09/23,00:34:17+24"
+CMGL: 2,"REC READ","+79XXXXXXXXX","1","15/09/23,01:34:03+24"

I use following code for test this.
SMSGSM.GetSMS and SMSGSM.GetAuthorizedSMS receive only phone number without sms text.

I use this shield:
_57

AT+GSV

SIMCOM_Ltd
SIMCOM_SIM900
Revision:1137B05SIM900M64_ST_ENHAN

Cant register at forum

i get an error:

General Error
SQL ERROR [ mysqli ]

INSERT command denied to user 'gsmlibor77611'@'217.64.195.210' for table 'phpbb_qa_confirm' [1142]

An SQL error occurred while fetching this page. Please contact the Board Administrator if this problem persists.

How to directly to database mysql

hi @MarcoMartines
i have question that make me stuck in my program.
how to simcom (gsm/gprs shield) connect directly to database mysql using port 3306
i try using ethershield and try using library mySql Connector by dr.bell
https://github.com/ChuckBell/MySQL_Connector_Arduino
and that was very work.
but i try to using gprs shield sim900 and use AT Command for conect using gprs and connect again to database mysql server but it didn't work and there was no reference for At Command
Sory my english language is bad, and thanks you

Mega2560 CallStatusWithAuth non funziona

Buongiorno,
Vi contatto perché ho un problema con Arduino Mega 2560 e lo shield v2 GPRS GSM GPS completo di SIM908.
Ormai da giorni cerco di capire quale sia la causa del mal funzionamento dello sketch d'esempio "GSM_GPRSLibrary_Call presente nell'ultima versione della libreria
BETA_GSM_GPRS_GPS_IDE100_v307_1.zip scaricata da gsmlib.org.
Ho eseguito le istruzioni presenti nel file txl per switchare da UNO a MEGA2560, ovvero:
Commentato #define UNO e decommentato #define MEGA in GSM.h;
Decommentato #define MEGA in HWSerial.h;
modificata la riga 55 del file HWSerial.cpp da const prog_char *p = (const prog_char *)ifsh;a PGM_P *p = (PGM_P *)ifsh;.

Dopo aver salvato le precedenti modifiche, compilo lo sketch senza ottenere errori. Il programma esegue correttamente il setup, ma quando effettuo una chiamata, arduino non riaggancia e non invia l'sms, poichè la condizione dell'if (stat==CALL_INCOM_VOICE_AUTH) alla riga 47 dello sketch di esempio, non è mai verificata, ovvero, la funzione CallStatusWithAuth, alla riga 44, non restituisce il valore corretto: ho provato sia inserendo 3 numeri autorizzati (number, 1, 3), sia abilitando tutti i numeri (number, 0, 0).

Lo stesso sketch di esempio funziona perfettamente con arduino uno.

Preciso, inoltre che, i collegamenti tra lo shield e il Mega sono stati fatti correttamente, poichè altri sketch come quelli relativi al GPS ed alle richieste GET/POST, funzionano.

E' possibile che ci sia qualcosa che non va nelle librerie relativamente al codice della mega2560?

Grazie in anticipo
Saluti
David Leanza

Buffer overflow vulnerability

SMSGSM::GetSMS is vulnerable to a buffer overflow since the code does not provide a maximum size for phone numbers the same way it does for sms content

Library doesn't compile for ATMEGA 2560

After changing the lines in the header file as prescribed for the MEGA:
//#define UNO

define MEGA

the code doesn't compile. Error message:

Arduino: 1.0.6 (Mac OS X), Board: "Arduino Mega 2560 or Mega ADK"
In file included from /Users/michael/Dropbox/Arduino/libraries/SIM900/GSM.h:9,
from /Users/michael/Dropbox/Arduino/libraries/SIM900/SIM900.h:5,
from t1_Declarations.ino:10:
/Users/michael/Dropbox/Arduino/libraries/SIM900/WideTextFinder.h:11: error: ISO C++ forbids declaration of 'SoftwareSerial' with no type
/Users/michael/Dropbox/Arduino/libraries/SIM900/WideTextFinder.h:11: error: expected ';' before '*' token
/Users/michael/Dropbox/Arduino/libraries/SIM900/WideTextFinder.h:22: error: expected `)' before '&' token

Please help!
Thanks,
Michael

Pin problem

Hi, I use this shield:
http://www.ebay.it/itm/281493145501?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
with arduino UNO.
I have connected TX and RX in pin 4-5 of arduino!. I have the first version .
I have edited gsm.cpp :

define GSM_TXPIN 4

define GSM_RXPIN 5

ONLY GPRS work fine!
What's the pin number in arduino for GPS??? in gsm.cpp there isn't GPS setting pin
Thank you!

EDIT:
i can see lat and long without pin connection GPS TX and RX. Is correct?
I have connected only GPRS TX and RX

IComSat SIM900 POWER ON code

Hi!

I'm using the "IComSat v1.1 -SIM900 GSM/GPRS shield" and, as you can see on the datasheet (ftp://imall.iteadstudio.com/IM120417009_IComSat/DS_IM120417009_IComSat.pdf, page 6), "the pin 9 of Arduino interface is connecting to PWRKEY, and a high pulse with 400us wide can power on/off it."

So, to my sim900 module works I have to put this in the code, before calling "gsm.begin":

#define SIM900_POWER 9

void setup() 
{
  //Serial connection.
  Serial.begin(9600);
  Serial.println("GSM Shield testing.");

  // Power on SIM900 module
  pinMode(SIM900_POWER, OUTPUT);
  digitalWrite(SIM900_POWER, HIGH);
  delay(500);
  digitalWrite(SIM900_POWER, LOW);  
  delay(5000);  
  // end

  //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");
  ...
  ...
  ...

Without that lines the module responds as follows:

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

The problem is not why my code is working with these lines. The problem is: why YOUR CODE is working without that? :?

Note: in GSM.h there are two lines that I think don't do nothing:

43 // pins definition
44 #define GSM_ON 8 // connect GSM Module turn ON to pin 77
45 #define GSM_RESET 9 // connect GSM Module RESET to pin 35

Thanks!
Mauricio

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

Hello

iam using itead sim908 Gsm/Gps/Gprs Module with Arduino Uno, iam trying to send Gps coordinates by Sms message and by gprs to internet server, but cant run it both same time, Although it's work separately.

when i try to send GPS coordinates via SMS message and send data via gprs to server same time i have this error :

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

this is my code, any one have a solution ?

include "SIM900.h"

include <SoftwareSerial.h>

include "inetGSM.h"

include "sms.h"

//#include "call.h"

include "gps.h"

char smsbuffer2[150];
char id[]="12";
char httpbuffer[160];

InetGSM inet;
//CallGSM call;
SMSGSM sms;
GPSGSM gps;
char msg[50];
int numdata;
char lon[15];
char lat[15];
char alt[15];
char time[20];
char vel[15];
char msg1[5];
char msg2[5];
char Mobile[]="0595285486";
char stat;
char inSerial[50];
int i=0;
boolean started=false;
void setup(){
get_gps();
delay(1000);
send_server();
delay(1000);
send_sms();
}
void loop(){
}
void get_gps(){
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(9600)) {
      Serial.println("\nstatus=READY");
      started=true;
       gsm.forceON();
 } else Serial.println("\nstatus=IDLE");

 if(started) {
      //GPS attach
      if (gps.attachGPS())

           Serial.println("status=GPSREADY");
      else Serial.println("status=ERROR");
      delay(20000); //Time for fixing
      stat=gps.getStat();
      if(stat==1)
           Serial.println("NOT FIXED");
      else if(stat==0)
           Serial.println("GPS OFF");
      else if(stat==2)
           Serial.println("2D FIXED");
      else if(stat==3)
           Serial.println("3D FIXED");
      delay(5000);
      //Get data from GPS
      gps.getPar(lon,lat,alt,time,vel);
      Serial.println(lon);
      Serial.println(lat);
      Serial.println(alt);
      Serial.println(time);
      Serial.println(vel);
      convert2Degrees(lat);
      convert2Degrees(lon);
 }

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

    if(started) {

      //GPRS attach, put in order APN, username and password.
      //If no needed auth let them blank.
      if (inet.attachGPRS("internet", "", ""))
           Serial.println("status=ATTACHED");
      else Serial.println("status=ERROR");
      delay(1000);
      //Read IP address.
      gsm.SimpleWriteln("AT+CIFSR");
      delay(5000);
      //Read until serial buffer is empty.
      gsm.WhileSimpleRead();
      //TCP Client GET, send a GET request to the server and
      //save the reply.
      /*
              httpbuffer[0]='\0';

strcat(httpbuffer,"/GetData.aspx?lat=");
strcat(httpbuffer,lat);

strcat(httpbuffer,"&&lon=");
strcat(httpbuffer,lon);
strcat(httpbuffer,"&&id");
strcat(httpbuffer,id);

        Serial.println(httpbuffer);

*/
numdata=inet.httpPOST("qou.azurewebsites.net", 80,"httpbuffer", msg, msg,12);
//Print the results.
Serial.println("\nNumber of data received:");
Serial.println(numdata);
Serial.println("\nData received:");
Serial.println(msg);
}
}
void send_sms(){

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

if(started){

            smsbuffer2[0]='\0';

strcat(smsbuffer2,"Vehicle Accident Occurs to Vehicle which Have ");
strcat(smsbuffer2,"ID number");
strcat(smsbuffer2,id);
strcat(smsbuffer2,"in Location :");
strcat(smsbuffer2,lat);
strcat(smsbuffer2,lon);
strcat(smsbuffer2,"Owner Name:Ayman Abd Albasit Sadq Daqah");
strcat(smsbuffer2,"Mobile :");
strcat(smsbuffer2,Mobile);
if (sms.SendSMS(Mobile, "smsbuffer2"))
Serial.println("\nSMS sent OK");
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.