-->
Page 1 of 1

ESP8266WebServer timeout problem

PostPosted: Sun Dec 27, 2015 5:47 pm
by Mario Mikočević
Heya,

I'm getting out of ideas so I'd appreciate if anyone can give me some pointers -

on 2.0.0 stable with
Code: Select allESP8266WebServer httpServer = ESP8266WebServer(80);
WiFi.mode( WIFI_AP );
loop() { httpServer.handleClient(); }


ESP's webserver is accessible for about 5-10 minutes, after that no response. Other ESP code parts itself happily work the whole time. My connection path is ESP <-> ZTE WiFi router <-> PC.

Sometimes I do get following -
Code: Select allstate: 5 -> 2 (6c0)
rm 0
pm close 7 0 0/1127576013
reconnect
state: 2 -> 0 (0)
f -180, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
pm open phy_2,type:2 0 0
cnt

connected with MozzWiFi, channel 1
dhcp client start...
ip:192.168.44.106,mask:255.255.255.0,gw:192.168.44.1
state: 5 -> 2 (6c0)
rm 0
pm close 7 0 0/618734334
reconnect
state: 2 -> 0 (0)
f 0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
pm open phy_2,type:2 0 0
cnt

connected with MozzWiFi, channel 1
dhcp client start...
ip:192.168.44.106,mask:255.255.255.0,gw:192.168.44.1


but not always. What code I can use to prevent this problem ? Bigger hammer ?

This problem is only in STA mode, if I change ESP to AP mode webserver works with no problems for ages.

TIA,
--
Mozz

Re: ESP8266WebServer timeout problem

PostPosted: Mon Dec 28, 2015 4:15 pm
by eduperez
Perhaps your router is disconnecting the device... I would test the connection inside the loop(), and reconnect if needed.

Re: ESP8266WebServer timeout problem

PostPosted: Wed Dec 30, 2015 6:33 pm
by Mario Mikočević
Heya,

finally some good news, with the latest versions of almost all package parts it works stable as rock. Not even a single reconnect/drop or anything similar.

Important parts are 1.5 SDK and reworked ESPWiFi Class, and a bit less important is 1.6.7 arduino for OTA.

In short - Arduino IDE 1.6.7 + todays git = WiFi STA connection stable !
(ty @Links2004 for awesome work)

--
Mozz