nameless1305
Newbie level 1

I'm using sim900a module + arduino uno + gsmlib.org library
My problem: I sent a string to my server, and it worked correctly for the first time when i using "inet.httpPOST" function in void setup(). And in void loop(), when i call that function again, it doesn't work. I just had a notification in serial moniter:
How can i send data to my server continously in void loop()
I hope you can help me. Thank you !
I got an example from: https://www.open-electronics.org/the-gsm ... -examples/
My example code:
My problem: I sent a string to my server, and it worked correctly for the first time when i using "inet.httpPOST" function in void setup(). And in void loop(), when i call that function again, it doesn't work. I just had a notification in serial moniter:
ALREADY CONNECT
DB:NOT CONN
How can i send data to my server continously in void loop()
I hope you can help me. Thank you !
I got an example from: https://www.open-electronics.org/the-gsm ... -examples/
My example code:
#include "SIM900.h"
#include <SoftwareSerial.h>
#include "inetGSM.h"
InetGSM inet;
int k=0;
int j=0;
char msg[150];
boolean found=false;
char data;
int numdata;
//char inSerial[50];
int i=0;
boolean started=false;
void setup()
{
Serial.begin(9600);
Serial.println("GSM Shield testing.");
if (gsm.begin(9600)){
Serial.println("\nstatus=READY");
started=true;
}
else Serial.println("\nstatus=IDLE");
if(started){
if (inet.attachGPRS("internet.wind", "", ""))
Serial.println("status=ATTACHED");
else Serial.println("status=ERROR");
delay(1000);
numdata=inet.httpPOST("MY ID ADDRESS", PORT, "", "my string i'm using to send to server",msg, 50);
//It work
}
};
void loop()
{
numdata=inet.httpPOST("MY ID ADDRESS", PORT, "", "my string i'm using to send to server",msg, 50);
//It doesn't work when i use it again
}
}