tbnobody / OpenDTU

Software for ESP32 to talk to Hoymiles/TSUN/Solenso Inverters
GNU General Public License v2.0
1.69k stars 471 forks source link

#618 fix: explicitly disconnect prior connecting to wifi #2117

Open jstammi opened 2 days ago

jstammi commented 2 days ago

See https://github.com/tbnobody/OpenDTU/issues/618#issuecomment-1661855347

It is a very old change in my installation, that I just noticed to have missed to open a pr for. Hopefully I remember the facts correctly.

The problem arises with the ap, being connected to, (temporarily) disappearing *) and requiring usage of a new "association packet" content (here: due to ap having changed the frequency). The client wifi keeps the old one used initially (even across a soft-reset) and fails to connect to that ap then - endlessly. To get it connected again actually power needs to be switched off. Or making the client "forgetting" this spcial packet prior trying to (re-)connect.

*) here, may be of interest, too, as I guess widely unknown: https://avm.de/service/wissensdatenbank/dok/FRITZ-Box-7490/1349_5-GHz-Funknetz-gelegentlich-deaktiviert-Radar-Signal/ Can be seen in the fritzbox events. To get around this, do not use automated frequency setting but fixed one outside radar ones.

tbnobody commented 2 days ago

I don't know how a behavior of the 5GHz WiFi band has impact of the ESP32 which only supports the 2.4GHz band. If I understand the AVM article correctly it only affects the 5GHz band.

jstammi commented 2 days ago

You are correct, this problem was not on the ESP32 but a different client, sry.

The problem wrt the "association packet" remains the same, just the reason for the ap disappearing is a different (e.g. firmware update). Unless this keeeping of the "association packet" was somewhere fixed in the underlaying libs, the fix should still be necessary (and made me entering the attic since having patched much less frequent).

jstammi commented 2 days ago

The testing procedure is somehow easy: