On wifi set_config only update sta and ap config when something changes#5849
Open
mlandauer wants to merge 2 commits into
Open
On wifi set_config only update sta and ap config when something changes#5849mlandauer wants to merge 2 commits into
mlandauer wants to merge 2 commits into
Conversation
This avoids needless connection interruptions, Most useful in combined AP/Station mode when setting the config of the station and you don't want to interrupt the AP connection.
Contributor
|
This generally makes sense I guess. The effective values from kconfig should be available as constants prefixed by
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Submission Checklist 📝
cargo xtask fmt-packagescommand to ensure that all changed code is formatted correctly.skip-changelogormanual-changeloglabel as appropriate.Extra:
Pull Request Details 📖
Description
This avoids needless connection interruptions when calling
WifiController::set_config. Most useful in combined AP/Station mode when setting the config of the station and you don't want to interrupt the AP connection.A common solution for provisioning a device is you start the wifi in a combined access point (AP) and station mode. This way the user can connect to the AP, access a web server running on the device, choose a wifi network and the device then uses the station to try connecting to that network.
Currently, when you're running in a combined AP/station mode and you update the station part of the config under the hood it will update the AP config as well even though nothing has changed there. This causes a connection interruption on the AP side which isn't always necessary.
The solution is simply to update the AP and station parts of the config separately (as they currently are) but only apply a change if it the configuration is different than the current state.
This PR depends on a currently open PR in esp-wifi-sys. If that change isn't okay I'm obviously happy to reimplement this PR so that it doesn't depend on
PartialEqbeing added to a few structs though it would obviously make it a little bit more long-winded! :-)Since this is my first PR on this project I have undoubtedly done a number of things wrong.
Things I'm most likely to have done wrong:
TOTAL_HW_ENCRYPT_KEYSandAP_MAX_CONNECTIONSthat matches my best understanding from the docs and from testing on an esp32 how the max connection for the AP and ESP-NOW are shared. See https://github.com/espressif/esp-idf/blob/master/components/esp_wifi/Kconfig#L589Testing
Tested with esp32 hardware. A browser client connected to the device's soft-AP stays connected across repeated
set_configcalls with an unchanged config, where before it would get disconnected.Changelog
esp-radio