fix(dns): register 8.8.8.8 fallback DNS, wake Wi-Fi during Gitea check, and add retries
All checks were successful
ESP32 Build & Release / build (push) Successful in 1m14s
All checks were successful
ESP32 Build & Release / build (push) Successful in 1m14s
This commit is contained in:
@@ -33,6 +33,7 @@ static char s_active_ssid[WIFI_SSID_MAX_LEN + 1] = {0};
|
||||
static SemaphoreHandle_t s_wifi_mux = NULL;
|
||||
static SemaphoreHandle_t s_net_lock = NULL;
|
||||
static bool s_manual_disconnect = false;
|
||||
static esp_netif_t *s_sta_netif = NULL;
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
@@ -198,6 +199,12 @@ static void wifi_event_handler(void *arg, esp_event_base_t base, int32_t id, voi
|
||||
if (s_wifi_group) {
|
||||
xEventGroupSetBits(s_wifi_group, WIFI_CONNECTED_BIT);
|
||||
}
|
||||
if (s_sta_netif != NULL) {
|
||||
esp_netif_dns_info_t dns_fallback = {0};
|
||||
dns_fallback.ip.type = ESP_IPADDR_TYPE_V4;
|
||||
dns_fallback.ip.u_addr.ip4.addr = ESP_IP4TOADDR(8, 8, 8, 8);
|
||||
esp_netif_set_dns_info(s_sta_netif, ESP_NETIF_DNS_FALLBACK, &dns_fallback);
|
||||
}
|
||||
/* Enable modem power saving when idle on station network */
|
||||
esp_wifi_set_ps(WIFI_PS_MIN_MODEM);
|
||||
ESP_LOGI(TAG, "Wi-Fi modem sleep enabled (WIFI_PS_MIN_MODEM: ~30-40 mA saved)");
|
||||
@@ -372,9 +379,9 @@ esp_err_t wifi_manager_init(void)
|
||||
|
||||
ESP_ERROR_CHECK(esp_netif_init());
|
||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||
esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta();
|
||||
if (sta_netif != NULL) {
|
||||
esp_netif_set_hostname(sta_netif, "mtg-companion");
|
||||
s_sta_netif = esp_netif_create_default_wifi_sta();
|
||||
if (s_sta_netif != NULL) {
|
||||
esp_netif_set_hostname(s_sta_netif, "mtg-companion");
|
||||
}
|
||||
|
||||
esp_netif_t *ap_netif = esp_netif_create_default_wifi_ap();
|
||||
|
||||
Reference in New Issue
Block a user