mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 03:12:20 +01:00
[wifi] Fix retry with hidden networks. (#10445)
This commit is contained in:
committed by
Jesse Hills
parent
4ab37b069b
commit
a11970aee0
@@ -151,6 +151,8 @@ void WiFiComponent::loop() {
|
|||||||
this->status_set_warning("waiting to reconnect");
|
this->status_set_warning("waiting to reconnect");
|
||||||
if (millis() - this->action_started_ > 5000) {
|
if (millis() - this->action_started_ > 5000) {
|
||||||
if (this->fast_connect_ || this->retry_hidden_) {
|
if (this->fast_connect_ || this->retry_hidden_) {
|
||||||
|
if (!this->selected_ap_.get_bssid().has_value())
|
||||||
|
this->selected_ap_ = this->sta_[0];
|
||||||
this->start_connecting(this->selected_ap_, false);
|
this->start_connecting(this->selected_ap_, false);
|
||||||
} else {
|
} else {
|
||||||
this->start_scanning();
|
this->start_scanning();
|
||||||
@@ -670,10 +672,12 @@ void WiFiComponent::check_connecting_finished() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ESP_LOGI(TAG, "Connected");
|
||||||
// We won't retry hidden networks unless a reconnect fails more than three times again
|
// We won't retry hidden networks unless a reconnect fails more than three times again
|
||||||
|
if (this->retry_hidden_ && !this->selected_ap_.get_hidden())
|
||||||
|
ESP_LOGW(TAG, "Network '%s' should be marked as hidden", this->selected_ap_.get_ssid().c_str());
|
||||||
this->retry_hidden_ = false;
|
this->retry_hidden_ = false;
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Connected");
|
|
||||||
this->print_connect_params_();
|
this->print_connect_params_();
|
||||||
|
|
||||||
if (this->has_ap()) {
|
if (this->has_ap()) {
|
||||||
|
Reference in New Issue
Block a user