diff --git a/globoSonda/examples/globoSonda/globoSonda.ino b/globoSonda/examples/globoSonda/globoSonda.ino index 4baf670..952b20a 100644 --- a/globoSonda/examples/globoSonda/globoSonda.ino +++ b/globoSonda/examples/globoSonda/globoSonda.ino @@ -48,7 +48,7 @@ unsigned long timer=millis(); //--------------------------------------------------------------------- void setup() { - initCOM(); + // initCOM(); ModoBajaPotencia(); //led de estatus en modo inicio diff --git a/globoSonda/src/ReporteManager.cpp b/globoSonda/src/ReporteManager.cpp index 69a82bc..82e4776 100644 --- a/globoSonda/src/ReporteManager.cpp +++ b/globoSonda/src/ReporteManager.cpp @@ -21,7 +21,6 @@ void ReporteManager::procesa() if (Utiles::isTime(&timerData, conf->TimerSMSData)) { enviaData(); - enviaDataGPRS(); } if (Utiles::isTime(&timerInf, conf->TimerSMSInfo)) { @@ -61,6 +60,7 @@ void ReporteManager::enviaData() Utiles::printCOM(buff); char* tlf; SMSEnviados = conf->GetLen()>0; + bool enviados = false; for (int i = 0; i < conf->GetLen(); i++) { tlf = conf->GetTlfData(i); @@ -71,7 +71,9 @@ void ReporteManager::enviaData() Utiles::printCOM("Error al enviar sms data"); SMSEnviados = false; } + enviados = true; } + SMSEnviados = SMSEnviados && enviados; } void ReporteManager::enviaInfo() @@ -94,6 +96,7 @@ void ReporteManager::enviaInfo() Utiles::printCOM(buff); char* tlf; SMSEnviados = conf->GetLen() > 0; + bool enviados = false; for (int i = 0; i < conf->GetLen(); i++) { tlf = conf->GetTlfInfo(i); @@ -105,7 +108,9 @@ void ReporteManager::enviaInfo() Utiles::printCOM("Error al enviar sms info"); SMSEnviados = false; } + enviados = true; } + SMSEnviados = SMSEnviados && enviados; } void ReporteManager::enviaDataGPRS() { diff --git a/globoSonda/src/SIM808Manager.cpp b/globoSonda/src/SIM808Manager.cpp index 919ced5..82c913d 100644 --- a/globoSonda/src/SIM808Manager.cpp +++ b/globoSonda/src/SIM808Manager.cpp @@ -718,7 +718,7 @@ bool Sim808Manager::connect(ProtocolSimManager ptl, const char* host, int port) } envia("AT+HTTPACTION=0"); bool reciv = 0; - for (int i = 0; i < 120 && !reciv; i++) + for (int i = 0; i < 1200 && !reciv; i++) { char* res = recibe(); if (res) @@ -741,10 +741,14 @@ bool Sim808Manager::connect(ProtocolSimManager ptl, const char* host, int port) } } if(!reciv) - delay(1000); + delay(100); } if (!reciv) + { + envia("AT+HTTPTERM"); + reciveOK(); return false; + } envia("AT+HTTPREAD"); if (!reciveOK()) {