Hello All,
My code was sending data to my webserver fine at rate of every 10 seconds when I was using the Telefonica SIM Card. My credit has expired and I cannot renew my credit. Does anybody know if telefonica have stopped it.
The structure of code with the Telefonica SIM card was as below:
Library
#include <SIM900.h>
#include “inetGSM.h”
=====================
Void setup () {
Serial.println(“GSM Shield testing.”) ;
if (gsm.begin(9600)){
Serial.println("\nstatus=READY") ;
// // gsm.forceON();
started=true ;
}
//
else Serial.println("\nstatus=IDLE") ;
delay(2000) ;
}
=======================
Void loop () {
if(started){
if (inet.attachGPRS(“bluevia.movistar.es”, “”, “”))
Serial.println("status=ATTACHED");
else Serial.println(“status=ERROR”);
delay(1000);
numdata=inet.httpPOST(“XXXXX”, XXXX, “XXXX”, str ,msg, 25);
}
}
When I changed to an ATT SIM card the same code did not work anymore, to get it to work I had to bring the gsm.begin function in the void loop function.
It could not longer stay in the void setup() function
I had to change the code as below:
Void setup () {
Serial.begin(15200) ;
}
Void loop {
Serial.println(“GSM Shield testing.”) ;
if (gsm.begin(9600)){
Serial.println("\nstatus=READY") ;
// // gsm.forceON();
started=true ;
}
//
else Serial.println("\nstatus=IDLE") ;
delay(2000) ;
if(started){
if (inet.attachGPRS(“bluevia.movistar.es”, “”, “”))
Serial.println("status=ATTACHED");
else Serial.println(“status=ERROR”);
delay(1000);
numdata=inet.httpPOST(“XXXXX”, XXXX, “XXXX”, str ,msg, 25);
}
}
}
I guess my question would be where should the gsm.begin() function be when sending data continuously to the websever in setup or in the loop function ?
The gsm.begin() being here
==================================
Serial.println(“GSM Shield testing.”) ;
if (gsm.begin(9600)){
Serial.println("\nstatus=READY") ;
// // gsm.forceON();
started=true ;
}
//
else Serial.println("\nstatus=IDLE") ;
delay(2000) ;
==================================
Many Thanks,
Christian
Ps: Does anybody has a good example that he is willing to share?