libretiny-eu / libretiny

PlatformIO development platform for IoT modules
http://docs.libretiny.eu/
MIT License
415 stars 62 forks source link

[beken-72xx] Fix race condition when checking Wi-Fi SSID #274

Closed devgs closed 5 months ago

devgs commented 7 months ago

There seems to be the race between the event RW_EVT_STA_CONNECTED and an actual valid SSID value returned by BDK. If even a small delay is injected immediately after the event reception the valid value becomes available. Without this fix, due to a polling nature of ESPHome WiFiComponent::check_connecting_finished function may observe the WiFiSTAConnectStatus::CONNECTED status but with an empty SSID value, leading to Incomplete connection. warning and immediate attempt to start another connection, while the current one was actually established.

devgs commented 7 months ago

Sorry, my bad. Wasn't aware about clang-format.