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

esp_wifi_connect() Automatically Retries Every Two Seconds (GIT8266O-426) #856

Open
mriksman opened this issue Mar 30, 2020 · 0 comments
Open

Comments

@mriksman
Copy link

In the examples for Wi-Fi, it has the following code;

if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {
        esp_wifi_connect();
    } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) {
        if (s_retry_num < MAXIMUM_RETRY) {
            esp_wifi_connect();
            s_retry_num++;
        } else {
            ESP_LOGI(TAG, "Failed");
        }

However, once esp_wifi_connect() has been called once, it continues to retry every two seconds; so the console keeps showing the ESP_LOGI of 'Failed'. These ESP8266 RTOS SDK examples don't reflect how the ESP8266 RTOS SDK actually performs.

This is inconsistent with the behaviour of ESP-IDF. It doesn't keep automatically retrying.

Why does ESP8266 RTOS SDK automatically retry (and how to disable that behaviour), whilst ESP-IDF does not?

@github-actions github-actions bot changed the title esp_wifi_connect() Automatically Retries Every Two Seconds esp_wifi_connect() Automatically Retries Every Two Seconds (GIT8266O-426) Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant