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.

Problem with sending data to a server using sim900 with HTTP

Status
Not open for further replies.

electronicsIUST

Member level 3
Member level 3
Joined
Feb 12, 2017
Messages
67
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
575
Hello, I am trying to send some datas via post (or get) method in http from my sim900 module to a web page in a web server and then inserting it into a table in a database.
my web page is working good & i can post (or get) datas to it via browser in my pc and html forms
but I cant send datas from my sim900a module. Here is commands sequence for sim900. Can anyone help me please what to do?

AT+SAPBR=3,1,"APN","wholesale" OK

// Enable GPRS - this will take a moment or two
AT+SAPBR=1,1 OK

// Check to see if connection is correct and get your IP address
// (I hid mine here, but you'll get a real IP back)
AT+SAPBR=2,1 +SAPBR: 1,3,"0.0.0.0"
OK

// Enable HTTP mode
AT+HTTPINIT OK

// Set HTTP profile identifier
AT+HTTPPARA="CID",1 OK

// Put in the URL of the PHP webpage where you will post -
// the URL below is a test server so you can use it in testing
AT+HTTPPARA="URL","http://posttestserver.com/post.php"
OK

// Tell the SIM900 how much data you'll send (18 bytes here)
// and how long to wait for a time-out (10,000 ms here)
AT+HTTPDATA=18,10000 DOWNLOAD

// Key in the data you want to send after you get the "DOWNLOAD" prompt.
vdc=12&adc=3&rel=8 OK

// Post the data - wait a second for the response
AT+HTTPACTION=1 OK
+HTTPACTION:1,200,142

// Read the response - www.posttestserver.com will give you a
// URL where you can confirm that it's working
AT+HTTPREAD +HTTPREAD:142
OK

// Close the HTTP connection
AT+HTTPTERM
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top