In my agent, I am sending data to a php script (which then uses curl to post some data back to the imp).
I am able to successfully post and get but the delay is significant.
The relevant code is:
server.log("URL: " + mysqlURL); local getreq = http.get(mysqlURL); server.log("about to send request"); local res = getreq.sendsync(); server.log("Status response: " + res.statuscode); server.log("Response body: " +res.body);
With the output as:
Tue Aug 13 2013 12:18:58 GMT-0400 (EDT): URL: http://myserver/ElectricImp/FromImptoSQL.php?col1=2&col2=2&col3=5&col4=5&col5=7&col6=7&impserial=1 Tue Aug 13 2013 12:18:58 GMT-0400 (EDT): about to send request Tue Aug 13 2013 12:20:59 GMT-0400 (EDT): Status response: 200 Tue Aug 13 2013 12:20:59 GMT-0400 (EDT): Response body: This is from the webpage....
Is this an issue with my code or an imp limitation?
Note: When I run the php script in my webpage it takes seconds to run and send the data to my imp (so I’m almost positive the error is not with my php script and the imp code receiving the post).