perf: keep IP after provisioning
This commit is contained in:
+9
-1
@@ -82,7 +82,15 @@ static void wifi_init_sta(void)
|
|||||||
{
|
{
|
||||||
esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, wifi_event_handler, NULL);
|
esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, wifi_event_handler, NULL);
|
||||||
esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, wifi_event_handler, NULL);
|
esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, wifi_event_handler, NULL);
|
||||||
ESP_ERROR_CHECK(esp_wifi_connect());
|
|
||||||
|
esp_netif_t *netif = esp_netif_get_handle_from_ifkey("WIFI_STA_DEF");
|
||||||
|
esp_netif_ip_info_t ip_info = {0};
|
||||||
|
if (netif && esp_netif_get_ip_info(netif, &ip_info) == ESP_OK && ip_info.ip.addr != 0) {
|
||||||
|
ESP_LOGI(TAG, "WiFi already connected (IP: " IPSTR ")", IP2STR(&ip_info.ip));
|
||||||
|
xEventGroupSetBits(s_evt, WIFI_CONNECTED_BIT);
|
||||||
|
} else {
|
||||||
|
ESP_ERROR_CHECK(esp_wifi_connect());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool resolve_mqtt_broker_mdns(char *host_out, size_t host_len, uint16_t *port_out)
|
static bool resolve_mqtt_broker_mdns(char *host_out, size_t host_len, uint16_t *port_out)
|
||||||
|
|||||||
@@ -3295,6 +3295,15 @@ CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1
|
|||||||
CONFIG_VFS_INITIALIZE_DEV_NULL=y
|
CONFIG_VFS_INITIALIZE_DEV_NULL=y
|
||||||
# end of Virtual file system
|
# end of Virtual file system
|
||||||
|
|
||||||
|
#
|
||||||
|
# Sensor Configuration
|
||||||
|
#
|
||||||
|
# default:
|
||||||
|
CONFIG_SENSOR_RESET_GPIO=0
|
||||||
|
# default:
|
||||||
|
CONFIG_SENSOR_RESET_HOLD_MS=5000
|
||||||
|
# end of Sensor Configuration
|
||||||
|
|
||||||
#
|
#
|
||||||
# cJSON
|
# cJSON
|
||||||
#
|
#
|
||||||
@@ -3408,9 +3417,7 @@ CONFIG_NETWORK_PROV_AUTOSTOP_TIMEOUT=30
|
|||||||
# CONFIG_NETWORK_PROV_BLE_NOTIFY is not set
|
# CONFIG_NETWORK_PROV_BLE_NOTIFY is not set
|
||||||
# default:
|
# default:
|
||||||
# CONFIG_NETWORK_PROV_KEEP_BLE_ON_AFTER_PROV is not set
|
# CONFIG_NETWORK_PROV_KEEP_BLE_ON_AFTER_PROV is not set
|
||||||
# default:
|
|
||||||
CONFIG_NETWORK_PROV_WIFI_STA_ALL_CHANNEL_SCAN=y
|
CONFIG_NETWORK_PROV_WIFI_STA_ALL_CHANNEL_SCAN=y
|
||||||
# default:
|
|
||||||
# CONFIG_NETWORK_PROV_WIFI_STA_FAST_SCAN is not set
|
# CONFIG_NETWORK_PROV_WIFI_STA_FAST_SCAN is not set
|
||||||
# end of Network Provisioning Manager
|
# end of Network Provisioning Manager
|
||||||
# end of Component config
|
# end of Component config
|
||||||
|
|||||||
@@ -20,3 +20,7 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
|
|
||||||
# Enable OTA
|
# Enable OTA
|
||||||
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
|
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
|
||||||
|
|
||||||
|
# Factory reset button (GPIO 0 = BOOT button on ESP32 DevKit)
|
||||||
|
CONFIG_ANCHOR_RESET_GPIO=0
|
||||||
|
CONFIG_ANCHOR_RESET_HOLD_MS=5000
|
||||||
|
|||||||
Reference in New Issue
Block a user