Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SIM900A module - sending data to server (gsmlib.org library) ?? need help !!

Status
Not open for further replies.

nameless1305

Newbie level 1
Joined
Jun 1, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
7
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:
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


}

}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top