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

Check if esp32 workaround not needed ... #7030

Open
jepler opened this issue Oct 10, 2022 · 2 comments
Open

Check if esp32 workaround not needed ... #7030

jepler opened this issue Oct 10, 2022 · 2 comments
Labels
Milestone

Comments

@jepler
Copy link
Member

jepler commented Oct 10, 2022

After #7023 maybe the #if'd workaround in wifi_reset() is not needed:

void wifi_reset(void) {
    if (!wifi_inited) {
        return;
    }
    common_hal_wifi_monitor_deinit(MP_STATE_VM(wifi_monitor_singleton));
    wifi_radio_obj_t *radio = &common_hal_wifi_radio_obj;
    common_hal_wifi_radio_set_enabled(radio, false);
    #ifndef CONFIG_IDF_TARGET_ESP32
    ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT,
        ESP_EVENT_ANY_ID,
        radio->handler_instance_all_wifi));
    ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT,
        IP_EVENT_STA_GOT_IP,
        radio->handler_instance_got_ip));
    ESP_ERROR_CHECK(esp_wifi_deinit());
    esp_netif_destroy(radio->netif);
    radio->netif = NULL;
    esp_netif_destroy(radio->ap_netif);
    radio->ap_netif = NULL;
    wifi_inited = false;
    #endif
    supervisor_workflow_request_background();
}
@microdev1 microdev1 added needs retest espressif applies to multiple Espressif chips and removed esp32 labels Oct 11, 2022
@dhalbert dhalbert added this to the 8.x.x milestone Oct 17, 2022
@DavePutz
Copy link
Collaborator

I tested CP 8.1 beta on a doit_esp32_devkit_v1. After taking out the #ifdef in wifi_reset() in /ports/espressif/common-hal/wifi/init.c ; I was able to run code.py multiple times and successfully reconnect to wifi. @jepler , are there some other tests that you would like done?

@dhalbert dhalbert modified the milestones: 8.x.x, Long term Apr 14, 2023
@jepler
Copy link
Member Author

jepler commented Apr 14, 2023

I don't have any devices with me to test, so please feel free to remove the workaround if your testing indicates it's not needed. I don't have any specific recollection, so I can only rely on what was in the related commit message:

After this change, it's possible to connect multiple times to wifi in different runs of code.py or the repl after soft rebooting.

so it sounds like @DavePutz 's testing shows this is no longer needed.

I can't do any testing before May so I recommend going ahead and accepting a change related to this based on dave's testing.

@jepler jepler removed their assignment Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants