-->
Page 1 of 1

sent data to server

PostPosted: Mon Jan 11, 2016 8:31 am
by Thomashillegom
Hello!

How can i send data to a server like the dht22_thingspeak demo?:

os_sprintf(data, "http://%s/update?key=%s&field1=%s&field2=%s&status=dev_ip:%d.%d.%d.%d", THINGSPEAK_SERVER, THINGSPEAK_API_KEY, temp, hum, IP2STR(&ipConfig.ip));
http_get(data, "", thingspeak_http_callback);

I try to insert the code from dht22_thingspeak demo into the esphttpd demo, but it did not work.
I think there is a way to sent data in the esphttpd demo using:

sint8 espconn_send(
struct espconn *espconn,
uint8 *psent,
uint16 length
)

But my question is how do i do that?

Thanks!

Re: sent data to server

PostPosted: Tue Jan 12, 2016 1:28 am
by mharizanov

Re: sent data to server

PostPosted: Tue Jan 12, 2016 8:39 am
by Thomashillegom
Thanks! very nice work!

Re: sent data to server

PostPosted: Wed Jan 13, 2016 1:05 am
by Sprite_tm
Or use esphttpclient,as downloadable here: https://github.com/Caerbannog/esphttpclient