I got the AZDelivery SIM 808 GPRS/GSM Shield (SIM808 Modul) and can´t get it working... I'm using the Arduino Mega 2560 and connected an external power source with 5V and 2Amps to the SIM808.
I tried different Pins for conecting the SIM808, but both aren´t working. I also changed the setting in the GSM.cpp file. So I connected the Arduino Mega Port 0 (RX) with TXD at the SIM808 and the Port 1 (TX) at the Arduino Mega with RXD at the SIM808.
The other time I connected Port 7 (TX) and Port 6 (RX) with the RXD and the TXD at the SIM808.
Both aren´t working
I also tried different librarys, like the "DFRobot_SIM808-master", "GSM-GPRS-GPS-Shield-GSMSHIELD" and the "GSM".
So I also used different examples like this one from the "GSM-GPRS-GPS-Shield-GSMSHIELD"-library. I can´t find the mistake I made. I just get this message after waiting for a while:
12:19:22.591 -> GSM Shield testing. 12:19:28.200 -> DB:NO RESP
12:19:45.986 -> DB:NO RESP
12:20:03.775 -> DB:NO RESP
12:20:27.151 -> Trying to force the baud-rate to 9600
12:20:27.151 ->
12:20:28.122 -> 1200
12:20:38.760 -> 2400
12:20:49.325 -> 4800
12:20:59.865 -> 9600
12:21:10.416 -> 19200
12:21:20.963 -> 38400
12:21:31.469 -> 57600
12:21:41.991 -> 115200
12:21:51.521 -> ERROR: SIM900 doesn't answer. Check power and serial pins in GSM.cpp
12:22:02.746 ->
12:22:02.746 -> status=IDLE
This is the script, I´m using now:
#include "SIM900.h"
#include <SoftwareSerial.h>
//#include "inetGSM.h"
//#include "sms.h"
//#include "call.h"
#include "gps.h"
//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 start a connection as client.
//InetGSM inet;
//CallGSM call;
//SMSGSM sms;
GPSGSM gps;
char lon[15];
char lat[15];
char alt[15];
char time[20];
char vel[15];
char msg1[5];
char msg2[5];
char stat;
char inSerial[20];
int i=0;
boolean started=false;
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");
gsm.forceON(); //To ensure that SIM908 is not only in charge mode
started=true;
} 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);
}
};
void loop()
{
//Read for new byte on serial hardware,
//and write them on NewSoftSerial.
serialhwread();
//Read for new byte on NewSoftSerial.
serialswread();
};
void serialhwread()
{
i=0;
if (Serial.available() > 0) {
while (Serial.available() > 0) {
inSerial[i]=(Serial.read());
delay(10);
i++;
}
inSerial[i]='\0';
if(!strcmp(inSerial,"/END")) {
Serial.println("_");
inSerial[0]=0x1a;
inSerial[1]='\0';
gsm.SimpleWriteln(inSerial);
}
//Send a saved AT command using serial port.
if(!strcmp(inSerial,"TEST")) {
// Serial.println("BATTERY TEST 1");
// gps.getBattInf(msg1,msg2);
// Serial.println(msg1);
// Serial.println(msg2);
// Serial.println("BATTERY TEST 2");
// gps.getBattTVol(msg1);
// Serial.println(msg1);
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");
}
//Read last message saved.
if(!strcmp(inSerial,"MSG")) {
Serial.println(msg1);
} else {
Serial.println(inSerial);
gsm.SimpleWriteln(inSerial);
}
inSerial[0]='\0';
}
}
void serialswread()
{
gsm.SimpleRead();
}
I also tried to send and recieve SMS with the same library and it also doesn´t work. The SIM808-module is able to register in the network but can´t send or receive a SMS... Here is the code for SMS:
#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);
}
};
Is anybody able to find my mistake? Thanks a lot, I can´t find a solution on my own!
Greetings, Jan =)