Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
May 31, 2024

Conversation

devgs
Copy link
Contributor

@devgs devgs commented Apr 3, 2024

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.

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
Copy link
Contributor Author

devgs commented Apr 4, 2024

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

@kuba2k2 kuba2k2 added bug Something isn't working BK7231 Beken BK72xx family quality Code quality or safety improvements labels Apr 7, 2024
@kuba2k2 kuba2k2 changed the title Fix for a race condition in WiFi connection loop [beken-72xx] Fix race condition when checking Wi-Fi SSID May 31, 2024
@kuba2k2 kuba2k2 merged commit b255402 into libretiny-eu:master May 31, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BK7231 Beken BK72xx family bug Something isn't working quality Code quality or safety improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants