Espeasy: '(200) Beacon timeout' & '(201) No AP found'

Created on 25 Apr 2018  ·  180Comments  ·  Source: letscontrolit/ESPEasy

Summarize of the problem/feature request

'(200) Beacon timeout' & '(201) No AP found'
Make using the recent firmwares useless, it happens so quickly I can never load a web page.
I happens straight away.
Tried virgin devices, Erase_Flash, nothing changes the outcome.
Tried 2 routers & even my mobile Android hotspot & restarting routers.
Always the same, always instantly a problem.
Simply setting Wifissid & Wifikey, save - problem starts, so using DHCP, not tried static etc

System configuration

Sonoff Basic units with 1M flash PCB dated 2017-5-5 TH_V1.1
ESP8266EX
I can back track this if it helps ?
Not going to back track without being asked to.
Last firmware tried mega-20180424 (ESP82xx Core 2_4_0)

Stabiliy Wifi Fixed

Most helpful comment

quick catchup: after the first units ran fine with your simplified code from tonight I flushed now all test devices (~10). We'll see how it goes.

but already now I can say, that my devices seem to like your code quite good, I see certain reconects from time to time (200&201) but at least they reconnected everytime successfully.

one thing that seems to be important when using lwIP2 make sure you take the high bandwith one, otherwise it seems to loose some data from time to time when there is a lot to send (eg. multiple values in a sensor) and the packets get big therefore. With the high bandwith lwIP this seems to be gone..

webinterface looks speedy also cpu is a bit lower in average and free memory higher.

All 180 comments

I just (minutes ago) added some quick fix to do a bit more active reconnects.

However, if you're getting them Beacon timeout so quickly and so often, there may be some other issue here.
The beacon timeout is a common reason to disconnect. But common as in a few times a week maybe a few times per day. Not as frequent as you describe them.
The "No AP found" is something else I just found out yesterday.
ESP32 has an event to signal "STAstart", which will fire when the wifi module is online and stable.
On the ESP32 this will take between 30 and 450 msec (on my test node).
If you're trying to so some wifi related stuff inbetween starting wifi mode and doing something with the wifi, it will result in strange issues.
For example:

  • connected but no traffic possible
  • infinite timeouts on connections started before the wifi STA mode was stable.
  • No AP found errors.

The ESP8266 does not have such a STAstart event. But you could add some delay in the function that actually sets the mode to WIFI_STA
A delay of 250 msec is almost always fine.

There are other new insights into wifi that I should use and the wifi code has become too complex in the last few weeks.
So there should be a simple redesign (or redesign to simplicity) to the wifi code.
I will work on that for the next couple of days and then release it.

So please test the last version of the code (or wait 3 hours and you'll have the fresh 025 build)

And sometimes it also helps to restart the accesspoint, since beacon timeout should not happen that often, even though there is some logic error in the current code.

I will try the 025 build..
I can back track this error ???
Introduced somewhere in the last month...
Is an instant issue, as soon as setting up Wifi
tried different makes & model routers & my Android phone's hotspot, consistent problem all routers
Downgrade firmware to pre-CRC fail, this issue is gone, Wifi works fine.

ESP_Easy_mega-20180425_normal_ESP8266_1024.bin
Full erase before flash
Opened Serial Monitor, cold booted..
AP is not showing anywhere, tried my PC, Routers & Mobile Phone..
Cold boot & tried again, no AP "ESP_Easy_0" found to configure Wifi
Tried again, waited.... Confirmed enough times, no access point visible
Time for step 2, see log below this one - Serial Setup

INIT : Booting version: mega-20180425 (ESP82xx Core 2_4_0)
73 : INIT : Warm boot #2
75 : FS   : Mounting...
81 : FS   : Mount successful, used 75802 bytes of 113201
379 : CRC  : program checksum       ...OK
386 : CRC  : SecuritySettings CRC   ...OK
404 : INIT : Free RAM:20400
405 : INIT : I2C

405 : INIT : SPI not enabled
419 : INFO : Plugins: 47 [Normal] (ESP82xx Core 2_4_0)
419 : WIFI : Switch on WiFi
420 : WIFI : Set WiFi to STA
422 : WIFI : No valid wifi settings
423 : WIFI : Connection Failed
525 : WIFI : Set WiFi to AP
1415 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
1422 : WD   : Uptime 0 ConnectFailures 0 FreeMem 18144
31421 : WD   : Uptime 1 ConnectFailures 0 FreeMem 18376
61421 : WD   : Uptime 1 ConnectFailures 0 FreeMem 18376

Serial WiFi setup

>wifissid MAD_MOB

Ok
361421 : WD   : Uptime 6 ConnectFailures 0 FreeMem 18376

>wifikey 12345676

Ok
>save
383973 : FILE : Saved config.dat
384274 : FILE : Saved security.dat

Ok
384275 : WIFI : Set WiFi to AP+STA
384402 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
391421 : WD   : Uptime 7 ConnectFailures 0 FreeMem 17240

Wifidisconnect
Wificonnect
does nothing, just serial response OK
Time for Cold Boot

Cold Boot

INIT : Booting version: mega-20180425 (ESP82xx Core 2_4_0)
76 : RTC  : Checksum error on reading RTC user var
76 : INIT : Warm boot #2147483657
78 : FS   : Mounting...
85 : FS   : Mount successful, used 75802 bytes of 113201
380 : CRC  : program checksum       ...OK
387 : CRC  : SecuritySettings CRC   ...OK
404 : INIT : Free RAM:20416

404 : INIT : I2C
405 : INIT : SPI not enabled
418 : INFO : Plugins: 47 [Normal] (ESP82xx Core 2_4_0)
419 : WIFI : Switch on WiFi
419 : WIFI : Set WiFi to STA
426 : WD   : Uptime 0 ConnectFailures 0 FreeMem 19744
427 : WIFI : Connecting MAD_MOB attempt #0
2568 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2140 ms
2568 : WIFI : Connection Failed
2669 : WIFI : Set WiFi to AP
3558 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1

Serial "Reset" - Try again
No AP visible

Using second router Set Wifi via serial & save

Wifidisconnect & Wificonnect
Even Cold boot -- Nothing changed

Ok, may patch may have broken things regarding the AP mode.
About the errors reported. I just added the reason of disconnect to get more insight on what is happening.
Before there may have been WiFi issues, but never logged

Took another known working perfectly module with existing firmware, set as static IP
Flashed 0425 over the top
Connected differently, not better, could post whole log but quickly I spotted:

Wifi  : Detected strange behavior, reset wifi.
WIFI : Disconnected! Reason: '(2) Auth expire' Connected for 1131 ms
WIFI : Disconnected! Reason: '(200) Beacon timeout' Connected for 10 s
WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2146 ms

Trying ESP_Easy_mega-20180425_normal_ESP8266_4096, I setup the wifi via serial, and am seeing this:

520 : WD : Uptime 0 ConnectFailures 0 FreeMem 19728
521 : WIFI : Connecting nl5658az49 attempt #0
2658 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2136 ms
2658 : WIFI : Connection Failed
2759 : WIFI : Set WiFi to AP
3648 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1

The ESP_Easy_0 AP is not visible to my laptops or phones.

OK, what was the last version of ESPeasy that simply worked with wifi?
Then I will merge that version of wifi code into ESPeasy and will have a look at the event based wifi later on. This is really taking way too much time and it is just leading to more issues.

There is a patch for the static IP issues, which I will use of course. and some other issues that have been bugging ESPeasy for over a month already.

So please, what version did just work?

The best version on my nodes is mega-20180410

Still, that recent? That's after event based wifi, right @TD-er ?

Please report back here more suggestions on releases to pick for the async wifi.

The web interface works very fast so surely the event based wifi.
But this version is on core 2.3.0.
Maybe it's really one problem 2.4.0 and not event based wifi?

I hade the same problem all working perfectly on 04102018 after upgrade to
any version after this one I get a bootloop that I can't even downgrade to
previous versions... Need to check how to get out of bootloop on wemos D1.

As far as I understand the 0410 was the last on 2.3 core and after that all
versions use 2.4

On Wed, Apr 25, 2018, 09:30 melwinek notifications@github.com wrote:

The web interface works very fast so surely the event based wifi.
But this version is on core 2.3.0.
Maybe it's really one problem 2.4.0 and not event based wifi?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/letscontrolit/ESPEasy/issues/1312#issuecomment-384187762,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADPy_1flYcxggS14s1bzkN96SvwMQAbFks5tsCYSgaJpZM4TiiWg
.

If you back-stepped and tried merging 'important' fixes over the top why not
ESP_Easy_mega-20180403_normal_ESP8266_1024.bin <- CRC : Settings CRC ...OK #1272
As far as answering the question
"OK, what was the last version of ESPeasy that simply worked with wifi?"
I would need to test carefully to supply an answer.. Can do..
mega-20180403 Wifi is great, server is super strong
(repeatedly pressing F5 on devices page, never crashes or lags)

@sassod You may want to hold the "flash" button during flashing.
So press and hold flash, press reset shortly, start writing the firmware while still holding the flash button.
After writing firmware, release flash button and press reset.

At least, that's the method I use for NodeMCU. I assume the Wemos D1 also has a reset and a flash button?

I tried a multitude (about 20) of different combinations in the last weeks, all self-compiled, all on Wemos D1 Mini's (about 15 units with different sensors, relays, etc. attached).
Combinatiosn I tried included switchign between core versions (2.3.0, 2.4.0, GIT master) and different versions of lwIP (1.4, 1.4 self compiled, 2.0High Bandwith, 2.0 self compiled, 2.0 High memory).

The observations I did were, that the most resent version of ESPEasy (from tonight) with core 2.3.0 and lwIP 1.4 seems to work stable.

Switching to core from GIT or 2.4.0 and using lwIP 2 has issues (does not reconnect / goes directly into AP mode). Switching to lwIP 1.4 self compiled does improve the situation slightly (connects to the network but switches to AP mode 2min. later)

so as far as I can tell it seems to be more related to the core version and lwIP and not the ESPEasy event based Wifi. However these are just not really sophisticated observations from a beginner... but probably it helps to narrow down the issues.

Let me knwo if I can help and/or provide more information! And keep up the grat work!! Really appreciate it!!

Could you also check if it is possible to connect to the setup page and continue the whole process of setup wifi access, when using core 2.3.0 ? (you probably need clean settings for that)

If that's working right now, I will switch back to 2.3.0

as I'm in the office I don't have physical access to the devices right now, but as far as I could see the last days, that worked. switchign to 2.4.0 or git will not bring up the page anymore.

connecting to the setup-page of a running unit (2.3.0 ESPEasy from tonight) work also fine and shows me the actual connected IP.

Clearing and flashing a unit I could try tonight thoug...

PS: what I'm also seeing on my ESP Server (FHEM) is that the messages received often are incomplete when using GIT or 2.4.0 with lwIP 2.0 (Invalid content length (462 != 410))

OK, that's a big help. I will try to get a 'quick and stable' build this evening.
This wifi stuff must become stable again asap.

Improvements in speed can always be done later, since I now know what is causing the delays.

I'm flashing a cpuple of units just now with my Core 2.3.0 build from this morning (and ESPEasy master) and see if they run stable throughout the day...

ESPeasy master.... I hope you mean "mega" branch?
Master has been renamed to 'legacy' a few days ago.

yes, sure, sorry... told you I'm a beginner ;)

ESP_Easy_mega-20180410_normal_ESP8266_1024 (the last 2.3 core)
Access Point shows & connects but is at http://192.168.244.1/setup
not the usual http://192.168.4.1
haven't had much time to test it yet...

So what is the plan ? Take mega-20180425 and change compile settings ?

I'm not sure there is already a plan :)
But you could try that to see if it helps. Sounds like a good start.

Had problems with AP, Page Title loaded.. not much else, then seemed to lock-up even via serial
Cold Boot - Manually set wifi via serial - connected
Web server responds & wifi stays connected (now 53 m 21 s)
Overall is not as fast as 0403, web-server working OK, but has moments it seems to 'pause'
changing state on GPIO14,
seems to lag with the display of that state change on serial console
For fun I checked the GPIO wrong state, my friendly bug is still there

0425 compiled in platformIO with 2.3.0 Core

Even though I have tortured the device, trying to crash it, it has stayed UP (1 hour 30 min)
Not one wifi error as I have previously reported
UP time = Wifi connect time..
So the change from 2.4 down to core 2.3 = a huge difference

Just for information:
I have flashed 6 units about four hours ago. Except one, all of them still up and running (with 2.4.0 or GIT it was less than 5min.). One stopped responding after 2h, but this one I use for HW-Tests (sensors, relaiys, etc), so It's likely an issue of the device and not the SW.

The others are running a build from this morning with core 2.3.0 built wirh Arduino on a Mac with a custom plugin set enabled (32 plugins).

hope this helps...

It helps a lot.
At least it somewhat proves my code isn't that horrible ;)
And tomorrows build will be 2.3.0 based for sure.

Does the compilation in PlatformIO require any additional settings in current versions?
In the past, everything worked without a problem.
Now after uploading and resetting, it does not save wifi settings.
I give the data, then the countdown, and the button return to the settings.
In logs it looks like this:
23059 : WIFI : Set WiFi to AP
31518 : WIFI : Set WiFi to AP+STA
31520 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
31520 : WIFI : Credentials Changed, retry connection. SSID: lipowo
31606 : WD : Uptime 1 ConnectFailures 0 FreeMem 11640
61606 : WD : Uptime 1 ConnectFailures 0 FreeMem 12560

Hmm that was the reason I switched to 2.4.0, since there is a bug somewhere in 2.3.0 that was fixed in 2.4.0

I have to look into that.

It is interesting that the original compilations work ok, it is only I can not build my own.

I compiled the latest dev tasmota to investigate the 'new' rules, as is
of course, Wifi issues.. haha :)
Now I have a way of 'testing' the builds since 0403, I am going to build them all since then and compare because 0403 seems blazing fast compared to 0425
Actually 0410 isnt it ? Anyway too tired to do anything else this evening

So 0403 was actually "the best" ?

Hi all,
for me yesterday's version works very well.
Absolutely no problem with Wifi
Wemos D1 - 8266 and 8285.

Just for information:
I have uploaded the 1MB blank file firmware.
Then loaded latest firmware.
Attached to internal AP on 192.168.4.1
Then had to manually type http://192.168.4.1/setup
Then I inserted my Wifi cedentials
Then recreated all the devices and uploaded the rules.
I also made several firmware updates since then both from my own compiler and from pre-build version. Now is solid and stable since yesterady 23:00, so almost 24 hours.
I also find it much much faster in Wifi connection then the previous version.

The only problem was that I had to manually type http://192.168.4.1/setup while before this page was appearing automatically.
Other than this, is perfect.

This is my log:

