Hi Everyone!
I have been trying to work this out since several days ago without sucess.
Hardware:
SIM900 Shield+GPS Shield+Arduino
I am using 3 libraries GSM.TinyGPS,inetGSM each one of them have been used succesufuly and GPS + GSM succesufully as well, the problem comes when I try to integrate all 3. The code compiles and gets uploaded but then, the serial monitor doesnt do anything (white screen).
The code works if I comment following lines:
SoftwareSerial ss(5, 4);
TinyGPS gps;
but if I include them, then I get the white screen, so Im thinking it might be something with the PIN communication or memory maybe, but IDE shows size of 14,212.
code:
#include "SIM900.h"
#include <SoftwareSerial.h>
#include "inetGSM.h"
#include "sms.h"
SoftwareSerial ss(5, 4);
#include <TinyGPS.h>
InetGSM inet;
SMSGSM sms;
//TinyGPS gps;
char msg[50];
char msg2[50]="meesage:";
int numdata;
char inSerial[50];
int i=0;
boolean started=false;
char position;
char n[20];
char smsbuffer[160];
boolean getGPS= false;
void setup()
{
Serial.begin(2400);
Serial.println("GSM Shield testing.");
if (gsm.begin(2400)) {
Serial.println("\nstatus=READY");
started=true;
} else Serial.println("\nstatus=IDLE");
};
void loop()
{
if(started) {
if(position = sms.IsSMSPresent(SMS_ALL)){
Serial.println("Leyendo SMS");
sms.GetSMS(position, n, smsbuffer, 160);
sms.DeleteSMS(position);
if (strcasecmp(smsbuffer, "get") == 0) {
Serial.println("Lets get");
if (inet.attachGPRS("internet.movistar.cr", "", ""))
Serial.println("status=ATTACHED");
else Serial.println("status=ERROR");
delay(1000);
gsm.SimpleWriteln("AT+CIFSR");
delay(5000);
gsm.WhileSimpleRead();
numdata=inet.httpGET("restgps-gps9728974383324.rhcloud.com", 80, "/user/2", msg, 50);
Serial.println("\nNumber of data received:");
Serial.println(numdata);
Serial.println("\nData received:");
Serial.println(msg);
}
else if (strcasecmp(smsbuffer, "km hoy") == 0) {
sms.SendSMS(n, "Ubicacion actual: http://maps.google.com/maps?q=9.992615,-84.137229&ll=9.992615,-84.137229&z=30");
}
else if (strcasecmp(smsbuffer, "ubicar") == 0) {
Serial.println("Lets GPS!");
started = false;
getGPS=true;
}
}
else
Serial.println("NO hay SMS");
delay(2000);
}
if (getGPS)
{
Serial.println("GPS DONEEE");
getGPS=false;
}
};