Continue to Site

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 with arduino uno

Status
Not open for further replies.

bayar

Newbie level 2
Joined
Jun 17, 2016
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
26
i'm using SIM900A with arduino uno r3 to send data to a webserver, i used different code but it didn't work so please can any one help me
 

yes ,i tested it but it add empty line in data base. i don't knew haw i will add my childs values to the data base.
here the code i used
#include <SoftwareSerial.h>
SoftwareSerial gprsSerial(7, 8);
char a =50;
char b= 10;
void setup()
{
gprsSerial.begin(19200);
Serial.begin(19200);

Serial.println("Config SIM900...");
delay(2000);
Serial.println("Done!...");
gprsSerial.flush();
Serial.flush();

// attach or detach from GPRS service
gprsSerial.println("AT+CGATT?");
delay(100);
toSerial();


// bearer settings
gprsSerial.println("AT+SAPBR=3,1,"CONTYPE","GPRS"");
delay(2000);
toSerial();

// bearer settings
gprsSerial.println("AT+SAPBR=3,1,"APN","internet.ooredoo.tn"");
delay(2000);
toSerial();

// bearer settings
gprsSerial.println("AT+SAPBR=1,1");
delay(2000);
toSerial();
}


void loop()
{
// initialize http service
gprsSerial.println("AT+HTTPINIT");
delay(2000);
toSerial();

// set http param value
gprsSerial.print("AT+");
gprsSerial.print("HTTPPARA="URL",");
gprsSerial.print(""http://psia.eduinfo.tn/requete.php");
gprsSerial.print("?humidite=");
gprsSerial.print(a);
gprsSerial.print("&reponse=");
gprsSerial.print(b);
gprsSerial.println(""");


delay(2000);
toSerial();

// set http action type 0 = GET, 1 = POST, 2 = HEAD
gprsSerial.println("AT+HTTPACTION=1");
delay(6000);
toSerial();

// read server response
gprsSerial.println("AT+HTTPREAD");
delay(1000);
toSerial();

gprsSerial.println("");
gprsSerial.println("AT+HTTPTERM");
toSerial();
delay(300);

gprsSerial.println("");
delay(10000);
}

void toSerial()
{
while(gprsSerial.available()!=0)
{
Serial.write(gprsSerial.read());
}
}
 

Is Your test done with pc? Using hyperterminal program. Test your command through this mean. Also make simple test like sms or network base command.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top