107 : INIT : I2C
107 : INIT : SPI not enabled
1216 : INFO : Plugins: 72 [Normal] [Testing] [Development] (ESP82xx Core 2_4_0)
1217 : EVENT: System#Wake
1292 : WIFI : Switch on WiFi
1292 : WIFI : Set WiFi to STA
mode : sta(60:01:94:8e:ba:c9)
                             add if0
                                    1405 : EVENT: System#Boot
2227 : SYS  : 0.00
2229 : EVENT: SysInfoUptime#UptimeDays=0.00
3157 : WIFI : Connecting KeepOut attempt #0
3158 : IP   : Static IP : 192.168.1.206 GW: 192.168.1.1 SN: 255.255.255.0 DNS: 8.8.8.8
3173 : IMPT : MQTT 037 Intentional reconnect
3526 : WIFI : Static IP: 192.168.1.206 (ESPT6-16) GW: 192.168.1.1 SN: 255.255.255.0   duration: 3158 ms
3537 : EVENT: WiFi#Connected
3606 : Webserver: start
scandone
        state: 0 -> 2 (b0)
                          state: 2 -> 3 (0)
                                           state: 3 -> 5 (10)
                                                             add 0
                                                                  aid 5
                                                                       cnt

                                                                           connected with KeepOut, channel 9
                            ip:192.168.1.206,mask:255.255.255.0,gw:192.168.1.1
                                                                              7261 : Current Time Zone:  DST time start: 2018-03-25 02:00:00 offset: 120 minSTD time start: 2018-10-28 03:00:00 offset: 60 min
7262 : EVENT: Time#Initialized
7350 : EVENT: Clock#Time=Wed,20:33
7432 : IMPT : MQTT 037 Intentional reconnect
7794 : WIFI : Connected! AP: KeepOut (BC:EE:7B:EF:A3:38) Ch: 9 Duration: 3059 ms
7795 : EVENT: WiFi#ChangedAccesspoint
7877 : WIFI : Static IP: 192.168.1.206 (ESPT6-16) GW: 192.168.1.1 SN: 255.255.255.0
7888 : EVENT: WiFi#Connected

There are some strange log messages, but it works

quick update: running now on 11 units between 5 and 10 hours with mega commit 2fd226d from this morning and core 2.3.0. The only issue I found until now is, that the webpage does not load automatically the first time (eg. login-page) I have to call a page directly (eg. /tools or /login) after this, everything runs smoothly in the web interface.

My wemos D1 works fine with ESPEasy_mega-20180410.

@TD-er said

So 0403 was actually "the best" ?

You maybe still awake, I have just woken...
Yes, so far 0403 (pre crc fail), is the best
however before I slept I compiled every release which never loaded with 2.3.0
Now I can better evaluate the difference & get back to you.

Well, 'awake' is a bit too optimistic I guess.

I will go to sleep now.
Current progress can be seen here:
https://github.com/TD-er/ESPEasy/tree/bugfix/wifi_stability

It does seem to work quite OK with ESP32 and ESP8266, but only when using DHCP.
For static IP the connection gets lost quite often.

Maybe when built against 2.4.1 it will work. But that's for another day.
Now I'll go to bed and I am not merging this into ESPeasy repository.
But at least others can play with it if they like.

For 3+ hours I have been testing firmwares compiled on 2.3.0
I have made very specific tests & notes for each, awful results really (overall)
until I loaded 20180421, then 20180422 - with these there are noticeable differences
0422 fixes a bug in 0421 which makes it useless.. Not yet finished with 0422

What I do not know..
what is considered acceptable "FreeMem" ?
Dangerously low point ?
what is considered unacceptable "FreeMem" ?

Acceptable freemen is about 10, but with 2.4.0 we do not get that.
The minimum should be > 5k

As is downloaded from Github
ESP_Easy_mega-20180426_normal_ESP8266_1024.bin
Not really tested, just at this point after flashing
While testing other April firmwares compiled with 2.3.0,
still had plenty of Wifi errors, so changing from 2.4.0 to 2.3.0 has not solved 'all' those problems,
some firmwares the Wifi errors are so bad, I can not load the web server...
Others good..
Not tested past 0422 yet, but this log is 0426 just flashed over 0422's config for a quick look,
some minor Wifi errors in log, do they look acceptable to you ?
will resume more testing later, just got back home.. hungry

INIT : Booting version: mega-20180426 (ESP82xx Core 2_3_0)
79 : INIT : Cold Boot
80 : FS   : Mounting...
86 : FS   : Mount successful, used 75802 bytes of 113201
367 : CRC  : program checksum       ...OK
378 : CRC  : SecuritySettings CRC   ...OK
379 : CRC  : binary has changed since last save of Settings
396 : INIT : Free RAM:19456
396 : INIT : I2C
396 : INIT : SPI not enabled
411 : INFO : Plugins: 47 [Normal] (ESP82xx Core 2_3_0)
412 : EVENT: System#Wake
416 : WIFI : Switch on WiFi
416 : WIFI : Set WiFi to STA
428 : EVENT: System#Boot
430 : SW   : Switch state 0 Output value 0
436 : EVENT: Float_SW#Switch=0.00
1022 : WD   : Uptime 0 ConnectFailures 0 FreeMem 19616
1033 : WIFI : Connecting MAD_IOT attempt #0
1034 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
1048 : WIFI : Static IP: 192.168.0.225 (ESP-Easy-0) GW: 192.168.0.254 SN: 255.255.255.0   duration: 1034 ms
1059 : EVENT: WiFi#Connected
1065 : Webserver: start
1159 : MQTT : Intentional reconnect
1169 : MQTT : Failed to connect to broker
1510 : MQTT : Intentional reconnect
1517 : MQTT : Failed to connect to broker
11207 : Host unreachable: 0.0.0.0
11208 : Wifi  : Detected strange behavior, reset wifi.
11208 : Webserver: stop
11209 : WIFI : Switch off WiFi
11310 : WIFI : Switch on WiFi
11310 : WIFI : Set WiFi to STA
11311 : NTP  : NTP host au.pool.ntp.org (0.0.0.0) unreachable
11323 : EVENT: WiFi#Disconnected
11328 : WIFI : Disconnected! Reason: '(4) Assoc expire' Connected for 4063 ms
11336 : WIFI : Connecting MAD_IOT attempt #1
11337 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
11344 : WIFI : Static IP: 192.168.0.225 (ESP-Easy-0) GW: 192.168.0.254 SN: 255.255.255.0   duration: 11338 ms
11358 : EVENT: WiFi#Connected
11360 : Webserver: start
11457 : MQTT : Intentional reconnect
11469 : MQTT : Failed to connect to broker
11807 : MQTT : Intentional reconnect
11814 : MQTT : Failed to connect to broker
15639 : WIFI : Connected! AP: MAD_IOT (F4:F2:6D:25:84:C6) Ch: 11 Duration: 2511 ms
15640 : EVENT: WiFi#ChangedAccesspoint
15647 : WIFI : Static IP: 192.168.0.225 (ESP-Easy-0) GW: 192.168.0.254 SN: 255.255.255.0
15657 : EVENT: WiFi#Connected
15818 : Current Time Zone: STD time start: 2018-10-28 03:00:00 offset: 600 min
15819 : EVENT: Time#Initialized
15824 : EVENT: Clock#Time=Thu,18:25
15826 : MQTT : Intentional reconnect
19777 : MQTT : Connected to broker with client ID: ESPClient_5C:CF:7F:72:96:EC
19840 : Subscribed to: domoticz/out
20558 : EVENT: MQTT#Connected
25571 : EVENT: Clock#Time=Thu,18:26
31022 : WD   : Uptime 1 ConnectFailures 0 FreeMem 16688

Compiled with your changes from tonight and it seems to run stable with DHCP and static IP. No errors in the log after 1h of run. :-)

@TD-er : just flashed a couple of D1 units with your latest commit from https://github.com/TD-er/ESPEasy/tree/bugfix/wifi_stability compiled with latest GIT core version.... I'll let you know how they behave later today.

I have no idea why my hardware dislikes your wifi stability branch, a snippet

943087 : EVENT: WiFi#Connected
943815 : MQTT : Connected to broker with client ID: ESPClient_5C:CF:7F:72:96:EC
943832 : Subscribed to: domoticz/out
943891 : EVENT: MQTT#Connected
952294 : EVENT: WiFi#Disconnected
952296 : WIFI : Disconnected! Reason: '(200) Beacon timeout' Connected for 9529 ms
952312 : MQTT : Connection lost
952312 : EVENT: MQTT#Disconnected
952902 : WIFI : Connecting MAD_IOT attempt #0
952903 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
953025 : EVENT: WiFi#Disconnected
953027 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 123 ms
953902 : WIFI : Connecting MAD_IOT attempt #1
953903 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8

956156 : EVENT: WiFi#Disconnected
956158 : WIFI : Disconnected! Reason: '(2) Auth expire' Connected for 2253 ms
956903 : WIFI : Connecting MAD_IOT attempt #2
956904 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
959323 : WIFI : Connected! AP: MAD_IOT (F4:F2:6D:25:84:C6) Ch: 11 Duration: 2419 ms
959324 : WIFI : Static IP: 192.168.0.225 (ESP-Easy-0) GW: 192.168.0.254 SN: 255.255.255.0   duration: 1 ms
959452 : EVENT: Time#Set
959454 : EVENT: WiFi#Connected

Flash ESP_Easy_mega-20180403_normal_ESP8266_1024_DOUT.bin
then everything just works..

@Oxyandy That's exactly what I saw last night, right before my eyes told me to get some downtime myself.

Static IP + core 2.3.0 and my branch was absolutely not stable.
It seems like it does not register itself as "connected + got IP" and thus the MQTT connection does not do its loop() calls and the MQTT broker will disconnect the client.
That's how far I got last night.
But at least it is a lot more clean than the code of the last few weeks and that's always nice to have.
I threw away a lot of code and tried to keep it simple.

quick catchup: after the first units ran fine with your simplified code from tonight I flushed now all test devices (~10). We'll see how it goes.

but already now I can say, that my devices seem to like your code quite good, I see certain reconects from time to time (200&201) but at least they reconnected everytime successfully.

one thing that seems to be important when using lwIP2 make sure you take the high bandwith one, otherwise it seems to loose some data from time to time when there is a lot to send (eg. multiple values in a sensor) and the packets get big therefore. With the high bandwith lwIP this seems to be gone..

webinterface looks speedy also cpu is a bit lower in average and free memory higher.

Version from 2604 Git compiled with core 2.4.1 not reconnect after router restart, after node restart its ok:
INIT : Booting version: (ESP82xx Core 2_4_1)
67 : INIT : Warm boot #4
68 : FS : Mounting...
93 : FS : Mount successful, used 75802 bytes of 957314
99 : CRC : No program memory checksum found. Check output of crc2.py
104 : CRC : SecuritySettings CRC ...OK
105 : CRC : binary has changed since last save of Settings
212 : INIT : Free RAM:22576
212 : INIT : I2C
212 : INIT : SPI not enabled
226 : INFO : Plugins: 47 [Normal] (ESP82xx Core 2_4_1)
226 : WIFI : Switch on WiFi
226 : WIFI : Set WiFi to STA
228 : WIFI : No valid wifi settings
229 : WIFI : Connection Failed
331 : WIFI : Set WiFi to AP
1221 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
1228 : WD : Uptime 0 ConnectFailures 0 FreeMem 20328
>wifissid lipowo
Ok
>wifikey xxxxxxxxxxxxxxxxxxxxxx
Ok
>save
94313 : FILE : Saved config.dat
94344 : FILE : Saved security.dat
Ok

wificonnect
Ok
>reboot
INIT : Booting version: (ESP82xx Core 2_4_1)
61 : INIT : Warm boot #2
62 : FS : Mounting...
86 : FS : Mount successful, used 75802 bytes of 957314
93 : CRC : No program memory checksum found. Check output of crc2.py
98 : CRC : SecuritySettings CRC ...OK
204 : INIT : Free RAM:22576
205 : INIT : I2C
205 : INIT : SPI not enabled
218 : INFO : Plugins: 47 [Normal] (ESP82xx Core 2_4_1)
219 : WIFI : Switch on WiFi
219 : WIFI : Set WiFi to STA
225 : WD : Uptime 0 ConnectFailures 0 FreeMem 21920
226 : WIFI : Connecting lipowo attempt #0
3998 : WIFI : Connected! AP: lipowo (11:11:11:11:11:11) Ch: 6 Duration: 3771 ms
8197 : WIFI : DHCP IP: 192.168.3.212 (ESP-Easy-0) GW: 192.168.3.49 SN: 255.255.255.0 duration: 4199 ms
8200 : Webserver: start
30225 : WD : Uptime 1 ConnectFailures 0 FreeMem 18624
60225 : WD : Uptime 1 ConnectFailures 0 FreeMem 18072
87339 : : Rebooting...

INIT : Booting version: (ESP82xx Core 2_4_1)
63 : INIT : Warm boot #5
64 : FS : Mounting...
89 : FS : Mount successful, used 75802 bytes of 957314
96 : CRC : No program memory checksum found. Check output of crc2.py
100 : CRC : SecuritySettings CRC ...OK
207 : INIT : Free RAM:22576
207 : INIT : I2C
207 : INIT : SPI not enabled
221 : INFO : Plugins: 47 [Normal] (ESP82xx Core 2_4_1)
221 : WIFI : Switch on WiFi
221 : WIFI : Set WiFi to STA
228 : WD : Uptime 0 ConnectFailures 0 FreeMem 21920
228 : WIFI : Connecting lipowo attempt #0
5010 : WIFI : Connected! AP: lipowo (11:11:11:11:11:11) Ch: 6 Duration: 4780 ms
5698 : WIFI : DHCP IP: 192.168.3.212 (ESP-Easy-0) GW: 192.168.3.49 SN: 255.255.255.0 duration: 688 ms
5702 : Webserver: start
30228 : WD : Uptime 1 ConnectFailures 0 FreeMem 18224
2943939 : SYS : 16928.00
2949938 : SYS : -72.00
2957938 : SYS : 49.00
2970232 : WD : Uptime 50 ConnectFailures 0 FreeMem 17000
3000232 : WD : Uptime 50 ConnectFailures 0 FreeMem 17000
3003938 : SYS : 16928.00
3009938 : SYS : -72.00
3017938 : SYS : 50.00
3030232 : WD : Uptime 51 ConnectFailures 0 FreeMem 17000
3039019 : WIFI : Disconnected! Reason: '(200) Beacon timeout' Connected for 50 m 33 s
3039936 : Webserver: stop
3039936 : WIFI : Connecting lipowo attempt #0
3042798 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2861 ms
3042799 : WIFI : Connection Failed
3042899 : WIFI : Set WiFi to AP
3043789 : WIFI : AP Mode ssid will be espt_99 with address 192.168.4.1
3060232 : WD : Uptime 51 ConnectFailures 0 FreeMem 16632
3064800 : SYS : 16560.00
3070799 : SYS : 31.00
3078799 : SYS : 51.00
3090232 : WD : Uptime 52 ConnectFailures 0 FreeMem 16632
3120232 : WD : Uptime 52 ConnectFailures 0 FreeMem 16632
3124800 : SYS : 16560.00
3130800 : SYS : 31.00
3138800 : SYS : 52.00
3150232 : WD : Uptime 53 ConnectFailures 0 FreeMem 16632
3180234 : WD : Uptime 53 ConnectFailures 0 FreeMem 16632
3184801 : SYS : 16560.00
3190813 : SYS : 31.00
3198812 : SYS : 53.00
3210234 : WD : Uptime 54 ConnectFailures 0 FreeMem 16632
3240234 : WD : Uptime 54 ConnectFailures 0 FreeMem 16632
3244813 : SYS : 16560.00
3250813 : SYS : 31.00
3258813 : SYS : 54.00
3270234 : WD : Uptime 55 ConnectFailures 0 FreeMem 16632
3300234 : WD : Uptime 55 ConnectFailures 0 FreeMem 16632
3304813 : SYS : 16560.00
3310813 : SYS : 31.00
3318813 : SYS : 55.00
3330234 : WD : Uptime 56 ConnectFailures 0 FreeMem 16632
3360234 : WD : Uptime 56 ConnectFailures 0 FreeMem 16632
3364814 : SYS : 16560.00
3370814 : SYS : 31.00
3378814 : SYS : 56.00
3390234 : WD : Uptime 57 ConnectFailures 0 FreeMem 16632
3420234 : WD : Uptime 57 ConnectFailures 0 FreeMem 16632
3424814 : SYS : 16560.00
3430814 : SYS : 31.00

