wifi problems, for the hundredth time

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

wifi problems, for the hundredth time

#1 Post by Gregor54321 » 02 Oct 2022, 15:32

Hi.
First I have since some time problems like
- Disconnected! Reason: '(6) Not authed'
- Disconnected! Reason: '(202) Auth fail'
- Disconnected! Reason: '(2) Auth expire'

Then I noticed, there are a lot of packet losses with all kind of builds:
- custom_alt_wifi_ESP8266_4M1M
- custom_ESP8266_4M1M
- normal_ESP8266_4M1M

gregor@BC1710-Tux:~$ ping esp12-hutschiene-2 -i 0.5 -c 600 -f
PING esp12-hutschiene-2.fritz.box (192.168.178.196) 56(84) bytes of data.
..................................................................................................................................................................E......E........................................................E.....................................................................................................................................E............................................................................................................................................E....................................................
--- esp12-hutschiene-2.fritz.box ping statistics ---
600 packets transmitted, 45 received, +1 duplicates, +28 errors, 92.5% packet loss, time 306477ms
rtt min/avg/max/mdev = 5.989/6300.312/21583.845/8451.714 ms, pipe 43, ipg/ewma 511.648/2244.236 ms


But somewhen i noticed, with spec_debug_custom_ESP8266_4M1M everything is fine?!

gregor@BC1710-Tux:~$ ping esp12-hutschiene-2 -i 0.5 -c 600 -f
PING esp12-hutschiene-2.fritz.box (192.168.178.196) 56(84) bytes of data.

--- esp12-hutschiene-2.fritz.box ping statistics ---
600 packets transmitted, 600 received, 0% packet loss, time 300123ms
rtt min/avg/max/mdev = 2.821/10.220/486.216/29.197 ms, ipg/ewma 501.039/5.837 ms

Which is the difference? And how can I make Custom.h to be used in spec_debug*?

BR, Gregor

PS: I used git-commit 884573f6*

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#2 Post by TD-er » 02 Oct 2022, 15:48

Hmm the fact you can even run spec_debug_custom_ESP8266_4M1M is really surprising to me.
That one is only meant to be used by me for running PVS Studio to perform static analysis of the code to find bugs. (I do have a license for PVS Studio)

Any PlatformIO env with "custom" in the name should be using Custom.h if it is present. (mind the capital C)

But back to your WiFi problem.

I am actually looking into these de-auth issues as we speak.
Some reported issue which may not seem related at first (as it is ESP32), may actually be related to what you're seeing here:
https://github.com/espressif/esp-idf/issues/8192
In short, it seems the ESP will upon (re)connect send a deauth request. But this may take some time to be processed by the access point and then the access point may send the acknowledgement for it while the ESP is just in the process of reconnecting.

However, this does seem to be partly related to "modern" access points which do support WiFi mesh.
I myself have Fritzbox stuff here, which do have WiFi mesh configured, but here it doesn't seem to cause any of these issues.
So I wonder if you could test to set the ESP to be using B/G mode only (tools->Advanced page)?
Also what Fritzbox access points are you using (which FW too)?
I myself have 5530 Fiber, 1200AX (2x) and 1750E (3x) repeater units + a Fritz!repeater 3000 in the garden shed. The first two running 7.30 and the others 7.29 firmware.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#3 Post by TD-er » 02 Oct 2022, 16:20

Can you test this PR, I just made with the code changes I was working on?
https://github.com/letscontrolit/ESPEasy/pull/4285

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#4 Post by TD-er » 02 Oct 2022, 17:13

I added a change to the PR, to switch to a different SDK binary blob.
Suggested here: https://github.com/esp8266/Arduino/issu ... -962264546

This does suggest WMM for QoS, which is required for 802.11n.

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#5 Post by Gregor54321 » 02 Oct 2022, 17:18

TD-er wrote: 02 Oct 2022, 15:48 Hmm the fact you can even run spec_debug_custom_ESP8266_4M1M is really surprising to me.
That one is only meant to be used by me for running PVS Studio to perform static analysis of the code to find bugs. (I do have a license for PVS Studio)
Well, I'm with PlatformIO inside VSCode on Linux.
And spec_debug_* does well, but without Custom.h... see attached Pic

This magic Wireshark stuff is beyond my capabilities. ;-)
I just applied Build: ESP_Easy_mega_20211105_custom_ESP8266_4M1M from your webinstaller page. And also there is unstable connection (but mainly no reconnect in this timeframe). I am inclined to claim that these errors in logfile are consequential errors by losing packets? In second attached pic I started to ping the device seconds after reboot. First reconnection occured after the ping period, but a lot of pings have been dropped/lost till then.
TD-er wrote: 02 Oct 2022, 15:48 So I wonder if you could test to set the ESP to be using B/G mode only (tools->Advanced page)?
Also what Fritzbox access points are you using (which FW too)?

forcing the ESP device to B/G did not improve the situation. still >50% packet loss (with above mentioned 20211105 FW).

Here also is a installation of multiple (old) FritzBoxes with same SSID and same PW, but not meshed:
- FB 7490 (Wifi4 802.11n, MIMO 3x3, Ch 20MHz, FW-Vers 7.29 (latest)) (nearest box and strongest signal right now)
- FB 7270v3 (Wifi4 802.11n, MIMO 2x2, Ch 40MHz, FW-Vers 6.06 (latest))
- FB 7390 (Wifi4 802.11n, MIMO 2x2, Ch 20MHz, FW-Vers 6.87 (latest))

Just booted the device beside 7270v3. 35% packet loss in B/G mode...

Is there may a big difference between normal/custom and spec* builds? Maybe different espressif frameworks?
Attachments
ping vs reconnect
ping vs reconnect
2022-10-02_16-11.png (375.54 KiB) Viewed 16051 times
building without Custom.h
building without Custom.h
2022-10-02_15-58.png (49.45 KiB) Viewed 16051 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#6 Post by TD-er » 02 Oct 2022, 17:30

Can you do some more tests with the last commit I pushed to that PR? https://github.com/letscontrolit/ESPEasy/pull/4285

The Github Actions build for it is almost done: https://github.com/letscontrolit/ESPEas ... 3169070595

This last change does show this in the Fritzbox details section of the connected device:
Quality of Service (QoS)WMM

Older builds do show an empty field here.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#7 Post by TD-er » 02 Oct 2022, 17:33

Is there may a big difference between normal/custom and spec* builds? Maybe different espressif frameworks?
Nope, the main difference is "debug mode" vs. "release mode"
In other words, the "spec*" builds will probably slightly larger and maybe a bit slower too.

And that's what makes it so frustrating.
This means there is some awefully small timing window which makes the difference between working stable and not stable.
I've seen builds work perfectly fine and changing just some text in a log entry or on the web page may render the next build unstable.
This only has been bugging me for about 4 years now.... :(

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#8 Post by Gregor54321 » 02 Oct 2022, 18:47

TD-er wrote: 02 Oct 2022, 17:30 Can you do some more tests with the last commit I pushed to that PR? https://github.com/letscontrolit/ESPEasy/pull/4285

The Github Actions build for it is almost done: https://github.com/letscontrolit/ESPEas ... 3169070595

This last change does show this in the Fritzbox details section of the connected device:
Quality of Service (QoS)WMM

Older builds do show an empty field here.
I could not find the bugfix branch (may because I lack write permission)? Anyway, I finally succeded to upload the .bin from your build. Unfortunately still massive (90%) packet loss.

4Mbit link maybe because of B/G?
Attachments
2022-10-02_18-45.png
2022-10-02_18-45.png (27.14 KiB) Viewed 16045 times

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: wifi problems, for the hundredth time

#9 Post by Ath » 02 Oct 2022, 19:03

Can you share a photo of the ESP board, especially the antenna area? As this sounds like either a weak/poor antenna mount, or the ESP interfering with the WiFi signal (even though the signal strength seems ok)
/Ton (PayPal.me)

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#10 Post by Gregor54321 » 02 Oct 2022, 19:12

Ah... WMM found...
Attachments
2022-10-02_19-11.png
2022-10-02_19-11.png (181.02 KiB) Viewed 16040 times

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#11 Post by Gregor54321 » 02 Oct 2022, 19:24

Ath wrote: 02 Oct 2022, 19:03 Can you share a photo of the ESP board, especially the antenna area? As this sounds like either a weak/poor antenna mount, or the ESP interfering with the WiFi signal (even though the signal strength seems ok)
The device is standardised. And with different firmware packet loss less.
Attachments
IMG_20221002_192321.jpg
IMG_20221002_192321.jpg (1.5 MiB) Viewed 16036 times

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: wifi problems, for the hundredth time

#12 Post by Ath » 02 Oct 2022, 19:29

Ah, the infamous Sonoff Basic, with the notoriously (or should I say dramatically?) poor WiFi performance, mostly caused by the low-end power-supply for the ESP :(
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#13 Post by TD-er » 02 Oct 2022, 19:34

Which build did work?
And if it is a different firmware, which SDK was it using? (or build date if known)

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#14 Post by Gregor54321 » 02 Oct 2022, 19:45

Ath wrote: 02 Oct 2022, 19:29 Ah, the infamous Sonoff Basic, with the notoriously (or should I say dramatically?) poor WiFi performance, mostly caused by the low-end power-supply for the ESP :(
is powered by USB ;-)

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: wifi problems, for the hundredth time

#15 Post by Ath » 02 Oct 2022, 19:46

Gregor54321 wrote: 02 Oct 2022, 19:45 is powered by USB ;-)
That can be even worse...
/Ton (PayPal.me)

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#16 Post by Gregor54321 » 02 Oct 2022, 19:48

TD-er wrote: 02 Oct 2022, 19:34 Which build did work?
And if it is a different firmware, which SDK was it using? (or build date if known)
A build where I did not take notice of that problems was 20104-Mega (selfbuild 2019.11.29) No more infos available, it is reflashed now...

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#17 Post by TD-er » 02 Oct 2022, 19:57

Sounds like a SDK2.4.x build.
I know Thomas also had some issues with these Sonoff Basic units.

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#18 Post by Gregor54321 » 03 Oct 2022, 00:28

TD-er wrote: 02 Oct 2022, 19:57 I know Thomas also had some issues with these Sonoff Basic units.
Extremely fascinating: I own some Sonoff S26 WallPlugs. I applied a current build onto one of them: 1200pings in 10min without loss.
I put the same image.bin onto the SonoffBasic and have 90% packet loss. As it seems, it indeed may be hardware related...
But where to look? Supply stability? Timing/Quartz?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#19 Post by TD-er » 03 Oct 2022, 08:31

Power stability: Yep, but that's only partly the problem

I think the Sonoff Basic units also have some badly tuned antennas.
I do have a board here which works perfectly fine on really old builds, but on recent builds you hardly get any connection, or a very very unstable one.
The PCB antenna feels warm to the touch.
But when I press my finger on it really hard, the WiFi is perfectly stable.

To me this is an indication the antenna tuning algorithm in the closed source binary blob of the Espressif WiFi code (closed source part) has changed.
I got the impression the antenna on the Sonoff Basic units (at least some revisions) need to be tuned outside the parameters allowed by this algorithm..

WiFi on the ESP chips need stable voltage when turned on as it performs some calibrations which are correlated to the actual 3V3 voltage.
When these calibrations are off, you get a really awfull WiFi experience.

You could try to reduce the TX power a bit (tools->Advanced page) and see if that makes a difference.

I also did suspect poor crystal stability could be a factor here, so that's why I added a time wander indicator (in msec/sec, but I guess I should multiply it with 1000 and change that into ppm, which makes more sense)
This should be less than 10 ppm (less than 0.010 msec/sec) according to the Espressif datasheet.
It is only updated after a NTP call, which may take upto 6 hours.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#20 Post by TD-er » 06 Oct 2022, 23:13

Gregor54321 wrote: 03 Oct 2022, 00:28
TD-er wrote: 02 Oct 2022, 19:57 I know Thomas also had some issues with these Sonoff Basic units.
Extremely fascinating: I own some Sonoff S26 WallPlugs. I applied a current build onto one of them: 1200pings in 10min without loss.
I put the same image.bin onto the SonoffBasic and have 90% packet loss. As it seems, it indeed may be hardware related...
But where to look? Supply stability? Timing/Quartz?
Could you please also test this GH Actions test build as soon as it is finished?
https://github.com/letscontrolit/ESPEas ... 3200480365

Perhaps this build may run stable on your Sonoff Basic node.
I did add some delays in starting the WiFi which may give the Sonoff Basic power supply slightly more time to get stable.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: wifi problems, for the hundredth time

#21 Post by ThomasB » 07 Oct 2022, 03:51

I know Thomas also had some issues with these Sonoff Basic units.
Sonoff Basic R2 V1.0 (2017) is the spawn of Satan. All flavors of ESPEasy Mega are not compatible/reliable with it. Many theories have been discussed, but so far it's all been guesswork. And nothing has solved the problem.

TL;DR: Don't use a Sonoff Basic R2 V1.0 with ESPEasy Mega.

- Thomas

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#22 Post by TD-er » 07 Oct 2022, 08:15

Just curious, did you ever attempt to replace the flash chip on one of those?

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: wifi problems, for the hundredth time

#23 Post by ThomasB » 07 Oct 2022, 15:32

Just curious, did you ever attempt to replace the flash chip on one of those?
Yes, it was upgraded to 4MB. I've done that to most of my Sonoff's since I like OTA flash upgrades.

- Thomas

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#24 Post by TD-er » 07 Oct 2022, 15:55

And still behaving badly...
Well maybe if you start replacing every other component... ;)

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: wifi problems, for the hundredth time

#25 Post by ThomasB » 08 Oct 2022, 16:17

I've heard that Tasmota does not experience problems with the Sonoff Basic R2 V1.0. They seem to know the hidden secretes to success.

- Thomas

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#26 Post by TD-er » 08 Oct 2022, 18:36

I've been told that you need to be "as slow as possible" on the WiFi which suggests the voltage may dip a lot when using WiFi.

The PR I linked does start the WiFi later after boot.
Maybe we could also set the WiFi power to a lower TX power when starting.

The default TX pwr is:
802.11n => 14 dBm = 0.025Watt
802.11g => 17.5 dBm = 0.056 Watt
802.11b => 20.5 dBm = 0.112 Watt

I could set it to 0 dBm, which equals to: 0.001 Watt.
However, the TX power setting seems to be ignored when performing the RF calibration.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: wifi problems, for the hundredth time

#27 Post by ThomasB » 08 Oct 2022, 18:48

The old (pre Mega) ESPEasy versions worked fine with the Sonoff Basic R2 V1.0. And early Mega's worked too. My memory is fuzzy, but I think the problems began sometime in Spring 2020. Perhaps due to a change in the ESP8266 core library.

I'd suspect the issue was caused by changes to the ESP's WiFi Calibration functions. But if that was the case then Tasmota would suffer too. So it could be something else.

The latest Sonoff Basic module works fine with Mega releases. But it has a ESP8285. Its fixed 1MB flash is a deal killer for me.

- Tom

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#28 Post by TD-er » 08 Oct 2022, 18:54

Tasmota stayed on SDK 2.3.x for a long time.
Not sure if they still can compile Tasmota for this old SDK but if they do, then I guess maybe they still use this for these modules?

N.B. there are ESP8285 units with > 1M inside.
I have never seen them other than being mentioned in the Espressif documents.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#29 Post by TD-er » 08 Oct 2022, 18:59

By the way, the old SDK also was capable to tune WiFi antennas more than newer SDK versions.
So it is possible this Sonoff simply has a really badly tuned antenna. (maybe wrong components or incorrect impedance?)

