SIM900 Stop working after reset.

Hello Guys, my shield is working fine , but i need that it reset in each time interval. The problem is that after it reset he stop working, don’t receive more sms neither answer me.

Sorry about the bad english.

Here is the code.

#include “SIM900.h”
#include <SoftwareSerial.h>
//Carrega a biblioteca SMS
#include “sms.h”

SMSGSM sms;

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

boolean estado = LOW;
boolean estado1 = HIGH;
String msg_esperada(“Liga 13”);
String msg_esperada1(“Desliga 13”);

void setup()
{
//Inicializa a serial
Serial.begin(9600);
//Define a porta 13 como saida
pinMode(13, OUTPUT);
Serial.print("Ligando shield GSM SIM900. ");
liga_desliga_GSMShield();
Serial.println(“Testando GSM shield…”);
//Comunicacao com o Shield GSM a 2400 bauds
if (gsm.begin(2400))
{
Serial.println(“nstatus=READY”);
started = true;
}
else Serial.println(“nstatus=IDLE”);
}

void loop()
{
if (started)
{
//Aguarda SMS
Serial.println(“Aguardando SMS…”);
if (gsm.readSMS(smsbuffer, 160, n, 20))
{
String msg_recebida(smsbuffer);
msg_recebida.trim();
msg_esperada.trim();
if ((msg_recebida == msg_esperada) && (strstr(n, “031971774886”)))
{
estado = !estado;
Serial.println(“SMS Recebido! Ligando bomba…”);
digitalWrite(13, estado);
sms.SendSMS(“031971774886”, “SMS Recebido! Ligando bomba.”);
delay(50000);
}
delay(5000);
}
if (gsm.readSMS(smsbuffer, 160, n, 20))
{
String msg_recebida(smsbuffer);
msg_recebida.trim();
msg_esperada1.trim();
if ((msg_recebida == msg_esperada1) && (strstr(n, “031971774886”)))
{
estado1 = !estado1;
Serial.println(“SMS Recebido! Desligando bomba.”);
digitalWrite(13, estado1);
sms.SendSMS(“031971774886”, “SMS Recebido! Desligando bomba.”);
delay(50000);
}
delay(5000);
}
}
delay(15000);
reset_GSMShield();
}

void liga_desliga_GSMShield()
{
Serial.print(F(“Aguarde…”));
pinMode(6, OUTPUT);
digitalWrite(6, LOW);
delay(1000);
digitalWrite(6, HIGH);
delay(1000);
Serial.println(F(“OK!”));
digitalWrite(6, LOW);
delay(500);
}
void reset_GSMShield()
{
Serial.print(F(“Aguarde…”));
digitalWrite(5, HIGH);
delay(500);
digitalWrite(5, LOW);
delay(1000);
Serial.println(F(“OK!”));
delay(500);
}

Do you need to call begin again after the reset?

I've tried it. But still not working. Maybe there some error at my reset function?

Hi

It is not clear what you are doing with pin 5 in attempting to reset your SIM900.

I have a SIM800 - as I understand in my SIM800 reset put out 2.8 volts and you need to ground that to earth for a period of time to initiate the reset - then unground the reset pin to allow it to return to 2.8 volts.

Is that what you are doing within pin 5 for your SIM900?

Sorry, I don’t speak Spanish (or whatever).

Regards

Catweazle NZ