Update:
WD : Uptime: 369 min, ConnectFailures: 0, FreeMem: 24784 bytes
EVENT: Clock#Time=Thu,22:10

No issues after over 6h running. No error in log! :-)

I have seen people have success with 2.40 & 2.41 core, I have tried building 0422, 0425 & 0426 with 2.40 & 2.41 - connectivity has become worse for me than using 2.3.0
Still 0403 seems to be last stable wifi for me so I tried 0403 compiled using 2.4.1 core,
works perfect but has less free mem

@Oxyandy : could it be that it's a hardware problem? Either your unit, or your unit model or your power supply or your router? Or maybe your configuration?

Tried a few units the results are identical, absolute minimal config...
any units I've had problem with - after downgrading to 0403 have been perfect..

0403, compiled using 2.4.1 Core, connects first try, updates time straight away, no wifi errors & stays connected, web server responds every time..
Point is, with 0403 it doesn't seem to matter which core I use, it just works...
later versions using a higher core makes existing issues with wifi worse..
Note: firmware compiled with 2.4.1 is 41K larger.

INIT : Cold Boot
FS   : Mounting...
FS   : Mount successful, used 75802 bytes of 113201
CRC  : No program memory checksum found. Check output of crc2.py
CRC  : Settings CRC           ...OK
CRC  : SecuritySettings CRC   ...OK
INIT : Free RAM:20176
INIT : I2C
INIT : SPI not enabled
EVENT: System#Wake
WIFI : AP Mode disabled
WIFI : AP Mode ssid will be ESP_Easy-0 with address 192.168.4.1
IP   : Static IP :3774916800
WIFI : Connecting MAD_IOT attempt #0
EVENT: System#Boot
SW   : Switch state 1 Output value 1
EVENT: Float_SW#Switch=1.00
WD   : Uptime 0 ConnectFailures 0 FreeMem 18608
IP   : Static IP :3774916800
IP   : Static IP :3774916800
IP   : Static IP :3774916800
IP   : Static IP :3774916800
IP   : Static IP :3774916800
WIFI : Connected! AP: MAD_IOT (F4:F2:6D:25:84:C6) Ch: 11 Duration: 3999 ms
EVENT: WiFi#ChangedAccesspoint
WIFI : Static IP: 192.168.0.225 (ESP-Easy-0) GW: 192.168.0.254 SN: 255.255.255.0
EVENT: WiFi#Connected
MQTT : Intentional reconnect
MQTT : Connected to broker with client ID: ESPClient_5C:CF:7F:72:96:EC
Subscribed to: domoticz/out
EVENT: MQTT#Connected
Current Time Zone: STD time start: 2018-10-28 03:00:00 offset: 600 min
EVENT: Time#Initialized
EVENT: Clock#Time=Fri,21:57
EVENT: Clock#Time=Fri,21:58
WD   : Uptime 1 ConnectFailures 0 FreeMem 17504
WD   : Uptime 1 ConnectFailures 0 FreeMem 17504
EVENT: Clock#Time=Fri,21:59
WD   : Uptime 2 ConnectFailures 0 FreeMem 17504
WD   : Uptime 2 ConnectFailures 0 FreeMem 17504
EVENT: Clock#Time=Fri,22:00

Build from git https://github.com/TD-er/ESPEasy/tree/bugfix/wifi_stability with core 2.4.1 from git https://github.com/esp8266/Arduino is not sensitive to router reboot or node reboot.

Perhaps the problem was:
https://github.com/esp8266/Arduino/commit/b08d282673055b4758cd73d3cd99573f619112a5
This has been repaired after the release of 2.4.1.

Check at yourself. For me, this is the first build above 20180410, which gets up after resetting the router.

An attachment this firmware for those who do not want or can not compile.
firmware.zip

log:
INIT : Booting version:  (ESP82xx Core 00000000)
64 : INIT : Warm boot #2
65 : FS   : Mounting...
90 : FS   : Mount successful, used 75802 bytes of 957314
98 : CRC  : No program memory checksum found. Check output of crc2.py
103 : CRC  : SecuritySettings CRC   ...OK
207 : INIT : Free RAM:26768
208 : INIT : I2C
208 : INIT : SPI not enabled
224 : INFO : Plugins: 47 [Normal] (ESP82xx Core 00000000)
224 : WIFI : Set WiFi to STA
226 : WIFI : Connecting lipowo attempt #0
234 : WD   : Uptime 0 ConnectFailures 0 FreeMem 25832
238 : SYS  : 0.00
1237 : SYS  : 25928.00
2237 : SYS  : 31.00
4991 : WIFI : Connected! AP: lipowo (11:11:11:11:11:11) Ch: 6 Duration: 4764 ms
7666 : WIFI : DHCP IP: 192.168.3.212 (espt-99) GW: 192.168.3.49 SN: 255.255.255.0   duration: 2675 ms
7669 : Webserver: start
30234 : WD   : Uptime 1 ConnectFailures 0 FreeMem 22704
----------------
NODE REBOOT
----------------
INIT : Booting version:  (ESP82xx Core 00000000)
60 : INIT : Warm boot #3
62 : FS   : Mounting...
86 : FS   : Mount successful, used 75802 bytes of 957314
95 : CRC  : No program memory checksum found. Check output of crc2.py
99 : CRC  : SecuritySettings CRC   ...OK
204 : INIT : Free RAM:26768
204 : INIT : I2C
204 : INIT : SPI not enabled
220 : INFO : Plugins: 47 [Normal] (ESP82xx Core 00000000)
221 : WIFI : Set WiFi to STA
222 : WIFI : Connecting lipowo attempt #0
231 : WD   : Uptime 0 ConnectFailures 0 FreeMem 25832
234 : SYS  : 0.00
1233 : SYS  : 25928.00
2233 : SYS  : 31.00
4071 : WIFI : Connected! AP: lipowo (11:11:11:11:11:11) Ch: 6 Duration: 3781 ms
6690 : WIFI : DHCP IP: 192.168.3.212 (espt-99) GW: 192.168.3.49 SN: 255.255.255.0   duration: 2686 ms
6693 : Webserver: start
----------------
ROUTER OFF
----------------
22920 : WIFI : Disconnected! Reason: '(200) Beacon timeout' Connected for 18 s
23078 : WIFI : Connecting lipowo attempt #0
25940 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
26078 : WIFI : Connecting lipowo attempt #1
28942 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
29078 : WIFI : Connecting lipowo attempt #2
30230 : WD   : Uptime 1 ConnectFailures 0 FreeMem 23656
31942 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
32077 : WIFI : Connecting lipowo attempt #3
34945 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2866 ms
35078 : WIFI : Connecting lipowo attempt #4
37941 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
38077 : WIFI : Connecting lipowo attempt #5
40942 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
41078 : WIFI : Set WiFi to AP+STA
41967 : WIFI : AP Mode ssid will be espt_99 with address 192.168.4.1
41967 : WIFI : Connecting lipowo attempt #6
44831 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
45078 : WIFI : AP Mode ssid will be espt_99 with address 192.168.4.1
45079 : WIFI : Connecting lipowo attempt #7
47946 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2866 ms
48078 : WIFI : AP Mode ssid will be espt_99 with address 192.168.4.1
48079 : WIFI : Connecting lipowo attempt #8
50940 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2861 ms
51078 : WIFI : AP Mode ssid will be espt_99 with address 192.168.4.1
51079 : WIFI : Connecting lipowo attempt #9
53942 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
54078 : WIFI : AP Mode ssid will be espt_99 with address 192.168.4.1
54079 : WIFI : Connecting lipowo attempt #10
56941 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2861 ms
57079 : WIFI : AP Mode ssid will be espt_99 with address 192.168.4.1
57080 : WIFI : Connecting lipowo attempt #11
59943 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
60078 : WIFI : AP Mode ssid will be espt_99 with address 192.168.4.1
60079 : WIFI : Connecting lipowo attempt #12
60231 : WD   : Uptime 1 ConnectFailures 0 FreeMem 21248
61080 : SYS  : 1.00
62080 : SYS  : 21176.00
62289 : SYS  : 31.00
63389 : WIFI : AP Mode ssid will be espt_99 with address 192.168.4.1
63389 : WIFI : Connecting lipowo attempt #13
63402 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
66251 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2861 ms
66409 : WIFI : AP Mode ssid will be espt_99 with address 192.168.4.1
66409 : WIFI : Connecting lipowo attempt #14
69272 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
69409 : WIFI : AP Mode ssid will be espt_99 with address 192.168.4.1
69409 : WIFI : Connecting lipowo attempt #15
72273 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2864 ms
72409 : WIFI : AP Mode ssid will be espt_99 with address 192.168.4.1
72409 : WIFI : Connecting lipowo attempt #16
----------------
ROUTER ON
----------------
76185 : WIFI : Connected! AP: lipowo (11:11:11:11:11:11) Ch: 6 Duration: 3775 ms
77159 : WIFI : DHCP IP: 192.168.3.212 (espt-99) GW: 192.168.3.49 SN: 255.255.255.0   duration: 974 ms
90231 : WD   : Uptime 2 ConnectFailures 0 FreeMem 20800
120231 : WD   : Uptime 2 ConnectFailures 0 FreeMem 20800
121170 : SYS  : 2.00
122170 : SYS  : 20712.00
122522 : SYS  : -73.00
132569 : WIFI : Set WiFi to STA
150231 : WD   : Uptime 3 ConnectFailures 0 FreeMem 22688
180231 : WD   : Uptime 3 ConnectFailures 0 FreeMem 22688
----------------
ROUTER OFF / ON
----------------
630235 : WD   : Uptime 11 ConnectFailures 0 FreeMem 22480
633215 : WIFI : Disconnected! Reason: '(200) Beacon timeout' Connected for 9 m 17 s
633350 : WIFI : Connecting lipowo attempt #0
636215 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2864 ms
636350 : WIFI : Connecting lipowo attempt #1
640137 : WIFI : Connected! AP: lipowo (11:11:11:11:11:11) Ch: 6 Duration: 3786 ms
641125 : WIFI : DHCP IP: 192.168.3.212 (espt-99) GW: 192.168.3.49 SN: 255.255.255.0   duration: 987 ms

@melwinek : how do I change the core or update it to the latest patch?
Or even how can I check which version I am using?
I am using 8285 now, so cannot test your firmware.

Install core 2.4.1
Download this as zip; https://github.com/esp8266/Arduino
Replace contents of .platformio/packages/framework-arduinoespressif8266
Change contents of .platformio/platforms/espressif8266/platform.json
from:

    "framework-arduinoespressif8266": {
      "type": "framework",
      "optional": true,
      "version": "~1.20401.1"
    },

to:

    "framework-arduinoespressif8266": {
      "type": "framework",
      "optional": true
    },

comma has to be deleted as well.
delete .pioenvs from sources
compile.

It still works:
Uptime: | 0 days 3 hours 20 minutes
Load: | 5% (LC=11401)
Free Mem: | 19064 (15528 - sendContentBlocking)

I do not know why but there is a lot of memory.

For those who need a little help in building, I just built a version of the patch I wrote 2 days ago, but now with core 2.4.1:
TD-er_wifi_stability_core-2.4.1

@melwinek : thanks for the detailed instructions. I compiled.

Result:
With STATIC IP it doesn't reconnect to Wifi after a router reboot (but the serial log is misleading as it says Wifi#Connected).
With DHCP it reconnects and it is very stable.

@TD-er : any patch to apply in order to fix the static IP problem?

@giig1967g Not yet.
I hope to get to it now. The Whatsapp/email is getting a bit less interrupting right now. :)

@TD-er : thanks!
For your info, with static IP, in version mega-20180330 the unit reconnects after a router reboot.

@TD-er @giig1967g 20180410 also

@TD-er your build from dropbox is with core 2.4.1 or 2.4.1 GIT ?

I used these settings in PlatformIO.ini

[core_2_4_1]
platform         = [email protected]

[common]
build_flags      = -D BUILD_GIT='"${env.TRAVIS_TAG}"'  ; ${compiler_warnings.build_flags}
                   -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH

I think you're using https://github.com/esp8266/Arduino/releases/tag/2.4.1 instead https://github.com/esp8266/Arduino

On a stable 2.4.1 do not reconnect. At least for me.
But I do not know how to use 2.4.1 GIT professionally, I went on the easy way. Platformio and git is a novelty for me.

With the build I just shared, I am now running with static IP.
It looks like the problems with static IP are gone when using core 2.4.1
Nothing changed on the sources, just other platformIO settings.

I will test a bit more and have to fix a number of warnings (or else Travis will fail), but I guess I could push and merge it to the main branch.

It would be really great if the wifi issues were really over, then we could continue on the rest of the development.

@TD-er : did you try rebooting the wifi router?

Yep, including switching over to another AP.

@TD-er I checked your build from the dropbox. Reconnects after node reboot and after router reboot.
With DHCP and with static IP.
It will be great if you include it in the night build.

Is it now time for more than 12 tasks? :))
Thanks for your work and the whole team.

First dealing with memory issues, and MQTT and some more reported issues with certain plugins.
As soon as those are dealt with, there should be room for more tasks.