If it is a problem with the SWR or impedance, then lower TX power may help a bit as I know that ESPs may crash when too much antenna power is reflected into the ESP.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: wifi problems, for the hundredth time

#30 Post by ThomasB » 08 Oct 2022, 19:17

I would like help test any ideas you might have to fix this. But as mentioned, my lab is in boxes. So hopefully other affected users will be able to test.

- Thomas

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#31 Post by Gregor54321 » 17 Oct 2022, 21:21

Sorry I haven't read along here for a while. I'm very busy at work at the moment...
I have a smaller measurement park to do extensive measurements during runtime. Which parameters should be determined under which circumstances?
I have already changed the flash chip for a 4MB version too. And it seems, timing is really very bad. (maybe around 40.000ppm? NTP says... but how reliable this is?) Is there way for output fractions of HW-Clock to GPIO (e.g. f/32768 (15bit) or f/1024 (10bit)) with accuracy of hardware divider? (I have coded 10 years ago with ASM/C++ for Atmel for fun, no clue about ESPs hardware)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#32 Post by TD-er » 17 Oct 2022, 22:05

The time wander is not in ppm (maybe I should make it so, as that's way more intuitive) but it is in msec/sec, which differs essentially a factor 1000.
So 0.001 msec/sec is 1 ppm.

The Espressif datasheet does mention something in the order of 10 ppm (but I also found other sources which mention a different value) as allowed deviation.

I compute the time wander when calling an update via NTP.
in slightly recent builds (+/- the last year I guess) this NTP interval is somewhere around 6 hours (+/- a random offset upto about an hour)
So this is long enough to be able to measure an error which cannot be attributed to only the network delay to/from the NTP server.

The ESP8266 is probably not able to output fractions of the HW clock with great accuracy. At least not with WiFi active and other interrupt code running.
On the current code (merged yesterday) you may use the longpulse_ms command to set a recurring pulse.
Each pulse will have some jitter of course, but over the long run you should be able to see pulses with near 0 jitter. So if the jitter averaged over some nr of samples drifts, you know the clock is also drifting.
For this I use the waveform function.
It may have been disabled on 1M OTA builds, but it should be present on other ESP8266 builds.

For example longpulse_ms,<GPIOnr>,1,<time high>,<time low,-1

The "1" and "-1" mean "state high", thus not inverted and "-1" as last parameter means continuous repeat.
time in msec, which is internally converted to clockpulses (80 MHz)

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#33 Post by Gregor54321 » 17 Oct 2022, 22:39

Could you please also test this GH Actions test build as soon as it is finished?
https://github.com/letscontrolit/ESPEas ... 3200480365

Perhaps this build may run stable on your Sonoff Basic node.
I did add some delays in starting the WiFi which may give the Sonoff Basic power supply slightly more time to get stable.
I'm just trying to run that build. (after erasing flash) It seems, it doesn't offer wifi AP...

Code: Select all

�U173 : Info   : WIFI : Set WiFi to AP+STA
2769 : Info   : WIFI : Set WiFi to AP+STA
5063 : Info   : WIFI : Set WiFi to OFF
5276 : Info   : WIFI : Set WiFi to OFF
5493 : Info   : 

INIT : Booting version: ESP_Easy_mega_20221006_custom_ESP8266_4M1M, (GitHub Actions) HEAD_a81d6ed (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(c0eb301), LWIP: 2.1.2 PUYA support)
5494 : Info   : INIT : Free RAM:26392
5495 : Info   : INIT : Cold Boot - Restart Reason: Power On
5497 : Info   : FS   : Mounting...
29557 : Info   : FS   : Mount successful, used 0 bytes of 957314
RESET: Resetting factory defaults... using default settings
RESET: Warm boot, reset count: 0
RESET: formatting...
RESET: formatting done...
54717 : Info   : SaveToFile: free stack: 3504
54792 : Info   : FILE : Saved provisioning.dat offset: 0 size: 256
54793 : Info   : SaveToFile: free stack after: 3504
56400 : Info   : SaveToFile: free stack: 3568
56452 : Info   : FILE : Saved config.dat offset: 28672 size: 820
56453 : Info   : SaveToFile: free stack after: 3568
56453 : Info   : SaveToFile: free stack: 3616
56514 : Info   : FILE : Saved config.dat offset: 0 size: 1300
56515 : Info   : SaveToFile: free stack after: 3616
56516 : Info   : SaveToFile: free stack: 3456
56544 : Info   : FILE : Saved security.dat offset: 0 size: 593
56545 : Info   : SaveToFile: free stack after: 3456
56547 : Info   : SaveToFile: free stack: 3216
56555 : Info   : FILE : Saved security.dat offset: 1024 size: 6
56556 : Info   : SaveToFile: free stack after: 3216
56579 : Info   : CRC  : ProvisioningSettings CRC   ...OK 
RESET: Successful, rebooting. (you might need to press the reset button if you've just flashed the firmware)
57581 : Info   : WiFi : WifiDisconnect()
57682 : Info   : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 57 s
57682 : Info   : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED

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

load 0x4010f000, len 3584, room 16 
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld
   �U332 : Info   : WIFI : Set WiFi to AP+STA
2928 : Info   : WIFI : Set WiFi to AP+STA
5223 : Info   : WIFI : Set WiFi to OFF
5436 : Info   : WIFI : Set WiFi to OFF
5652 : Info   : 

INIT : Booting version: ESP_Easy_mega_20221006_custom_ESP8266_4M1M, (GitHub Actions) HEAD_a81d6ed (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(c0eb301), LWIP: 2.1.2 PUYA support)
5654 : Info   : INIT : Free RAM:26328
5655 : Info   : INIT : Soft Reboot #1 Last Action before Reboot: Intended Reboot: ResetFactory Last systime: 57 - Restart Reason: Software/System restart
5656 : Info   : FS   : Mounting...
5679 : Info   : FS   : Mount successful, used 72037 bytes of 957314
5695 : Info   : CRC  : SecuritySettings CRC   ...OK 
5719 : Info   : CRC  : ProvisioningSettings CRC   ...OK 
5721 : Info   : INIT : I2C
5722 : Info   : INIT : SPI not enabled
5724 : Info   : Time set to 57.000 Time adjusted by 51277.00 msec. Wander: 0.000 msec/second Source: RTC at boot
5725 : Info   : Current Time Zone: STD time start: 1970-10-25 03:00:00 offset: 0 min
5727 : Info   : Local time: 1970-01-01 00:00:57
5831 : Info   : WIFI : Set WiFi to STA
5934 : Info   : WiFi : Start network scan all channels
8124 : Info   : WiFi : Scan finished, found: 6
8127 : Info   : WiFi : Start network scan all channels
10316 : Info   : WiFi : Scan finished, found: 7
10329 : Info   : INIT : Free RAM:26552
10344 : Info   : INFO : Plugins: 19  (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(c0eb301), LWIP: 2.1.2 PUYA support)
10347 : Info   : Webserver: start
11685 : Info   : WD   : Uptime 0 ConnectFailures 0 FreeMem 21936 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
41685 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 21936 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
71694 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 21936 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
101686 : Info   : WD   : Uptime 2 ConnectFailures 0 FreeMem 21936 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
131694 : Info   : WD   : Uptime 2 ConnectFailures 0 FreeMem 21936 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
161693 : Info   : WD   : Uptime 3 ConnectFailures 0 FreeMem 21936 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
191686 : Info   : WD   : Uptime 3 ConnectFailures 0 FreeMem 21936 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
221691 : Info   : WD   : Uptime 4 ConnectFailures 0 FreeMem 21936 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
251691 : Info   : WD   : Uptime 4 ConnectFailures 0 FreeMem 21936 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
281685 : Info   : WD   : Uptime 5 ConnectFailures 0 FreeMem 21936 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
311689 : Info   : WD   : Uptime 5 ConnectFailures 0 FreeMem 21936 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
341685 : Info   : WD   : Uptime 6 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
371685 : Info   : WD   : Uptime 6 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
401685 : Info   : WD   : Uptime 7 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
431685 : Info   : WD   : Uptime 7 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
461686 : Info   : WD   : Uptime 8 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
491690 : Info   : WD   : Uptime 8 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
521690 : Info   : WD   : Uptime 9 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
551685 : Info   : WD   : Uptime 9 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
581686 : Info   : WD   : Uptime 10 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
611692 : Info   : WD   : Uptime 10 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
>reboot
640000 : Info   : WiFi : WifiDisconnect()
640101 : Info   : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 10 m 40 s
640101 : Info   : WIFI : Arduino wifi status: WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
640202 : Info   : Reset WiFi.
640303 : Info   : WIFI : Set WiFi to STA
640405 : Info   : WiFi : Start network scan all channels
642594 : Info   : WiFi : Scan finished, found: 6
642595 : Info   : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 10 m 40 s
642596 : Info   : WIFI : Arduino wifi status: WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
642597 : Info   : WIFI : Set WiFi to OFF
642810 : Info   : WIFI : Disco
 ets Jan  8 2013,rst cause:1, boot mode:(3,7)

load 0x4010f000, len 3584, room 16 
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld
   �U329 : Info   : WIFI : Set WiFi to AP+STA
2924 : Info   : WIFI : Set WiFi to AP+STA
5219 : Info   : WIFI : Set WiFi to OFF
5432 : Info   : WIFI : Set WiFi to OFF
5649 : Info   : 

INIT : Booting version: ESP_Easy_mega_20221006_custom_ESP8266_4M1M, (GitHub Actions) HEAD_a81d6ed (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(c0eb301), LWIP: 2.1.2 PUYA support)
5650 : Info   : INIT : Free RAM:26456
5652 : Info   : INIT : Soft Reboot #2 Last Action before Reboot: Intended Reboot: CommandReboot Last systime: 694 - Restart Reason: Software/System restart
5653 : Info   : FS   : Mounting...
5676 : Info   : FS   : Mount successful, used 72037 bytes of 957314
5692 : Info   : CRC  : SecuritySettings CRC   ...OK 
5715 : Info   : CRC  : ProvisioningSettings CRC   ...OK 
5717 : Info   : INIT : I2C
5718 : Info   : INIT : SPI not enabled
5720 : Info   : Time set to 694.000 Time adjusted by 688280.00 msec. Wander: 0.000 msec/second Source: RTC at boot
5722 : Info   : Current Time Zone: STD time start: 1970-10-25 03:00:00 offset: 0 min
5724 : Info   : Local time: 1970-01-01 00:11:34
5828 : Info   : WIFI : Set WiFi to STA
5931 : Info   : WiFi : Start network scan all channels
8120 : Info   : WiFi : Scan finished, found: 5
8123 : Info   : WiFi : Start network scan all channels
10312 : Info   : WiFi : Scan finished, found: 5
10324 : Info   : INIT : Free RAM:26680
10340 : Info   : INFO : Plugins: 19  (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(c0eb301), LWIP: 2.1.2 PUYA support)
10343 : Info   : Webserver: start
11681 : Info   : WD   : Uptime 0 ConnectFailures 0 FreeMem 22064 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
41684 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 22064 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
71682 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 22064 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
101689 : Info   : WD   : Uptime 2 ConnectFailures 0 FreeMem 22064 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
131682 : Info   : WD   : Uptime 2 ConnectFailures 0 FreeMem 22064 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
161682 : Info   : WD   : Uptime 3 ConnectFailures 0 FreeMem 22064 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
191688 : Info   : WD   : Uptime 3 ConnectFailures 0 FreeMem 22064 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
221691 : Info   : WD   : Uptime 4 ConnectFailures 0 FreeMem 22064 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
251687 : Info   : WD   : Uptime 4 ConnectFailures 0 FreeMem 22064 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
281683 : Info   : WD   : Uptime 5 ConnectFailures 0 FreeMem 22064 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
311682 : Info   : WD   : Uptime 5 ConnectFailures 0 FreeMem 22064 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
341682 : Info   : WD   : Uptime 6 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
371682 : Info   : WD   : Uptime 6 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
401682 : Info   : WD   : Uptime 7 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
431688 : Info   : WD   : Uptime 7 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
461690 : Info   : WD   : Uptime 8 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
491689 : Info   : WD   : Uptime 8 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
521688 : Info   : WD   : Uptime 9 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
551683 : Info   : WD   : Uptime 9 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
581689 : Info   : WD   : Uptime 10 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
611683 : Info   : WD   : Uptime 10 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
641685 : Info   : WD   : Uptime 11 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
671684 : Info   : WD   : Uptime 11 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
701688 : Info   : WD   : Uptime 12 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
731683 : Info   : WD   : Uptime 12 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
761683 : Info   : WD   : Uptime 13 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
791683 : Info   : WD   : Uptime 13 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
821684 : Info   : WD   : Uptime 14 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
851682 : Info   : WD   : Uptime 14 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
881691 : Info   : WD   : Uptime 15 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
911691 : Info   : WD   : Uptime 15 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
941683 : Info   : WD   : Uptime 16 ConnectFailures 0 FreeMem 22384 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#34 Post by TD-er » 17 Oct 2022, 22:42

Made some more improvements since that build.
Can you try this test build: https://github.com/letscontrolit/ESPEas ... 3265472808

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#35 Post by Gregor54321 » 17 Oct 2022, 23:29

Just flashed a custom image with wifi infos from recent commit d34770a*. Within the first around 120sec ping loss is acceptable with 10-20% but then suddenly loss is sharply rising to >99%.
Will provide log tomorrow. Maybe there are already some infos about the drift in there.
Will have a look into your provided GHActions build tomorrow evening. (Is this from different branch than origin/HEAD or origin/mega ?)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#36 Post by TD-er » 17 Oct 2022, 23:51

Yep, those are from the related pull request where I try to fix some of the WiFi connect issues.
https://github.com/letscontrolit/ESPEasy/pull/4285

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#37 Post by Gregor54321 » 18 Oct 2022, 07:14

Seems not to be as bad as afraid...
This small deviation should have no effect at all for such short transmissions.

Code: Select all

4218 : Info   : NTP  : NTP replied: delay 30 mSec Accuracy increased by 0.389 seconds
4220 : Info   : Time set to 1666040855.389
4221 : Info   : Current Time Zone: STD time start: 2022-10-30 03:00:00 offset: 120 min
4224 : Info   : Local time: 2022-10-17 23:07:35

4036056 : Info   : NTP  : NTP replied: delay 20 mSec Accuracy increased by 0.152 seconds
4036058 : Info   : Time set to 1666044887.152 Time adjusted by -74.94 msec. Wander: -0.019 msec/second Source: NTP
4036061 : Info   : Local time: 2022-10-18 00:14:47

25027861 : Info   : NTP  : NTP replied: delay 11 mSec Accuracy increased by 0.612 seconds
25027864 : Info   : Time set to 1666065878.612 Time adjusted by -344.96 msec. Wander: -0.016 msec/second Source: NTP
25027867 : Info   : Local time: 2022-10-18 06:04:38
There are moments when a whole bunch of pings run over it without interruption.
Attachment: <ping.log> https://boek.k.vu/owncloud/s/frGDfnaS9BCEcwt
There are pings between 2,29ms and 24998ms (110 of 4415 reflected pings are >1s; 3717 are <100ms) Total loss is 83%.

Serial logs says for disconnect reason:"(6) Not authed" or "(202) Auth fail".

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#38 Post by Gregor54321 » 18 Oct 2022, 08:09

TD-er wrote: 17 Oct 2022, 22:42 Can you try this test build: https://github.com/letscontrolit/ESPEas ... 3265472808
Awsome! Right Track!
0% Loss starting 22mins after reboot (initially same poor performance as before). Will try to find the parameter for that difference...

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: wifi problems, for the hundredth time

#39 Post by Ath » 18 Oct 2022, 08:42

In another thread (over here) the suggestion to set the max TX power to 12 dBm improved WiFi stability a lot, by avoiding the ESP interfering itself with a too strong WiFi signal reflecting back into the device.
Seems reasonable to try that here as well?
/Ton (PayPal.me)

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#40 Post by Gregor54321 » 18 Oct 2022, 09:35

Now it becomes strange:
New reboot. Ping statistics for monitoring progress over time...
A lot of ping loss until 22min after reboot, then 0% loss...
No special entries / abnormalities in serial log! (no change of AP, simply nothing!)

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#41 Post by Gregor54321 » 18 Oct 2022, 10:01

Next try: stable after 6min...
WebUI/advanced says: "Current max: 14.00 dBm"

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#42 Post by TD-er » 18 Oct 2022, 11:37

The "current max" is related to what can be used based on the active connection (802.11n) and the set max. TX power.
If you set the max. TX power to something like 10, the reported max should be 10 also as all modes (802.11b, 802.11g and 802.11n) allow a higher maximum.

Do you have "eco mode" enabled?
Was there an AP active on the ESP?

N.B. sometimes (no idea why) a power cycle does actually help on bad WiFi connections after flashing.

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#43 Post by Gregor54321 » 18 Oct 2022, 13:32

Do you have "eco mode" enabled?
it's not enabled
Was there an AP active on the ESP?
unfortunatelly no

But it was able to use the saved wifi credentials from former flash. After erasing flash and reflashing your image, no AP comes up (Wifiscanner does not detect any new wifi), as it seems to be replicable by serial log output:

Code: Select all

load 0x4010f000, len 3584, room 16 
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld
   �U334 : Info   : WIFI : Set WiFi to AP+STA
2929 : Info   : WIFI : Set WiFi to AP+STA
5223 : Info   : WIFI : Set WiFi to OFF
5436 : Info   : WIFI : Set WiFi to OFF
5652 : Info   : 

INIT : Booting version: ESP_Easy_mega_20221006_normal_ESP8266_4M1M, (GitHub Actions) HEAD_a81d6ed (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(c0eb301), LWIP: 2.1.2 PUYA support)
5654 : Info   : INIT : Free RAM:26112
5655 : Info   : INIT : Soft Reboot #1 Last Action before Reboot: Intended Reboot: ResetFactory Last systime: 58 - Restart Reason: Software/System restart
5657 : Info   : FS   : Mounting...
5680 : Info   : FS   : Mount successful, used 75802 bytes of 957314
5696 : Info   : CRC  : SecuritySettings CRC   ...OK 
5699 : Info   : INIT : I2C
5700 : Info   : INIT : SPI not enabled
5702 : Info   : Time set to 58.000 Time adjusted by 52299.00 msec. Wander: 0.000 msec/second Source: RTC at boot
5703 : Info   : Current Time Zone: STD time start: 1970-10-25 03:00:00 offset: 0 min
5705 : Info   : Local time: 1970-01-01 00:00:58
5809 : Info   : WIFI : Set WiFi to STA
5912 : Info   : WiFi : Start network scan all channels
8102 : Info   : WiFi : Scan finished, found: 5
8105 : Info   : WiFi : Start network scan all channels
10293 : Info   : WiFi : Scan finished, found: 4
10306 : Info   : INIT : Free RAM:26352
10376 : Info   : INFO : Plugins: 47 [Normal] (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(c0eb301), LWIP: 2.1.2 PUYA support)
10379 : Info   : Webserver: start
11726 : Info   : WD   : Uptime 0 ConnectFailures 0 FreeMem 21056 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
41716 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 21056 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
71725 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 21056 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
101718 : Info   : WD   : Uptime 2 ConnectFailures 0 FreeMem 21056 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
131718 : Info   : WD   : Uptime 2 ConnectFailures 0 FreeMem 21056 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
161719 : Info   : WD   : Uptime 3 ConnectFailures 0 FreeMem 21056 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
191721 : Info   : WD   : Uptime 3 ConnectFailures 0 FreeMem 21056 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
221720 : Info   : WD   : Uptime 4 ConnectFailures 0 FreeMem 21056 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#44 Post by TD-er » 18 Oct 2022, 13:50

Hmm, that's odd.
I should also log the git branch and build time, so we're 100% sure the intended build is booting.

Since it is setting the time from the RTC memory, it seems like it may have something remembered.
It doesn't mention in the logs there are no WiFi credentials, which is also very strange.

Can you first try to force a wifi disconnect using the command: wifidisconnect
See if this may trigger it to start an AP.

You can add your credentials manually via the serial port:

Code: Select all

wifissid2,MySSID
wifikey2,MyVerySecretPassword
save
Remember you cannot correct typo mistakes in the console, so maybe best to copy/paste these per line.

N.B. I did use the "2" in my example, so it will be stored as 2nd entry.
When connected, can you check what was the 1st, if any?

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: wifi problems, for the hundredth time

#45 Post by Gregor54321 » 18 Oct 2022, 17:36

Code: Select all

wifidisconnect
does it!

Code: Select all

INIT : Booting version: ESP_Easy_mega_20221006_normal_ESP8266_4M1M, (GitHub Actions) HEAD_a81d6ed (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(c0eb301), LWIP: 2.1.2 PUYA support)
5496 : Info   : INIT : Free RAM:25984
5498 : Info   : INIT : Cold Boot - Restart Reason: Power On
5499 : Info   : FS   : Mounting...
5522 : Info   : FS   : Mount successful, used 75802 bytes of 957314
5538 : Info   : CRC  : SecuritySettings CRC   ...OK 
5541 : Info   : INIT : I2C
5542 : Info   : INIT : SPI not enabled
5645 : Info   : WIFI : Set WiFi to STA
5748 : Info   : WiFi : Start network scan all channels
7937 : Info   : WiFi : Scan finished, found: 5
7939 : Info   : WiFi : Start network scan all channels
10128 : Info   : WiFi : Scan finished, found: 5
10132 : Info   : INIT : Free RAM:26288
10202 : Info   : INFO : Plugins: 47 [Normal] (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(c0eb301), LWIP: 2.1.2 PUYA support)
10205 : Info   : Webserver: start
11541 : Info   : WD   : Uptime 0 ConnectFailures 0 FreeMem 20992 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
>wifidisconnect
34302 : Info   : WiFi : WifiDisconnect()
34403 : Info   : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 34 s
34404 : Info   : WIFI : Arduino wifi status: WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
34504 : Info   : Reset WiFi.
34506 : Info   : WiFi : Start network scan all channels
36695 : Info   : WiFi : Scan finished, found: 5
36697 : Info   : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 34 s
36698 : Info   : WIFI : Arduino wifi status: WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
36698 : Info   : WIFI : Set WiFi to OFF

OK
37014 : Info   : WIFI : Set WiFi to STA
37116 : Error  : WIFI : No valid wifi settings
37117 : Info   : WiFi : Start network scan all channels
39305 : Info   : WiFi : Scan finished, found: 5
39407 : Info   : WIFI : Set WiFi to AP+STA
40396 : Info   : WIFI : AP Mode ssid will be ESP-Easy with address 192.168.4.1
40397 : Info   : WiFi : Start network scan all channels
42586 : Info   : WiFi : Scan finished, found: 5
42588 : Info   : WIFI : Arduino wifi status: WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
42664 : Info   : WD   : Uptime 1 ConnectFailures 0 FreeMem 18592 WiFiStatus WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
I should also log the git branch and build time, so we're 100% sure the intended build is booting.
I am using yoru GHActions build!
I was also looking for that for my custom build also but failed till now. What is to add to BUILD_GIT? "__GIT_HEAD__"? Would like to know the relevant variables for BRANCH and GIT_COMMIT_SHORT?

It seems to be ultimately stable at this hardware now! No ping looses anymore since DHCP IP assignment (around 25secs after poweron with your image). Would be glad to merge this into my custom image! THANKS A LOT! For your investigations and ideas to solve that issue!

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wifi problems, for the hundredth time

#46 Post by TD-er » 18 Oct 2022, 20:55

You can see on the sysinfo page what is actually stored in the build.
I use some Python scripts in the build process to generate some strings which I embed in the binary as strings so I can access it in the C++ code.

I will try to look into why it doesn't seem to start the AP until you give it a wifidisconnect call.
With that fixed, I guess we might be up for some stability improvements regarding WiFi.
Or at least it will be predictable what the WiFi will do... finally.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: wifi problems, for the hundredth time

#47 Post by ThomasB » 19 Oct 2022, 18:07

Does this mean that the latest ESPEasy Mega release reliably runs on a Sonoff Basic R2 Hardware Rev 1?

If so, are there special builds for it, or will all builds be fixed?

And exactly what was the final magic fix that gave success?

- Thomas

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: wifi problems, for the hundredth time

#48 Post by Ath » 19 Oct 2022, 20:44

I think the main take-aways here are that limiting the max. TX-power to 10-12 dBm and the delayed WiFi start introduced in PR #4285 seem to improve the WiFi behavior on 'WiFi-critical' units, but I'm not sure it's been tested on that Sonoff Basic R2 rev. 1 yet.
/Ton (PayPal.me)

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: wifi problems, for the hundredth time

#49 Post by ThomasB » 19 Oct 2022, 20:56

If there's a strong chance the latest changes have solved the Sonoff Basic R2 V1 compatibility issue then I'll volunteer to try it out. My test device is packed and stored (moving to new house), but I'm willing to hunt it down for the sake of science.

What bin name should I use if I want a [testing] build?

- Thomas

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: wifi problems, for the hundredth time

#50 Post by Ath » 19 Oct 2022, 21:13

ThomasB wrote: 19 Oct 2022, 20:56 What bin name should I use if I want a [testing] build?
As I seem to remember you've replaced the 1MB Flash by 4MB, you can run any of the 4M1M or 4M2M (depending on what you installed before) ESP8266 builds, downloaded from that PR, and perform an OTA update. There currently is no special, WiFi enhanced, build configuration.
The number of connectable sensors on that unit is minimal (for electrical vs. health safety), so I'd advise to use a Normal build, as that includes most debugging messages, where the Collection (formerly Test) builds have most debug messages removed so gain some valuable bin space.
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests