Adapting esphttpd HTML example to RTOS SDK

htwtsang
Posts: 3
Joined: Tue Jan 23, 2018 9:55 am

Adapting esphttpd HTML example to RTOS SDK

Postby htwtsang » Thu Jan 25, 2018 8:04 am

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 stuck on select() function in platHttpServerTask after connecting to the access point. 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.
I have also tested this when the device is connected to the access point and reconnect back to itself, it works just fine. My guess that what is happening is that after it connects to the new network it starts a new connection and the old socket is no longer available but this seems strange since the nonos sdk works fine.

Anyone got any ideas on this?

User avatar
iot-bits.com
Posts: 23
Joined: Tue Dec 05, 2017 2:53 pm
Location: Pune, India
Contact:

Re: Adapting esphttpd HTML example to RTOS SDK

Postby iot-bits.com » Thu Feb 01, 2018 4:07 pm

Are you using the right routines? The esphttpd has implementations for both nonOS and RTOS SDK, so you need to specify which setup you are using otherwise things don't go too well.
- Pratik Panda
Nerd and Embedded Design Consultant
www.iot-bits.com

htwtsang
Posts: 3
Joined: Tue Jan 23, 2018 9:55 am

Re: Adapting esphttpd HTML example to RTOS SDK

Postby htwtsang » Fri Feb 02, 2018 3:03 pm

I'm using the RTOS version, i managed to find a janky workaround to it which is switching back from stationAP to SoftAP mode. The socket is able to write again and it sends the message back to the web browser. The socket was definitely still alive since it still had a valid file descriptor but it never become able to write again unless switched back to SoftAP, which is strange since it sends the information to the webpage after switching to stationAP and before connected.

Who is online

Users browsing this forum: No registered users and 2 guests