@TD-er There is only a small problem, do not connect again when I turn off WIFI for a very short time. Such a short time that ESP will not disconnect before I turn back on.:

Short WIFI switch-off time:
60260 : WD : Uptime 1 ConnectFailures 0 FreeMem 18768
60987 : WIFI : Disconnected! Reason: '(7) Not assoced' Connected for 19 s
61115 : SYS : 1.00
64363 : Host unreachable: 192.168.3.10
64364 : HTTP : connection failed
64368 : SYS : 19536.00
68588 : Host unreachable: 192.168.3.10
68589 : HTTP : connection failed
68592 : SYS : 31.00

Long WIFI switch-off time:
22237 : WIFI : Disconnected! Reason: '(200) Beacon timeout' Connected for 18 s
22991 : WIFI : Connecting lipowo attempt #0
25853 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
25990 : WIFI : Connecting lipowo attempt #1
28903 : WIFI : Connected! AP: lipowo (11:11:11:11:11:11) Ch: 6 Duration: 2911 ms
28926 : WIFI : DHCP IP: 192.168.3.212 (espt-99) GW: 192.168.3.49 SN: 255.255.255.0 duration: 23 ms

@giig1967g maybe it is also about you?

Hmm, so there should be a check whether sending data is possible and if not, force a reconnect?
Let's merge this version first and then look at that issue. Tiny steps at a time :)

And I wonder how realistic those outages are in a real-world situation.
My accesspoints take > 30 seconds for a complete reboot, so I cannot check those short outages.
But I can imagine it is something that _could_ happen.

@TD-er I do not reboot, I turn off and turn on WIFI :)
In the real world, it's better to protect yourself against this.
It does not have to be the power off, just for example some router software error.
And the result will be that someone will have to disassemble wall switches to reset them :)

wifi on/of on the ESP node, or on the accesspoint (e.g. your mobile as a hotspot)?

In my router with LEDE-OpenWRT.

I totally agree that is something we should protect against. But in a next build. Or else it is going to be 3 am this night again and I'm a bit exhausted at the moment. It was a very busy day with a lot of impressions.
The Whatsapp is still ringing with people who saw me on national TV, talking with our king and queen. :)

@TD-er : bad news: with your dropbox builds, with static IP it doesn't reconnect.
Do you need the log?

DHCP works fine

Yes please
And your static IP settings. (screenshot?)

log after 20 seconds of router reboot:
It connects for few seconds then disconnects then says "Detected strange behavior, reset wifi."
2018-04-27

146744 : EVENT: WiFi#Disconnected
146775 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2876 ms
146868 : WIFI : AP Mode ssid will be ESPT3_3 with address 192.168.4.1
146868 : WIFI : Connecting KeepOut attempt #24
146869 : IP   : Static IP : 192.168.1.203 GW: 192.168.1.1 SN: 255.255.255.0 DNS: 8.8.8.8
149748 : EVENT: WiFi#Disconnected
149779 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2875 ms
149871 : WIFI : AP Mode ssid will be ESPT3_3 with address 192.168.4.1
149871 : WIFI : Connecting KeepOut attempt #25
149872 : IP   : Static IP : 192.168.1.203 GW: 192.168.1.1 SN: 255.255.255.0 DNS: 8.8.8.8
152704 : WD   : Uptime 3 ConnectFailures 0 FreeMem 14320
152816 : EVENT: WiFi#Disconnected
152847 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2873 ms
152875 : WIFI : AP Mode ssid will be ESPT3_3 with address 192.168.4.1
152875 : WIFI : Connecting KeepOut attempt #26
152876 : IP   : Static IP : 192.168.1.203 GW: 192.168.1.1 SN: 255.255.255.0 DNS: 8.8.8.8
155798 : WIFI : Connected! AP: KeepOut (BC:EE:7B:EF:A3:38) Ch: 9 Duration: 2922 ms
155799 : WIFI : Static IP: 192.168.1.203 (ESPT3-3) GW: 192.168.1.1 SN: 255.255.255.0   duration: 2 ms
159071 : Host unreachable: 147.135.207.213
159071 : NTP  : NTP host pool.ntp.org (147.135.207.213) unreachable
159072 : EVENT: WiFi#Connected
159625 : IMPT : Connected to MQTT broker with Client ID=ESPT3-Import
159626 : EVENT: MQTTimport#Connected
159665 : IMPT : [mqtt#temp] subscribed to /OH2/status/nESP1Temperature
159666 : IMPT : [mqtt#set] subscribed to /OH2/status/nSetTemp1
159668 : IMPT : [mqtt#zone] subscribed to /OH2/status/nTermo1
159712 : MQTT : Connected to broker with client ID: ESPClient_60:01:94:82:79:26
159714 : Subscribed to: /ESPT3/#
159716 : EVENT: MQTT#Connected
159874 : IMPT : [mqtt#temp] : 24.80
159875 : EVENT: mqtt#temp=24.80
159918 : ACT  : oled,3,1,T=24.8°C
160086 : IMPT : [mqtt#set] : 18.00
160087 : EVENT: mqtt#set=18.00
160128 : ACT  : encwrite,18
160136 : QEI  : encwrite,18
160148 : ACT  : taskvalueset,2,1,18
160166 : ACT  : oled,2,1,Set=18°C
184894 : Host unreachable: 0.0.0.0
184895 : Wifi  : Detected strange behavior, reset wifi.
184895 : Reset WiFi.
184896 : WIFI : Switch off WiFi
184899 : WIFI : Set WiFi to STA
184900 : NTP  : NTP host pool.ntp.org (0.0.0.0) unreachable
184911 : MQTT : Connection lost
184912 : EVENT: MQTT#Disconnected
189955 : MQTT : Failed to connect to broker
190086 : EVENT: WiFi#Disconnected
190118 : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 29 s
190133 : IMPT : [mqtt#temp] : 24.80
190133 : EVENT: mqtt#temp=24.80
190174 : ACT  : oled,3,1,T=24.8°C
190223 : WD   : Uptime 3 ConnectFailures 4 FreeMem 16384
195233 : MQTT : Failed to connect to broker
195241 : Dummy: value 1: 0.00
195241 : Dummy: value 2: 0.00
195241 : Dummy: value 3: 0.00
195241 : Dummy: value 4: 0.00
195243 : EVENT: dummy#SetLocal=0.00
195275 : EVENT: dummy#firstUse=0.00
195306 : EVENT: dummy#=0.00
195337 : EVENT: dummy#=0.00
205017 : Host unreachable: 0.0.0.0
205018 : Wifi  : Detected strange behavior, reset wifi.
205019 : Reset WiFi.
205019 : WIFI : Switch off WiFi
205021 : WIFI : Set WiFi to STA
205023 : NTP  : NTP host pool.ntp.org (0.0.0.0) unreachable
205033 : EVENT: Clock#Time=Thu,00:03
205069 : EVENT: MQTTimport#Disconnected
205100 : IMPT : MQTT 037 Connection lost
210357 : IMPT : Failed to connect to MQTT broker - attempt 1
215858 : IMPT : Failed to connect to MQTT broker - attempt 2
221358 : IMPT : Failed to connect to MQTT broker - attempt 3
226868 : MQTT : Failed to connect to broker
226869 : EVENT: WiFi#Disconnected
226900 : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 29 s
226913 : WD   : Uptime 4 ConnectFailures 8 FreeMem 16384
231923 : MQTT : Failed to connect to broker
241315 : Host unreachable: 0.0.0.0
241316 : Wifi  : Detected strange behavior, reset wifi.
241316 : Reset WiFi.
241317 : WIFI : Switch off WiFi
241318 : WIFI : Set WiFi to STA
241321 : NTP  : NTP host pool.ntp.org (0.0.0.0) unreachable
246586 : IMPT : Failed to connect to MQTT broker - attempt 1
252087 : IMPT : Failed to connect to MQTT broker - attempt 2
257588 : IMPT : Failed to connect to MQTT broker - attempt 3
263098 : MQTT : Failed to connect to broker
263100 : EVENT: WiFi#Disconnected
263130 : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 29 s
263143 : WD   : Uptime 4 ConnectFailures 12 FreeMem 16384
268153 : MQTT : Failed to connect to broker
268160 : Dummy: value 1: 0.00
268161 : Dummy: value 2: 0.00
268161 : Dummy: value 3: 0.00
268161 : Dummy: value 4: 0.00
268163 : EVENT: dummy#SetLocal=0.00
268194 : EVENT: dummy#firstUse=0.00
268225 : EVENT: dummy#=0.00
268255 : EVENT: dummy#=0.00
277588 : Host unreachable: 0.0.0.0
277588 : Wifi  : Detected strange behavior, reset wifi.
277589 : Reset WiFi.
277589 : WIFI : Switch off WiFi
277591 : WIFI : Set WiFi to STA
277593 : NTP  : NTP host pool.ntp.org (0.0.0.0) unreachable
277603 : EVENT: Clock#Time=Thu,00:04
282894 : IMPT : Failed to connect to MQTT broker - attempt 1
288395 : IMPT : Failed to connect to MQTT broker - attempt 2
293896 : IMPT : Failed to connect to MQTT broker - attempt 3
299406 : MQTT : Failed to connect to broker
299407 : EVENT: WiFi#Disconnected
299438 : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 29 s
299451 : WD   : Uptime 5 ConnectFailures 16 FreeMem 16360
304461 : MQTT : Failed to connect to broker
313635 : Host unreachable: 0.0.0.0
313636 : Wifi  : Detected strange behavior, reset wifi.
313637 : Reset WiFi.
313637 : WIFI : Switch off WiFi
313639 : WIFI : Set WiFi to STA
313641 : NTP  : NTP host pool.ntp.org (0.0.0.0) unreachable
313651 : EVENT: Clock#Time=Thu,00:05
318943 : IMPT : Failed to connect to MQTT broker - attempt 1
324444 : IMPT : Failed to connect to MQTT broker - attempt 2
329944 : IMPT : Failed to connect to MQTT broker - attempt 3
335454 : MQTT : Failed to connect to broker
335455 : EVENT: WiFi#Disconnected
335486 : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 29 s
335499 : WD   : Uptime 5 ConnectFailures 20 FreeMem 16384
340509 : MQTT : Failed to connect to broker
340517 : Dummy: value 1: 0.00
340517 : Dummy: value 2: 0.00
340517 : Dummy: value 3: 0.00
340517 : Dummy: value 4: 0.00
340519 : EVENT: dummy#SetLocal=0.00
340551 : EVENT: dummy#firstUse=0.00
340582 : EVENT: dummy#=0.00
340612 : EVENT: dummy#=0.00
350933 : Host unreachable: 0.0.0.0
350934 : Wifi  : Detected strange behavior, reset wifi.
350934 : Reset WiFi.
350935 : WIFI : Switch off WiFi
350936 : WIFI : Set WiFi to STA
350939 : NTP  : NTP host pool.ntp.org (0.0.0.0) unreachable
356204 : IMPT : Failed to connect to MQTT broker - attempt 1
361705 : IMPT : Failed to connect to MQTT broker - attempt 2
367206 : IMPT : Failed to connect to MQTT broker - attempt 3
372716 : MQTT : Failed to connect to broker
372717 : EVENT: WiFi#Disconnected
372749 : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 29 s
372754 : QEI  : 0
372758 : EVENT: rotary#counter=0.00
372779 : ACT  : gpio,0,0
372780 : SW   : GPIO 0 Set to 0
372787 : ACT  : oled,2,1,Set=0..
372834 : ACT  : timerset,1,5
372875 : WD   : Uptime 6 ConnectFailures 24 FreeMem 16384
377885 : MQTT : Failed to connect to broker
388056 : Host unreachable: 0.0.0.0
388056 : Wifi  : Detected strange behavior, reset wifi.
388057 : Reset WiFi.
388057 : WIFI : Switch off WiFi
388059 : WIFI : Set WiFi to STA
388061 : NTP  : NTP host pool.ntp.org (0.0.0.0) unreachable
388071 : EVENT: Clock#Time=Thu,00:06
393363 : IMPT : Failed to connect to MQTT broker - attempt 1
398863 : IMPT : Failed to connect to MQTT broker - attempt 2
404364 : IMPT : Failed to connect to MQTT broker - attempt 3
404866 : EVENT: Rules#Timer=1
404887 : ACT  : gpio,0,1
404888 : SW   : GPIO 0 Set to 1
404900 : ACT  : taskvalueset,2,1,18
404921 : ACT  : encwrite,18
404928 : QEI  : encwrite,18
404935 : ACT  : oled,2,1,Set=18°C
404979 : ACT  : tone 14,150,75
405056 : SW   : tone 14,150,75
410076 : MQTT : Failed to connect to broker
410077 : EVENT: WiFi#Disconnected
410108 : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 29 s
410121 : WD   : Uptime 6 ConnectFailures 28 FreeMem 16360
415131 : MQTT : Failed to connect to broker
415138 : Dummy: value 1: 0.00
415139 : Dummy: value 2: 0.00
415139 : Dummy: value 3: 0.00
415139 : Dummy: value 4: 0.00
415141 : EVENT: dummy#SetLocal=0.00
415172 : EVENT: dummy#firstUse=0.00
415202 : EVENT: dummy#=0.00
415233 : EVENT: dummy#=0.00
425403 : Host unreachable: 0.0.0.0
425404 : Wifi  : Detected strange behavior, reset wifi.
425404 : Reset WiFi.
425405 : WIFI : Switch off WiFi
425406 : WIFI : Set WiFi to STA
425409 : NTP  : NTP host pool.ntp.org (0.0.0.0) unreachable
430675 : IMPT : Failed to connect to MQTT broker - attempt 1
436176 : IMPT : Failed to connect to MQTT broker - attempt 2
441676 : IMPT : Failed to connect to MQTT broker - attempt 3
447187 : MQTT : Failed to connect to broker
447188 : EVENT: WiFi#Disconnected
447219 : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 29 s
447232 : WD   : Uptime 7 ConnectFailures 32 FreeMem 16384
452242 : MQTT : Failed to connect to broker

For me, after the same switch-off time is ok. Maybe the reason is MQTT, NTP, orr rules. My node is almost clean, only the FHEM controller and 3 devices: RSSI, RAM and Uptime reported to it.

5040 : WIFI : Connected! AP: lipowo (11:11:11:11:11:11) Ch: 6 Duration: 4787 ms
5041 : WIFI : Static IP: 192.168.3.212 (espt-99) GW: 192.168.3.49 SN: 255.255.255.0 duration: 1 ms
5048 : Webserver: start
27146 : WIFI : Disconnected! Reason: '(200) Beacon timeout' Connected for 22 s
28107 : WIFI : Connecting lipowo attempt #0
28107 : IP : Static IP : 192.168.3.212 GW: 192.168.3.49 SN: 255.255.255.0 DNS: 8.8.8.8
30266 : WD : Uptime 1 ConnectFailures 0 FreeMem 19624
30971 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2864 ms
31107 : WIFI : Connecting lipowo attempt #1

105445 : WIFI : Connecting lipowo attempt #25
105445 : IP : Static IP : 192.168.3.212 GW: 192.168.3.49 SN: 255.255.255.0 DNS: 8.8.8.8
108354 : WIFI : Connected! AP: lipowo (11:11:11:11:11:11) Ch: 6 Duration: 2908 ms
108355 : WIFI : Static IP: 192.168.3.212 (espt-99) GW: 192.168.3.49 SN: 255.255.255.0 duration: 2 ms
120266 : WD : Uptime 2 ConnectFailures 0 FreeMem 16856
121446 : SYS : 2.00
122364 : SYS : 16440.00
123484 : SYS : -73.00
129536 : WIFI : Set WiFi to STA
150266 : WD : Uptime 3 ConnectFailures 0 FreeMem 18560
180266 : WD : Uptime 3 ConnectFailures 0 FreeMem 18560
181538 : SYS : 3.00
182538 : SYS : 18488.00
183538 : SYS : -73.00

Hello. I have the same connectivity issues (No AP found) with official fw ESP_Easy_mega-20180424_normal_ESP8266_4096

5163 : Webserver: start
30509 : WD : Uptime 1 ConnectFailures 0 FreeMem 16496
60509 : WD : Uptime 1 ConnectFailures 0 FreeMem 16496
90509 : WD : Uptime 2 ConnectFailures 0 FreeMem 16208
120509 : WD : Uptime 2 ConnectFailures 0 FreeMem 16208
150509 : WD : Uptime 3 ConnectFailures 0 FreeMem 16208
180509 : WD : Uptime 3 ConnectFailures 0 FreeMem 16208
210509 : WD : Uptime 4 ConnectFailures 0 FreeMem 16208
240509 : WD : Uptime 4 ConnectFailures 0 FreeMem 16208
270509 : WD : Uptime 5 ConnectFailures 0 FreeMem 16208
276555 : WIFI : Disconnected! Reason: '(200) Beacon timeout' Connected for 4 m 32 s
277543 : Webserver: stop
277543 : WIFI : Connecting net-1252-ki attempt #0
279682 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2138 ms
279683 : WIFI : Connection Failed
279783 : WIFI : Set WiFi to AP
280673 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
300509 : WD : Uptime 5 ConnectFailures 0 FreeMem 15840

I downloaded commit 4af29c4 from TD-er's fork and build it (just pressed the build button).

Excuse me for the offtopic, but should I use the 'dev' version or 'normal' is okay?
Also how to I force the PlatformIO to build specified version? It did 16 builds of dev, normal, hard, test, esp8285 and etc...

@giig1967g
There is something strange going on with your node.
I claims to be connected, but routing data does not seem to work.
I have seen that happen here also and for ESP32 there is a event possible to detect when the STA mode is stable.
The ESP8266 does not have such an event, but we could fake one, just to allow the wifi electronics to stabilize after switching on.
In my tests here, these "connected, but no connection" issues were a lot harder to reproduce after this.

I will change the 'reset wifi' to a disconnect, which is a more elegant solution and does not depend on stabilizing the wifi after starting. The current implementation uses WIFI_OFF and re-enable.

I also linked a rar file with all pre-built binaries. That saves a lot of time :)

TD-er_wifi_stability_core-2.4.1

You can build a single build via the menu at the bottom left of the PlatformIO/Atom screen.

Whether you need normal/dev/test depends on the plugins you need.
And the ESP8266/8285 is about the CPU you have.
The last number (1024/4096) is about the size of the flash memory.

I have just tested the ESP8266 4M version and the log is very similar.
I use Openhab MQTT and MQTT import if it matters.

Will try now without any of those to see if there is an impact.

I never tested with MQTT import.
It may be possible that one does try to make some connection before the wifi is ready.
And you really should not try to start data transfers before the wifi is ready.

The accesspoint may refuse connection when you try to send data before the authentication is complete.
When that happens, the accesspoint should react with a disconnect reason stating exactly that. But I've seen a lot of wifi issues due to AP firmware versions not following the standards. So it may very well be this could be one of the (many possible) reasons why this is happening.

Could you test with MQTT import disabled?

I have just finished testing removing the MQTT device from the device list.
Same behaviour:

152201 : WD   : Uptime 3 ConnectFailures 0 FreeMem 14920
153507 : EVENT: WiFi#Disconnected
153537 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2878 ms
153628 : WIFI : AP Mode ssid will be ESPT3_3 with address 192.168.4.1
153628 : WIFI : Connecting KeepOut attempt #25
153629 : IP   : Static IP : 192.168.1.203 GW: 192.168.1.1 SN: 255.255.255.0 DNS: 8.8.8.8
156520 : WIFI : Connected! AP: KeepOut (BC:EE:7B:EF:A3:38) Ch: 9 Duration: 2891 ms
156521 : WIFI : Static IP: 192.168.1.203 (ESPT3-3) GW: 192.168.1.1 SN: 255.255.255.0   duration: 2 ms
166747 : Host unreachable: 0.0.0.0
166748 : Wifi  : Detected strange behavior, reset wifi.
166749 : Reset WiFi.
166749 : WIFI : Switch off WiFi
166752 : WIFI : Set WiFi to STA
166753 : NTP  : NTP host pool.ntp.org (0.0.0.0) unreachable
166758 : EVENT: WiFi#Connected
166805 : IP blocked: 0.0.0.0 Allowed: 192.168.1.0 - 192.168.1.255
171866 : MQTT : Failed to connect to broker
176886 : MQTT : Failed to connect to broker
186871 : Host unreachable: 0.0.0.0
186871 : Wifi  : Detected strange behavior, reset wifi.
186872 : Reset WiFi.
186872 : WIFI : Switch off WiFi
186874 : WIFI : Set WiFi to STA
186876 : NTP  : NTP host pool.ntp.org (0.0.0.0) unreachable
191892 : MQTT : Failed to connect to broker
191893 : EVENT: WiFi#Disconnected
191923 : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 10 s
191931 : WD   : Uptime 3 ConnectFailures 6 FreeMem 17160
196941 : MQTT : Failed to connect to broker

disable ntp

In Networking.ino, could you change the call to resetWiFi() ?

It is located in the hostReachable() function.

Change the last part to: (only 1 line and one log entry)

  String log = F("Host unreachable: ");
  log += formatIP(ip);
  addLog(LOG_LEVEL_ERROR, log);
  if (ip[1] == 0 && ip[2] == 0 && ip[3] == 0) {
    // Work-around to fix connected but not able to communicate.
    addLog(LOG_LEVEL_ERROR, F("Wifi  : Detected strange behavior, reconnect wifi."));
    WifiDisconnect();
  }
  return false;
}

Tested several situations:
unit: 8266 4M

A) firmware: your latest firmware from dropbox with the change that you suggested (resetWiFi -> WifiDisconnect)
1) brand new 8266 unit with just your firmware: WORKS: after router reboot, it reconnects to wifi
2) same unit but with several devices: DO NOT RECONNECT
3) same as 2) but without MQTT IMPORT: DO NOT RECONNECT
4) same as 2) but without NTP: WORKS

B) firmware: your latest build from dropbox (without changing the code)
1) same as 4) above (with NTP disabled): WORKS

So in other words, it seems that the problem happens when NTP is enabled.
(followed @melwinek suggestion 👍 )

And if you enable NTP after a while, does it resolve to the proper NTP servers and set the time correctly?

I have two units running at the same time:
one did set the time correctly but the other didn't.
The one that did was the 8266 with the modifed software (resetWiFi -> WifiDisconnect).
The one that didn't was the 8285 with the original software.

Will try again to see if it is repeatable

EDIT. the second unit now set the time too (it took several minutes)

Unfortunately I don't have serial debug wire at the test location, but ESP8266 has rx power of about -89 dBm (more or less) and constantly tries to connect to the pre-configured AP. Sometimes I can see its own WiFi network (like ESP_Easy_0), where I connected to check the log messages (over 100 reconnects in a few minutes).

Now I placed it at better location and it shows -84 dBm and works pretty stable.
For me with the new firmwares (event based wifi?) the coverage dropped. Tomorrow I plan to test the legacy firmware to see any rx power differences.

You have to look at the IP's it tries to resolve to and also what the log states about them.
If they resolve to a proper IP (thus no 0.0.0.0 or 1.0.0.0) then things will just work eventually.

When you don't set a NTP server, it will use 1.pool.ntp.org .... 4.pool...
These will be chosen at random and return a random chosen NTP server.
However, the list of NTP servers contain quite a lot that are not reachable.

@kmihaylov
What version were you testing?
The test build I made, is still using event based wifi.
As soon as it detects a disconnect, it will immediately retry to connect again and log this.

The old versions would also do so, but not log about it.
You could however experience MQTT disconnects, high CPU usage and badly reachable web page. But no log about its cause.
Also newer versions update the RSSI values every second when using OLED framed plugin. The old one only updated when the screen refreshed.
So please take that into account when comparing versions.
The old one did also drop connections due to bad reception.

You could also try to change the node's orientation to see if that improves the reception.
I did not yet change anything to TX power, so the reception quality should be the same.

@TD-er : more tests:
1st unit with modified firmware: after router reboot it connected and remained connected also after setting the NTP

2nd unit with original sotware: after router reboot it connected but as soon as I set the NTP, it lost connection with router and couldn't connect anymore

Does that 2nd one have proper DNS and gateway setup?
Both use DHCP or Static IP, or mixed?

Did again the full tests above and got similar results:
1st unit (8266) with modified firmware: with NTP disabled, after router reboot it connected and remained connected also after setting the NTP on

2nd unit with original firmware: with NTP disabled, after router reboot it connected but as soon as I set the NTP, it lost connection with router and couldn't connect anymore. this time it crashed.

What do you call "original firmware" ?

both have static ip with gateway and dns set.
original firmware is the one that you provided in your dropbox
modified firmware is the one that I have modified changing resetWiFi -> WifiDisconnect.

Just now Unit 1 crashed... weird.

Log:

749283 : EVENT: Clock#Time=Sat,00:11
752986 : WD   : Uptime 13 ConnectFailures 0 FreeMem 12320
782986 : WD   : Uptime 13 ConnectFailures 0 FreeMem 12320
784285 : Dummy: value 1: 0.00
784285 : Dummy: value 2: 0.00
784285 : Dummy: value 3: 0.00
784285 : Dummy: value 4: 0.00
784287 : EVENT: dummy#SetLocal=0.00
784322 : EVENT: dummy#firstUse=0.00
784356 : EVENT: dummy#=0.00
784393 : EVENT: dummy#=0.00
809285 : EVENT: Clock#Time=Sat,00:12
812986 : WD   : Uptime 14 ConnectFailures 0 FreeMem 12320
842986 : WD   : Uptime 14 ConnectFailures 0 FreeMem 12320
844289 : Dummy: value 1: 0.00
844289 : Dummy: value 2: 0.00
844290 : Dummy: value 3: 0.00
844290 : Dummy: value 4: 0.00
844292 : EVENT: dummy#SetLocal=0.00
844326 : EVENT: dummy#firstUse=0.00
844360 : EVENT: dummy#=0.00
844396 : EVENT: dummy#=0.00
869292 : EVENT: Clock#Time=Sat,00:13
872986 : WD   : Uptime 15 ConnectFailures 0 FreeMem 12320
902986 : WD   : Uptime 15 ConnectFailures 0 FreeMem 12320
904294 : Dummy: value 1: 0.00
904294 : Dummy: value 2: 0.00
904294 : Dummy: value 3: 0.00
904295 : Dummy: value 4: 0.00
904297 : EVENT: dummy#SetLocal=0.00
904331 : EVENT: dummy#firstUse=0.00
904366 : EVENT: dummy#=0.00
904401 : EVENT: dummy#=0.00
929297 : EVENT: Clock#Time=Sat,00:14
932986 : WD   : Uptime 16 ConnectFailures 0 FreeMem 14440
962986 : WD   : Uptime 16 ConnectFailures 0 FreeMem 14440
964301 : Dummy: value 1: 0.00
964301 : Dummy: value 2: 0.00
964301 : Dummy: value 3: 0.00
964301 : Dummy: value 4: 0.00
964303 : EVENT: dummy#SetLocal=0.00
964335 : EVENT: dummy#firstUse=0.00
964365 : EVENT: dummy#=0.00
964397 : EVENT: dummy#=0.00
964751 : IMPT : [mqtt#temp] : 25.10
964752 : EVENT: mqtt#temp=25.10
964795 : ACT  : oled,3,1,T=25.1°C
966958 : IMPT : [mqtt#temp] : 25.10
966958 : EVENT: mqtt#temp=25.10
967000 : ACT  : oled,3,1,T=25.1°C
988464 : IMPT : [mqtt#set] : 22.00
988465 : EVENT: mqtt#set=22.00
988501 : ACT  : encwrite,22

Exception (28):
epc1=0x40256126 epc2=0x00000000 epc3=0x40000f68 excvaddr=0x00000004 depc=0x00000000

ctx: cont
          sp: 3fff43a0 end: 3fff4de0 offset: 01a0

>>>stack>>>
           3fff4540:  3fff7cbd 3fff45b8 3fff45a0 40256f25
3fff4550:  3fff458a 00000000 00000009 40257820
3fff4560:  3fff5030 0000049d 3fff4589 402563c9
3fff4570:  3fff5030 0000048f 0000048f 4010020c
3fff4580:  3fff7d0c 00000020 38397c9c 39303538
3fff4590:  00000000 00002478 0000048f 00000005
3fff45a0:  00000009 3fff4600 3fff4600 3fff138c
3fff45b0:  00000020 3fff463c 00000000 3fff138c
3fff45c0:  3fff7d0c 3fff3cf0 00000002 4025648a
3fff45d0:  3fff47c4 00000000 00000002 40214e5f
3fff45e0:  3fff47c4 00000000 3fff4710 40214eef
3fff45f0:  3fff47c4 00000000 3fff4710 40239606
3fff4600:  00000000 00000000 00000000 4010020c
3fff4610:  00000000 00000000 3fff464c 40100690
3fff4620:  3ffeb04c 00000000 00000000 00000000
3fff4630:  3fff7ccc 0000000f 00000008 3fff7d0c
3fff4640:  0000001f 00000012 00000000 00000000
3fff4650:  00000001 00000000 00000000 00000000
3fff4660:  00000000 65746972 3fff4680 00000038
3fff4670:  3fff47c4 0000000d 3fff4710 40213371
3fff4680:  00000000 00000000 00000000 40100500
3fff4690:  00000000 00000000 00000000 00000000
3fff46a0:  00000000 3fff4700 3fff8df4 0000000f
3fff46b0:  00000000 3fff7c6c 0000000f 00000000
3fff46c0:  3fff7c84 0000000f 00000000 00000000
3fff46d0:  3ffeb04c 00000000 3fff47c4 40256d95
3fff46e0:  00000001 00000000 3fff47c4 40256e98
3fff46f0:  00000001 00000000 00000000 00000008
3fff4700:  00000001 00000000 00000000 402347a6
3fff4710:  00000000 00000000 00000000 3fff7400
3fff4720:  00000016 00000000 00000000 00000000
3fff4730:  00000000 3fff5800 3fff766c 0000000f
3fff4740:  00000000 3fff8dac 0000000f 00000000
3fff4750:  3fff8dc4 0000000f 00000000 00000000
3fff4760:  74657323 0d6f6420 6520200a 7277636e
3fff4770:  2c657469 74716d5b 65732374 0a0d5d74
3fff4780:  61742020 61766b73 7365756c 322c7465
3fff4790:  5b2c312c 7474716d 74657323 2f2f205d
3fff47a0:  401077d0 00000000 000003e8 3fff3cf0
3fff47b0:  3fff7684 3fff76c4 00000000 00000000
3fff47c0:  00000000 3fff8ddc 0000000f 0000000b
3fff47d0:  3fff8d6c 0000000f 0000000b 3fff8d54
3fff47e0:  0000000f 0000000b 3fff8d3c 0000000f
3fff47f0:  00000000 3fff8d24 0000000f 0000000b
3fff4800:  3fff76dc 0000003f 0000000b 3fff8d84
3fff4810:  0000001f 00000012 3fff487c 40256d17
3fff4820:  00000001 00000000 00000000 3fff4954
3fff4830:  0000001f 3fff4870 00000040 00000000
3fff4840:  ffffffff 3fff4954 3fff487c 40256e98
3fff4850:  000f0031 3fff4954 00000001 3fff2e5f
3fff4860:  000f1531 3fff4954 00000001 4023494b
3fff4870:  00000001 3fff4954 3fff4880 3fff58ec <
3fff4880:  0000000f 0000000a 3fff58d4 0000000f
3fff4890:  0000000a 3fff58ac 0000001f 00000015
3fff48a0:  00000001 3fff4ae0 3fff2d69 4023646c
3fff48b0:  32484f2f 6174732f 2f737574 5053456e
3fff48c0:  6d655431 61726570 65727574 00000000
3fff48d0:  00000000 00000000 484f2f00 74732f32
3fff48e0:  73757461 65536e2f 6d655474 00003170
3fff48f0:  00000000 00000000 00000000 00000000
3fff4900:  4f2f0000 732f3248 75746174 546e2f73
3fff4910:  6f6d7265 00000031 00000000 00000000
3fff4920:  00000000 00000000 00000000 00000000
3fff4930:  00000000 00000000 00000000 00000000
3fff4940:  00000000 00000000 00000000 00000000
3fff4950:  00000000 3fff91cc 0000000f 0000000e
3fff4960:  3fff5884 0000001f 00000019 3fff585c
3fff4970:  0000001f 00000015 3fff907c 0000001f
3fff4980:  00000015 3fff92d4 0000000f 00000002
3fff4990:  3fff9054 0000001f 00000014 3fff902c
3fff49a0:  0000001f 00000010 41b00000 40256d63
3fff49b0:  3fff48d9 00000001 3fff4b14 40256d95
3fff49c0:  3fff4b30 3fff7abd 3fff4b14 00000024
3fff49d0:  3fff4b30 00000004 3fff4ae0 40209b06
3fff49e0:  00003232 00000000 ffffffff 3fff5030
3fff49f0:  00000010 00000010 00000000 3fff5030
3fff4a00:  00000010 00000010 00000000 3fff5030
3fff4a10:  00000010 00000010 00000000 3fff5030
3fff4a20:  00000010 00000010 00000000 4010053d
3fff4a30:  00000000 00000002 3fff4cc0 3fff5030
3fff4a40:  00000010 00000010 00000000 ffffffff
3fff4a50:  3fff3cd0 00000002 3fff1aa8 40274614
3fff4a60:  402a1414 00000003 3fff4ab0 40207a48
3fff4a70:  00000000 3fff4ad0 3fff1aec 4027d023
3fff4a80:  402557e4 3ffe93b8 3fff1aec ffffffff
3fff4a90:  3fff5030 0000072f 0000072f 4010020c
3fff4aa0:  3ffeb04c 3ffe93b8 3fff4ad0 40100690
3fff4ab0:  3fff5030 00000586 00000586 4010020c
3fff4ac0:  00000000 3ffeb5f8 00000001 40100690
3fff4ad0:  4027be35 00000000 00000000 401073e0
3fff4ae0:  00000400 3fff1000 00000000 40284f00
3fff4af0:  00000000 00000000 00000000 00000000
3fff4b00:  00000000 3ffef300 3fff9004 0000001f
3fff4b10:  00000015 3fff919c 0000000f 00000002
3fff4b20:  3fff91b4 0000000f 00000000 00000000
3fff4b30:  3fff92bc 0000000f 00000002 3fff8454
3fff4b40:  0000001f 00000015 3fff4b60 00000016
3fff4b50:  3fff7a9c 00000019 00000001 3fff4ba0
3fff4b60:  3fff4ba0 000f152a 3fff7a9c 40258f7c
3fff4b70:  3fff4ba0 00000002 00000015 402549fe
3fff4b80:  32484f2f 6174732f 2f737574 7465536e
3fff4b90:  706d6554 000f0031 3fff7a9c 40254910
3fff4ba0:  3fff5001 0000014f 3fff4ccc 00000014
3fff4bb0:  3fff1c90 3fff4d10 3fff4ccc 3fff4b88
3fff4bc0:  3ffe9608 00000000 00000000 00000004
3fff4bd0:  3fff1c90 3fff4d10 00000005 40236258
3fff4be0:  3ffeb975 401042bb 3fff4d10 4020f51d
3fff4bf0:  40101bd1 3ffef388 3ffef248 4023715a
3fff4c00:  00000000 00000734 00000734 4010020c
3fff4c10:  3fff5030 00000734 00000734 00000004
3fff4c20:  3fff3cd0 00000002 3fff1aa8 40274614
3fff4c30:  00000014 00003978 0000072f 40207a48
3fff4c40:  00000010 00000010 3fff1b88 4027d023
3fff4c50:  402557e4 00000005 3fff1b88 40256e98
3fff4c60:  00000010 00000001 3fff1aa8 4020a7ae
3fff4c70:  3fff5030 0000072f 0000072f 4010020c
3fff4c80:  3fff1c90 00000005 3fff4cb0 40100690
3fff4c90:  3fff5030 00000152 00000152 4010020c
3fff4ca0:  3fff1c90 00000005 3fff4cd0 40100690
3fff4cb0:  3fff5030 0000014f 0000014f 4010020c
3fff4cc0:  3fff9294 0000001f 00000014 3fff629c
3fff4cd0:  0000001f 00000010 00000000 40256cbc
3fff4ce0:  3ffeb04c 3fffc6fc 40292d58 4020ad3e
3fff4cf0:  00000000 00000000 00000000 00000004
3fff4d00:  3fff1c90 00000005 3fff4d10 402134b4 <
3fff4d10:  00000400 00001000 00000000 40257d01
3fff4d20:  00000000 00000000 00000000 00000000
3fff4d30:  00000000 00000004 3fff83c4 0000000f
3fff4d40:  00000000 3fff65fc 0000000f 00000000
3fff4d50:  3fff6614 0000000f 00000000 00000000
3fff4d60:  4027e627 00000000 00000004 00000024
3fff4d70:  3fff2f44 3fff1c80 00000000 00000001
3fff4d80:  4027e627 00000000 000f1527 3fff3db0
3fff4d90:  3fffdad0 3fff1c90 3fff1c3c 40234df3
3fff4da0:  3fffdad0 00000000 3fff1c80 4023f6d9
3fff4db0:  00000000 00000000 00000001 40257cd9
3fff4dc0:  3fffdad0 00000000 3fff3daa 40257d04
3fff4dd0:  feefeffe feefeffe 3fff3dc0 40100700
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v614f7c32
~ld
   ▒U87 :


Just did again the whole test:
1st unit (8266) with modified firmware: with NTP disabled, after router reboot it connected and remained connected also after setting the NTP on (without setting the NTP server, leaving it blank)

2nd unit with original firmware: with NTP disabled, after router reboot it connected but as soon as I set the NTP (without setting the NTP server, leaving it blank), it lost connection with router and couldn't connect anymore and after few seconds it crashed.

Could you build using my latest commits? https://github.com/TD-er/ESPEasy/tree/bugfix/wifi_stability
I added a few lines to detect wifi connection before trying to do DNS resolve.

@TD-er I compare the official ESP_Easy_mega-20180424_normal_ESP8266_4096 and your ESPEasy-bugfix-wifi_stability commit 4af29c4.

From these two, yours works better. I cited the reconnect counter from the log (shown in the web interface of the ESP8266).

However I have another ESP8266 board near the same location with the legacy R120 release and for the whole winter it didn't make any connection problems.

I should repeat here, that if the WiFi signal is strong, the v2 branch works well.

I'll prepare two equal boards, one with your firmware and the other one with the legacy R120 (or whatever I can find) to compare how they behave.

One of my most stable nodes here, run code based on what was present at 20171231.
So you could also try a version around that time.

Local Time: | 2018-04-27 23:26:12 |   | Uptime: | 61 days 4 hours 35 minutes

N.B. that one did not have DST present like there is now, I see ;)

Your latest commits still have resetWiFi() instead of DisconnectWiFi(), correct?
EDIT: my fault (it's late).
You changed to DisconnectWiFi.
I am building the new version.

@giig1967g I hope not.
I pushed all my commits, as you can see here:
https://github.com/TD-er/ESPEasy/commits/bugfix/wifi_stability

EDIT: my fault (it's late).
You changed to DisconnectWiFi.
I am building the new version.

Hi tested new builds:
it's the same as earlier:
without NTP enabled it reconnects after router reboot
with NTP enabled it doesn't reconnect...

It says Wifi#connected but it's not.
LOG:

320301 : EVENT: WiFi#Disconnected
320387 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2875 ms
320427 : WIFI : AP Mode ssid will be ESPT6_16 with address 192.168.4.1
320427 : WIFI : Connecting KeepOut attempt #26
320428 : IP   : Static IP : 192.168.1.206 GW: 192.168.1.1 SN: 255.255.255.0 DNS: 8.8.8.8
scandone
        state: 0 -> 2 (b0)
                          state: 2 -> 3 (0)
                                           state: 3 -> 5 (10)
                                                             add 0
                                                                  aid 3
                                                                       cnt

                                                                           connected with KeepOut, channel 9
                            ip:192.168.1.206,mask:255.255.255.0,gw:192.168.1.1
                                                                              323331 : WIFI : Connected! AP: KeepOut (BC:EE:7B:EF:A3:38) Ch: 9 Duration: 2903 ms
323333 : WIFI : Static IP: 192.168.1.206 (ESPT6-16) GW: 192.168.1.1 SN: 255.255.255.0   duration: 2 ms
ping 1, timeout 1, total payload 0 bytes, 1024 ms
                                                 ping 1, timeout 1, total payload 0 bytes, 1099 ms
                  ping 1, timeout 1, total payload 0 bytes, 1024 ms
                                                                   333519 : Host unreachable: 0.0.0.0
333520 : Wifi  : Detected strange behavior, reconnect wifi.
state: 5 -> 0 (0)
                 rm 0
                     333521 : NTP  : NTP host pool.ntp.org (0.0.0.0) unreachable
333523 : EVENT: WiFi#Connected
341024 : WD   : Uptime 6 ConnectFailures 1 FreeMem 13816
367626 : SYS  : 0.00
367628 : EVENT: ip#ip4=0.00
367714 : EVENT: ip#ip4=0.00 Processing time:86 milliSeconds
371024 : WD   : Uptime 6 ConnectFailures 1 FreeMem 13816
374638 : EVENT: Clock#Time=Sat,00:43
374726 : EVENT: Clock#Time=Sat,00:43 Processing time:88 milliSeconds
380627 : WIFI : Set WiFi to STA
bcn 0
     del if1
            mode : sta(60:01:94:8e:ba:c9)
                                         401024 : WD   : Uptime 7 ConnectFailures 1 FreeMem 16248
427633 : SYS  : 0.00
427635 : EVENT: ip#ip4=0.00
427719 : EVENT: ip#ip4=0.00 Processing time:84 milliSeconds
431024 : WD   : Uptime 7 ConnectFailures 1 FreeMem 16248
434649 : EVENT: Clock#Time=Sat,00:44
434734 : EVENT: Clock#Time=Sat,00:44 Processing time:85 milliSeconds
461024 : WD   : Uptime 8 ConnectFailures 1 FreeMem 16248
487641 : SYS  : 0.00
487643 : EVENT: ip#ip4=0.00
487728 : EVENT: ip#ip4=0.00 Processing time:85 milliSeconds
491028 : WD   : Uptime 8 ConnectFailures 1 FreeMem 16248
494653 : EVENT: Clock#Time=Sat,00:45
494670 : ACT  : publish /ESPT6/dummy/requestedTempUpdate,8
494680 : MQTT : publish failed
494753 : EVENT: Clock#Time=Sat,00:45 Processing time:99 milliSeconds
521028 : WD   : Uptime 9 ConnectFailures 1 FreeMem 16248
547641 : SYS  : 0.00
547643 : EVENT: ip#ip4=0.00
547727 : EVENT: ip#ip4=0.00 Processing time:84 milliSeconds
551028 : WD   : Uptime 9 ConnectFailures 1 FreeMem 16248
554653 : EVENT: Clock#Time=Sat,00:46
554738 : EVENT: Clock#Time=Sat,00:46 Processing time:85 milliSeconds


That's very strange.

For now, I will just push the code to build a version for tomorrow to test.
And tomorrow, we will continue the investigation to see what's happening here.
Maybe it is something strange in the ping library?
There is also another async ping library, which may be even better to get the responses more snappy and also not lead to crashes and bad connections.

Can you reproduce my situation?

Not reliably.
All my nodes use NTP. Some use ntp.xs4all.nl and some have no NTP host set and will thus use X.pool.ntp.org.

So what happens if instead of a 'working' NTP server an address that will never resolve is used ?

it should retry forever, with some decent interval,

I have done more tests:
recreated from scratch a new unit with your latest firmware.

The combination of configuration that does not allow to reconnect after the reboot of the router is NTP enabled, Static IP and rules.
Without only one of those, it works. With all 3 it doesn't!

I am attaching my config and my rules for you to try.
Static ip=192.168.1.203
esp8266.zip

Worth it ? Or not.. ?
worth_n

@giig1967g Controllers ?

With some of the issues 'going around' - today I did a forced update, I do not understand [Fixed]

3160230202802176_n

Controller openhab MQTT

About the "fixed" messages, that's what is meant to be.
Some libraries are fixed at a specific version, to guarantee reproducibility.
This is done with the "@1.7.0" to keep that version fixed.
So trying to update will be a void operation.

attching full debug log with STATIC IP (not working)
log.txt

Attaching full debug log with DHCP (working)
log2.txt

I will be off for two days on week end leave.
Will not be able to test properly.

@Oxyandy About the PlatformIO subscription.
At this moment it is does not allow debugging of the ESP12, that's being used.
So the added features for our usecase are very limited.

As soon as it does allow remote debugging on the ESP12, I will certainly get one of those subscriptions.
I really miss debugging options on this platform.

Looks like this thread has become some sort of generic discussion of what?
I have a hard time reading this and nothing getting confused. Looks like related to the basic Wifi connect issues where we already have #1302. Should we better focus on fixing basic wifi first? And then proceed to the next level.

@mvdbro I agree, there is quite some information overload and these threads are becoming way too long.
A bit more structure in information flow would be welcome.

Been busy had very little time, trying to catch up
I flashed the build you put up on dropbox, from your wifi stability branch, was OK - it lasted all night
then
ESP_Easy_mega-20180428_normal_ESP8266_1024.bin
log below..

INIT : Booting version: mega-20180428 (ESP82xx Core 2_4_1)
74 : INIT : Cold Boot
75 : FS   : Mounting...
81 : FS   : Mount successful, used 75802 bytes of 113201
377 : CRC  : program checksum       ...OK
387 : CRC  : SecuritySettings CRC   ...OK
388 : CRC  : binary has changed since last save of Settings
407 : INIT : Free RAM:22640
407 : INIT : I2C
407 : INIT : SPI not enabled
422 : INFO : Plugins: 47 [Normal] (ESP82xx Core 2_4_1)
423 : EVENT: System#Wake
427 : WIFI : Set WiFi to STA
428 : WIFI : Connecting MAD_IOT attempt #0
429 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
444 : EVENT: System#Boot
447 : SW   : Switch state 1 Output value 1
449 : EVENT: Float_SW#Switch=1.00
1004 : WD   : Uptime 0 ConnectFailures 0 FreeMem 22832
3295 : EVENT: WiFi#Disconnected
3298 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2866 ms
4005 : WIFI : Connecting MAD_IOT attempt #1
4006 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
6867 : EVENT: WiFi#Disconnected
6870 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
7005 : WIFI : Connecting MAD_IOT attempt #2
7006 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
9868 : EVENT: WiFi#Disconnected
9870 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
10011 : WIFI : Connecting MAD_IOT attempt #3
10012 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
12874 : EVENT: WiFi#Disconnected
12876 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
13010 : WIFI : Connecting MAD_IOT attempt #4
13011 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
15874 : EVENT: WiFi#Disconnected
15876 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
16010 : WIFI : Connecting MAD_IOT attempt #5
16011 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
18873 : EVENT: WiFi#Disconnected
18876 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
19011 : WIFI : Set WiFi to AP+STA
19903 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
19903 : WIFI : Connecting MAD_IOT attempt #6

Powered 0428 down at WIFI : Connecting MAD_IOT attempt 34
Also saw errors:
'(4) Assoc expire'
'(2) Auth expire'
'(15) 4way handshake timeout'
'(204) Handshake timeout'
Tried cold booting, changing access point etc
Eventually connected & stayed connected..
wifidisconnect
Then results in another over 200 or more connect tries with 0428
Ok moving on to:
ESP_Easy_mega-20180429_normal_ESP8266_1024.bin
Yep looking good..
0429 Works as expected

@Oxyandy May you clarify if the log belongs to 0429? Since at the bottom you wrote "moving on to" .. 0429? Or the log belongs to 0428?

And also may you mention the signal strength?

That log belongs to 20180428,
20180429 works very well for me: the strength is excellent:
802.11N (RSSI -58 dB)

@oxyandy: can you try enabling NTP, and see if it still works?

May I ask (all of) you to test what happens if you change router's TX power level (for example from high to low) and to keep the log?

May you set your log level to "Debug More"?

With my TP-Link TL_WR841N (v. 13, latest firmware) the ESPEasy drops connection because

26469 : WIFI : Disconnected! Reason: '(2) Auth expire'

and doesn't enter in AP mode.

@giig1967g Yes I have NTP enabled, it doesn't show in that log because it never connected with 0428
0429 connects very fast & updates time immediately..
I have no idea why 0428 is such a fail for me & 0429 works fine.. would love to know the difference..
@kmihaylov - Hi, are you using 0429 yet ?

@Oxyandy
Yes.

@kmihaylov hmm ok, logs maybe useful from cold boot
and here I was thinking I had the most sensitive hardware..
How did / does 0428 work for you ?

For me, 4.29 does not connect to wifi. I even had a problem connecting to ESP AP to restore 4.28

I love that comment Melwinek, I have been tortured with Wifi stability
Sounds like 0428 worked for you OK ? So why it failed so badly for me ?
So what works on my hardware, fails for you.. Quirky
The 0429 release works so well I have been playing with source trying to resolve a few long time bugs that have plagued me - each of the new variants of 0429 I have created have also worked perfect.

I will try 4.29 on the test node. Because I can not take logs on others. I would have to pull them out of the wall.

tested todays TD-er commits and my unit now reconnect after router reboot with NTP enabled.
Excellent job. Thanks

@Oxyandy On my test node 4.29 is ok. I will try again on wall switch. This is not the original sonoff touch, it is home made.

@TD-er After your today's commits, my nodes get up even when I turn off the wifi for a few (1-5) seconds. Congratulations.

ESP_Easy_mega-20180430_normal_ESP8266_1024.bin
My mama once said to me:
"She said son, if the bug was gone yesterday, it's probably too good to be true,
for sure will be back tomorrow !"

444 : EVENT: System#Wake
453 : WIFI : Set WiFi to STA
485 : WIFI : Connecting MAD_MOB attempt #0
486 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
499 : EVENT: System#Boot
508 : SW   : Switch state 1 Output value 1
511 : EVENT: Float_SW#Switch=1.00
525 : ACT  : Publish domoticz/in,{"idx":66,"nvalue":0,"svalue":"FLOAT_SWITCH_1_00:00:00"}
1020 : WD   : Uptime 0 ConnectFailures 0 FreeMem 22744
3348 : EVENT: WiFi#Disconnected
3354 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
4031 : WIFI : Connecting MAD_MOB attempt #1
4032 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
6894 : EVENT: WiFi#Disconnected
6900 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
7031 : WIFI : Connecting MAD_MOB attempt #2
7032 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
9894 : EVENT: WiFi#Disconnected
9900 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
10031 : WIFI : Connecting MAD_MOB attempt #3
10032 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
12894 : EVENT: WiFi#Disconnected
12900 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
13030 : WIFI : Connecting MAD_MOB attempt #4
13031 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
15894 : EVENT: WiFi#Disconnected
15900 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
16030 : WIFI : Connecting MAD_MOB attempt #5
16031 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
18894 : EVENT: WiFi#Disconnected
18900 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2861 ms
19031 : WIFI : Set WiFi to AP+STA
19953 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
19953 : WIFI : Connecting MAD_MOB attempt #6
19954 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
22824 : EVENT: WiFi#Disconnected
22830 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
23032 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
23032 : WIFI : Connecting MAD_MOB attempt #7
23033 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
25902 : EVENT: WiFi#Disconnected
25909 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
26032 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
26032 : WIFI : Connecting MAD_MOB attempt #8
26033 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
28902 : EVENT: WiFi#Disconnected
28908 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
29032 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
29032 : WIFI : Connecting MAD_MOB attempt #9
29033 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
31020 : WD   : Uptime 1 ConnectFailures 0 FreeMem 20104
33371 : EVENT: WiFi#Disconnected
33377 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 4332 ms
34033 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
34033 : WIFI : Connecting MAD_MOB attempt #10
34034 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
36904 : EVENT: WiFi#Disconnected
36910 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
37033 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
37033 : WIFI : Connecting MAD_MOB attempt #11
37034 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
39904 : EVENT: WiFi#Disconnected
39910 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms

It eventually connected after 24 tries, but died.. with
94679 : WIFI : Disconnected! Reason: '(200) Beacon timeout' Connected for 12 s
0429 flashed over the top of 0430, instant connect, all OK

With 0429 being a nightly build?
Just to exclude the possibility of something being different on the build environment for the nightly builds.

0429 As downloaded from, (same with 0430)
https://github.com/letscontrolit/ESPEasy/releases

You also did a full restart after flashing?

It's very strange it did work well with 0429 and no longer with 0430.

Yes, tried several things, currently have a patched 0429 with "gpio wrong state fix" on the node,
I'll flash over it with 0430 now

Nope will not connect

26033 : WIFI : Connecting MAD_MOB attempt #8
26034 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
30504 : EVENT: WiFi#Disconnected
30507 : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 4464 ms
30802 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
30803 : WIFI : Connecting MAD_MOB attempt #9
30803 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
31020 : WD   : Uptime 1 ConnectFailures 0 FreeMem 19984
33671 : EVENT: WiFi#Disconnected
33673 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2861 ms
33797 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
33797 : WIFI : Connecting MAD_IOT attempt #10

And what if you switch to DHCP?
Maybe also set the debug log to "Debug more" in "Tools" -> "Advanced"

I had already returned to 0429, ok while here I will change logging & DHCP..
Done: log 0430 DHCP, debug more

13031 : WIFI : Connecting MAD_MOB attempt #4
scandone
15894 : EVENT: WiFi#Disconnected
15896 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2861 ms
16031 : WIFI : Connecting MAD_MOB attempt #5
scandone
18894 : EVENT: WiFi#Disconnected
18896 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2861 ms
19032 : WIFI : Set WiFi to AP+STA
mode : sta(5c:cf:7f:72:96:ec) + softAP(5e:cf:7f:72:96:ec)
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
bcn 0
del if1

add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
19957 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
19958 : WIFI : Connecting MAD_IOT attempt #6
scandone
22823 : EVENT: WiFi#Disconnected
22825 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
23033 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
23033 : WIFI : Connecting MAD_IOT attempt #7
scandone

My ESPEasy wasn't able to connect after it was "kicked out" (?) with "(2) Auth expire". The release from 2904 bypasses this problem.

With you it may be something else.

Could you try running a hotspot from your phone? Just to be sure that it isn't AP related problem?

Also your device doesn't even get to the DHCP negotioation, according to the log...

Here is mu log from yesterday, just for reference:

46772 : WIFI : Disconnected! Reason: '(2) Auth expire' Connected for 33 s
47114 : WIFI : Connecting net-1252-ki attempt #0
scandone
49975 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2861 ms
50115 : WIFI : Connecting net-1252-ki attempt #1
scandone
state: 2 -> 2 (b0)
state: 2 -> 0 (2)
53975 : WIFI : Disconnected! Reason: '(2) Auth expire' Connected for 3860 ms
54115 : WIFI : Connecting net-1252-ki attempt #2
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt

connected with net-1252-ki, channel 2
dhcp client start...
57098 : WIFI : Connected! AP: net-1252-ki (7C:8B:CA:A6:CF:96) Ch: 2 Duration: 2982 ms
ip:10.11.12.102,mask:255.255.255.0,gw:10.11.12.1
57631 : WIFI : DHCP IP: 10.11.12.102 (easy-test-0) GW: 10.11.12.1 SN: 255.255.255.0 duration: 532 ms
57631 : WIFI : Arduino wifi status: WL_CONNECTED ESPeasy internal wifi status: ESPEASY_WIFI_SERVICES_INITIALIZED
pm open,type:2 0
69364 : WD : Uptime 1 ConnectFailures 0 FreeMem 18384

@kmihaylov "a hotspot from your phone? Just to be sure that it isn't AP related problem?"
Yeah I have done all these tricks,
I use 2 routers & my Android hotspot many times, the results are consistent.
For me: 0430 is useless, waiting on 0501 ;)

ESP_Easy_mega-20180501_normal_ESP8266_1024.bin 👎

INIT : Booting version: mega-20180501 (ESP82xx Core 2_4_1)
102 : INIT : Cold Boot
103 : FS   : Mounting...
109 : FS   : Mount successful, used 75802 bytes of 113201
406 : CRC  : program checksum       ...OK
415 : CRC  : SecuritySettings CRC   ...OK
416 : CRC  : binary has changed since last save of Settings
434 : INIT : Free RAM:23512
434 : INIT : I2C
434 : INIT : SPI not enabled
449 : INFO : Plugins: 47 [Normal] (ESP82xx Core 2_4_1)
449 : EVENT: System#Wake
453 : WIFI : Set WiFi to STA
mode : sta(5c:cf:7f:72:96:ec)

add if0
486 : WIFI : Connecting MAD_MOB attempt #0
499 : EVENT: System#Boot
502 : SW   : Switch state 1 Output value 1
506 : EVENT: Float_SW#Switch=1.00
1021 : WD   : Uptime 0 ConnectFailures 0 FreeMem 22712
scandone
3349 : EVENT: WiFi#Disconnected
3351 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
4032 : WIFI : Connecting MAD_MOB attempt #1
scandone
6894 : EVENT: WiFi#Disconnected
6897 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
7032 : WIFI : Connecting MAD_IOT attempt #2
scandone
9895 : EVENT: WiFi#Disconnected
9897 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
10032 : WIFI : Connecting MAD_IOT attempt #3
scandone
12895 : EVENT: WiFi#Disconnected
12897 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
13031 : WIFI : Connecting MAD_MOB attempt #4
.
.
.
scandone
278422 : EVENT: WiFi#Disconnected
278424 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2863 ms
278558 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
278558 : WIFI : Connecting MAD_MOB attempt #80

0429 flashed over the top, perfect, first try 👍

194 : WIFI : Connecting MAD_MOB attempt #0
195 : WIFI  : SDK station status differs from Arduino status. SDK-status: 1 Arduino status: 6
XXXX : Here 0066
207 : EVENT: System#Boot
210 : SW   : Switch state 1 Output value 1
XXXX : Here 0066
214 : EVENT: Float_SW#Switch=1.00
AAAA : Here
1021 : WD   : Uptime 0 ConnectFailures 0 FreeMem 22152
scandone

state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 5
cnt

connected with MAD_MOB, channel 7
dhcp client start...
4983 : WIFI : Connected! AP: MAD_MOB (18:90:D8:AC:0F:D8) Ch: 7 Duration: 4788 ms
XXXX : Here 0066
4984 : EVENT: WiFi#ChangedAccesspoint
4990 : WIFI  : SDK station status differs from Arduino status. SDK-status: 1 Arduino status: 6
ip:192.168.0.108,mask:255.255.255.0,gw:192.168.0.254
10942 : WIFI : DHCP IP: 192.168.0.108 (ESP-Easy-0) GW: 192.168.0.254 SN: 255.255.255.0   duration: 5958 ms
11082 : Current Time Zone:  DST time start: 2018-10-07 01:00:00 offset: 660 minSTD time start: 2018-04-01 01:00:00 offset: 60
0 min
XXXX : Here 0066
11084 : EVENT: Time#Initialized
XXXX : Here 0066
11089 : EVENT: WiFi#Connected
11095 : Webserver: start
11095 : WIFI  : SDK station status differs from Arduino status. SDK-status: 5 Arduino status: 3
11101 : WIFI  : Arduino wifi status: WL_CONNECTED ESPeasy internal wifi status: ESPEASY_WIFI_SERVICES_INITIALIZED
XXXX : Here 0066
11120 : EVENT: Clock#Time=Tue,12:52
11123 : EVENT: Clock#Time=Tue,12:52 Processing time:4 milliSeconds
11188 : MQTT : Intentional reconnect
11286 : MQTT : Connected to broker with client ID: ESPClient_5C:CF:7F:72:96:EC
11287 : Subscribed to: domoticz/out
XXXX : Here 0066
11289 : EVENT: MQTT#Connected
11293 : EVENT: MQTT#Connected Processing time:4 milliSeconds

Nothing really changed with 0501.
So given that, it's good to know nothing changed on the WiFi side of your tests.

Hello,

I also had problems with build 0430 to get it to running on the SONOFF Basic. Reverted back to the one that I flashed before, but that made it not better. The WebIf was very slow and 1 out of 50 request returned nothing. After a while I managed to do a factory reset from WebIf and AP came up again. And after that I configured it again. Now it seems OK again.

I can confirm with @Oxyandy that there is some issue with build 0430.

@Barracuda09
Another Sonoff user 👍 excellent
Can you tell me the date and version on your PCB ?
Have you tried 0429 ?

PCB version 1.1

No I have not tried 0429, I used one form begin of April (do not know I
which, have to check that tonight). I did not what to try that much,
because it switches the lights from an aquarium. So I was a bit
disappointed it did not work an reverting back maid me sad that that also
failed.

But the one I have now seems to loss the connection after I reboot the AP.
So thought I should update it, but unfortunately it failed dramatically. So
it time me some time to make it working again.

PCB dated 5-5-2017 ? If so same revision as me..
As a Sonoff User I can recommend 0429.
I just tried restarting my routers to test reconnect,
I have done this previously - but just confirmed for you, all OK 👍
reconnects perfectly, please try 0429

@Oxyandy, OK I will try it again, thanks for the tip

For my hardware (WEMOS D1), version MEGA-20180501 works as expected.
Wifi connects and reconnects correctly after router reboot.
MQTT import works
MQTT with Openhab works.
Will kepp in testing for few days.

@Oxyandy What Sonoff device? A basic?
I may have a few laying around.

It must be something in these changes:
https://github.com/letscontrolit/ESPEasy/compare/mega-20180429...mega-20180430

Yep, is all I use, I have 40 Sonoff Basics
(ah another cool feature of Github, thanks for example)

You can even compare forks :)

@Oxyandy Could you please test the latest version? I changed LWIP from 2.0 to 1.4 due to a bug in the HTTP POST (large rules got mangled when > 1520 Bytes)
And after that I flashed a couple of Sonoff Basic units.
All work just fine over here. So maybe...... ;)

INIT : Booting version: (ESP82xx Core 2_4_1, NONOS SDK 2.2.1(cfd48f3), LWIP: 1.4.0-RC2)
It connected after 32 attempts. you can do better..
That me just awake now.. 7.20AM,, need ..coffee

I really don't get it...
I'm working here with a Sonoff TH16 and also a Sonoff Basic and all show the same speedy connections:

INIT : Booting version:  (ESP82xx Core 2_4_1, NONOS SDK 2.2.1(cfd48f3), LWIP: 1.4.0-RC2)
100 : INIT : Warm boot #1
102 : FS   : Mounting...
107 : FS   : Mount successful, used 75802 bytes of 113201
110 : CRC  : No program memory checksum found. Check output of crc2.py
122 : CRC  : SecuritySettings CRC   ...OK
140 : INIT : Free RAM:21896
141 : INIT : I2C
141 : INIT : SPI not enabled
155 : INFO : Plugins: 47 [Normal] (ESP82xx Core 2_4_1, NONOS SDK 2.2.1(cfd48f3), LWIP: 1.4.0-RC2)
156 : WIFI : Set WiFi to STA
187 : WIFI : Connecting Lurch2 attempt #0
305 : WD   : Uptime 0 ConnectFailures 0 FreeMem 21168
3952 : WIFI : Connected! AP: Lurch2 (5C:49:79:4D:7B:39) Ch: 6 Duration: 3763 ms
4656 : WIFI : DHCP IP: 192.168.1.97 (ESP-Easy-0) GW: 192.168.1.1 SN: 255.255.255.0   duration: 704 ms
4670 : Webserver: start
5048 : Current Time Zone:  DST time start: 2018-03-25 02:00:00 offset: 120 minSTD time start: 2018-10-28 03:00:00 offset: 60 min

32 attempts, that's about close to 65 seconds, I guess?
Is it right after the SoftAP gets disabled?

Helps ?

97047 : WIFI : Connecting MAD_IOT attempt #31
scandone
99909 : EVENT: WiFi#Disconnected
99912 : WIFI : Disconnected! Reason: '(201) No AP found' Connected for 2862 ms
100046 : WIFI : AP Mode ssid will be ESP_Easy_0 with address 192.168.4.1
100047 : WIFI : Connecting MAD_MOB attempt #32
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt

connected with MAD_MOB, channel 7

dhcp client start...
105814 : WIFI : Connected! AP: MAD_MOB (18:90:D8:AC:0F:D8) Ch: 7 Duration: 5764 ms
105815 : EVENT: WiFi#ChangedAccesspoint
bcn_timout,ap_probe_send_start
ip:192.168.0.107,mask:255.255.255.0,gw:192.168.0.254
110799 : WIFI : DHCP IP: 192.168.0.107 (ESP-Easy-0) GW: 192.168.0.254 SN: 255.255.255.0   duration: 4986 ms
110810 : EVENT: WiFi#Connected
110816 : Webserver: start
110816 : WIFI  : Arduino wifi status: WL_CONNECTED ESPeasy internal wifi status: ESPEASY_WIFI_SERVICES_INITIALIZED
110936 : NTP  : NTP host au.pool.ntp.org (27.124.125.251) queried
111007 : NTP  : NTP replied: 70 mSec
111009 : Current Time Zone:  DST time start: 2018-10-07 01:00:00 offset: 660 minSTD time start: 2018-04-01 01:00:00 offset: 6

Github release,
ESP_Easy_mega-20180502_normal_ESP8266_1024.bin
no time - more testing required later

INIT : Booting version: mega-20180502 (ESP82xx Core 2_4_1, NONOS SDK 2.2.1(cfd48f3), LWIP: 1.4.0-RC2)
104 : INIT : Cold Boot
106 : FS   : Mounting...
112 : FS   : Mount successful, used 75802 bytes of 113201
413 : CRC  : program checksum       ...OK
421 : CRC  : SecuritySettings CRC   ...OK 
422 : CRC  : binary has changed since last save of Settings
440 : INIT : Free RAM:22528
440 : INIT : I2C
440 : INIT : SPI not enabled
455 : INFO : Plugins: 47 [Normal] (ESP82xx Core 2_4_1, NONOS SDK 2.2.1(cfd48f3), LWIP: 1.4.0-RC2)
455 : EVENT: System#Wake
459 : WIFI : Set WiFi to STA
mode : sta(5c:cf:7f:72:96:ec)
add if0
492 : WIFI : Connecting MAD_MOB attempt #0
493 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
506 : EVENT: System#Boot
509 : SW   : Switch state 1 Output value 1
512 : EVENT: Float_SW#Switch=1.00
1005 : WD   : Uptime 0 ConnectFailures 0 FreeMem 21776
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt 

connected with MAD_MOB, channel 7
ip:192.168.0.225,mask:255.255.255.0,gw:192.168.0.254
4283 : WIFI : Connected! AP: MAD_MOB (18:90:D8:AC:0F:D8) Ch: 7 Duration: 3789 ms
4286 : EVENT: WiFi#ChangedAccesspoint
4291 : IP   : Static IP : 192.168.0.225 GW: 192.168.0.254 SN: 255.255.255.0 DNS: 8.8.8.8
4297 : WIFI : Static IP: 192.168.0.225 (ESP-Easy-0) GW: 192.168.0.254 SN: 255.255.255.0   duration: 14 ms
4316 : EVENT: WiFi#Connected
4322 : Webserver: start
4322 : WIFI  : Arduino wifi status: WL_CONNECTED ESPeasy internal wifi status: ESPEASY_WIFI_SERVICES_INITIALIZED
4416 : MQTT : Intentional reconnect
4559 : MQTT : Connected to broker with client ID: ESPClient_5C:CF:7F:72:96:EC
4560 : Subscribed to: domoticz/out
4562 : EVENT: MQTT#Connected
4565 : EVENT: MQTT#Connected Processing time:3 milliSeconds
4658 : NTP  : NTP host au.pool.ntp.org (203.122.222.149) queried
4700 : NTP  : NTP replied: 40 mSec
4701 : Current Time Zone:  DST time start: 2018-10-07 01:00:00 offset: 660 minSTD time start: 2018-04-01 01:00:00 offset: 600 min
4704 : EVENT: Time#Initialized
4708 : EVENT: Time#Initialized Processing time:3 milliSeconds
4712 : EVENT: Clock#Time=Wed,13:13
4715 : EVENT: Clock#Time=Wed,13:13 Processing time:3 milliSeconds

That's faster reconnect, right?

Faster than the self-compiled one before the release, yes & looks stable
No complaint from me, yet..
Not really tested much, but is staying connected while I get my lawnmower rebuilt.
If I find issue, I'll report back, otherwise nothing further posted from me means is doing well.
Thanks !

Load | 9% (LC=12576)
Free Mem | 13040 (12256 - sendContentBlocking)

@TD-er Feedback time, I can click the webpage links (deliberately fast) jumping from page to page,
hit F5 abusively, this means constantly as fast as I can.. never lags, always loads
I don't like 0403 anymore...

We're super happy to hear that! :) Our plan is to make this the expected level of responsiveness, and only make it better from here :+1:

I broke it, yay

  • tried a few quick F5's with device page open to impress myself with response time...

Excuse the discombobulated timestamps
I let it run for a while, looks like it was never going to recover itself, sorry
Serial responded with: maybe it helps

5963508 : IP blocked: 0.0.0.0 Allowed: 192.168.0.0 - 192.168.0.255
5963687 : Ram usage: Webserver only: 0 including Core: 0
5963716 : WD   : Uptime 99 ConnectFailures 0 FreeMem 13536
5963859 : Ram usage: Webserver only: 0 including Core: 0
17:09:00: LmacRxBlk:1
17:09:01: LmacRxBlk:1
LmacRxBlk:1
17:09:03: LmacRxBlk:1
LmacRxBlk:1
17:09:05: LmacRxBlk:1
LmacRxBlk:1
17:09:07: LmacRxBlk:1
17:09:08: LmacRxBlk:1
LmacRxBlk:1
17:09:10: LmacRxBlk:1
LmacRxBlk:1
17:09:12: LmacRxBlk:1
LmacRxBlk:1
17:09:14: LmacRxBlk:1
LmacRxBlk:1
17:09:16: LmacRxBlk:1
LmacRxBlk:1
17:09:18: LmacRxBlk:1
LmacRxBlk:1
17:09:20: LmacRxBlk:1
bcn_timout,ap_probe_send_start
LmacRxBlk:1
17:09:22: LmacRxBlk:1
LmacRxBlk:1
17:09:23: ap_probe_send over, rest wifi status to disassoc
state: 5 -> 0 (1)
rm 0
pm close 7
LmacRxBlk:1
17:09:25: LmacRxBlk:1
LmacRxBlk:1
17:09:27: LmacRxBlk:1
17:09:28: LmacRxBlk:1
LmacRxBlk:1
17:09:30: LmacRxBlk:1
LmacRxBlk:1
17:09:32: LmacRxBlk:1
LmacRxBlk:1
17:09:34: LmacRxBlk:1
17:09:35: LmacRxBlk:1
LmacRxBlk:1
17:09:37: LmacRxBlk:1
LmacRxBlk:1
17:09:39: LmacRxBlk:1
LmacRxBlk:1
17:09:41: LmacRxBlk:1
LmacRxBlk:1
17:09:43: LmacRxBlk:1
LmacRxBlk:1
17:09:45: LmacRxBlk:1
LmacRxBlk:1
17:09:47: LmacRxBlk:1
17:09:48: LmacRxBlk:1
LmacRxBlk:1
17:09:50: LmacRxBlk:1
LmacRxBlk:1
17:09:52: LmacRxBlk:1
LmacRxBlk:1
17:09:54: LmacRxBlk:1
LmacRxBlk:1
17:09:56: LmacRxBlk:1
LmacRxBlk:1
17:09:58: LmacRxBlk:1
LmacRxBlk:1
17:10:00: LmacRxBlk:1
LmacRxBlk:1
17:10:02: LmacRxBlk:1
LmacRxBlk:1
17:10:04: LmacRxBlk:1
LmacRxBlk:1
17:10:06: LmacRxBlk:1
LmacRxBlk:1

So LmacRxBlk:1 is something to do with the SDK..
Anyway was clear abuse & proof of how lightning fast the web server runs now,
the sad part is it can not recover, wonder if there is a way to catch it, so it can. ?

Good to hear quite some abuse is needed to get it to break ;)

There is indeed some limit to the number of connections and as far as I know the function to keep track of the timers can be called more often. But it is a pity it is not recovering on its own.
Maybe we should add some software watchdog kind of feature to reboot on such occasions.

I saw some similar issue myself last night, when the template parse function could fill up all memory. That's also non-recoverable, so there are more use cases for such an auto reboot feature.

Hey a 5 minute fix ? Is there a branch ?
Another read: https://github.com/Links2004/arduinoWebSockets/issues/57

No not a fix, it was just a label to state the wifi is fixed. I guess trying to fix overflowing buffers due to abuse is a different issue ;)
This one has already taken way more time than anticipated, so let's consider this one fixed to give me the feeling some progress has been made :)

Can you open a new issue with the links about this buffer overflow + hang?

Yep, no problem ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

s0170071 picture s0170071  ·  3Comments

SANCLA picture SANCLA  ·  4Comments

ghtester picture ghtester  ·  3Comments

jroux1 picture jroux1  ·  6Comments

ronnythomas picture ronnythomas  ·  3Comments