1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-03 11:52:20 +01:00

WIP: ESP8266 work on connection issues (#648)

* Erase all flash for USB uploads on ESP8266s

Previously, only erased "write regions".

Downside: Config for other FWs like tasmota could be affected

Upside: Potentially fixes some ESP8266 connection issues

Related: https://github.com/esphome/issues/issues/455#issuecomment-503524479

* Clear WiFi settings for ESP8266

Clears wifi settings from retained storage on ESP8266 (if set).

Unsure if this is the actual issue, but it won't cause problems either.

* Update wifi_component_esp8266.cpp

* Revert erase chip for testing

* Improve wait_time calculation
This commit is contained in:
Otto Winter
2019-07-02 13:03:11 +02:00
committed by GitHub
parent d2938e82db
commit 13522c8f19
5 changed files with 84 additions and 44 deletions

View File

@@ -31,22 +31,15 @@ float WiFiComponent::get_setup_priority() const { return setup_priority::WIFI; }
void WiFiComponent::setup() {
ESP_LOGCONFIG(TAG, "Setting up WiFi...");
this->last_connected_ = millis();
this->wifi_register_callbacks_();
bool ret = this->wifi_mode_(this->has_sta(), false);
if (!ret) {
this->mark_failed();
return;
}
this->wifi_pre_setup_();
if (this->has_sta()) {
this->wifi_disable_auto_connect_();
delay(10);
this->wifi_sta_pre_setup_();
this->wifi_apply_power_save_();
if (!this->wifi_apply_power_save_()) {
ESP_LOGV(TAG, "Setting Power Save Option failed!");
}
if (this->fast_connect_) {
this->selected_ap_ = this->sta_[0];