2. If step 1 confirms data is being sent alright, then you can check espconn status in this sent_callback function, instead of where you are checking now. This way, if sent_cb is not executed or has error - you know that the link was faulty and the GET request failed.
Code:
LOCAL void ICACHE_FLASH_ATTR
user_tcp_sent_cb(void *arg)
{
struct espconn *pespconn = (struct espconn *)arg;
os_printf("tcp sent succeed, STATE IS: %d !!! \r\n",(int)pespconn->state);
}
Code:
os_sprintf(requestText, "GET /SQL.php?request=getReq / HTTP/1.1\r\nUser-Agent: curl/7.37.0\r\nHost: %s\r\nAccept: */*\r\n\r\n",NET_DOMAIN);
Code:
os_sprintf(requestText, "GET /SQL.php?request=enterTemp&reqid=%s&value=%d / HTTP/1.1\r\nUser-Agent: curl/7.37.0\r\nHost: %s\r\nAccept: */*\r\n\r\n",reqID,tempValue,NET_DOMAIN);
GET /SQL.php?request=enterTemp&reqid=5&value=34 / HTTP/1.1
User-Agent: curl/7.37.0
Host: http://www.mywebsite.org
Accept: */*
you know that the link was faulty and the GET request failed.
3. If above is all good but the server still does not respond, you should make sure the server understands the GET command using telnet.
Statistics: Posted by Stational — Wed Sep 07, 2016 6:04 pm
Statistics: Posted by Guest — Tue Sep 06, 2016 9:44 pm
If things are not working, I'd suggest disabling multiple connections by setting max connections to 1. Then see if it works.
Code:
espconn_tcp_set_max_con_allow(pespconn,1);
Code:
LOCAL void ICACHE_FLASH_ATTR
user_send_request_temp(struct espconn *pespconn, char *reqID){
os_printf("STATE: %d\n", (int)pespconn->state);
//removed some code here
espconn_send(pespconn, pbuf,os_strlen(pbuf));
os_printf("STATE: %d\n", (int)pespconn->state);
}
Statistics: Posted by Stational — Mon Sep 05, 2016 8:35 pm
Statistics: Posted by Guest — Mon Sep 05, 2016 9:54 am
Code:
LOCAL void ICACHE_FLASH_ATTR user_tcp_recv_cb(void *arg, char *pusrdata, unsigned short length)
Code:
struct espconn *pespconn = (struct espconn *)arg;
send_request_temp(pespconn, returnObject[n].ID);
Statistics: Posted by Stational — Sun Sep 04, 2016 3:48 am