-->
Page 1 of 1

Adapting esphttpd HTML example to RTOS SDK

PostPosted: Wed Jan 10, 2018 8:47 pm
by htwtsang
I'm trying to adapt the esphttpd html example to the RTOS SDK and I've come across a problem with the connection status messages cgi. On successful connection it does not send the ip address, it puts the data into the send buffer and flushes but the browser does not receive it.
It seems to get block on select() function in platHttpServerTask. After a while it moves to the recovery function but can't recover the connection and closes the socket, I get an errno 104 when this happen and sometimes 103.
My guess that what is happening is that after it connects to the new network it starts a new connection and the old one is no longer available but this seems strange since the nonos sdk works fine.

Anyone got any ideas on this?

Re: Adapting esphttpd HTML example to RTOS SDK

PostPosted: Mon Jan 29, 2018 12:23 am
by htwtsang
I found a workaround, which is switching back to softAP mode before restarting again seems to work.
It would seems the socket is still alive but will never be writeable when connected to the new AP and select() function will be stuck.

Well as long as it's working.