Project

General

Profile

Actions

atm-environment-alarm-system #24

open
CP CP

Provisioning reset

atm-environment-alarm-system #24: Provisioning reset

Added by Carsten Poulsen 14 days ago.

Status:
New
Priority:
normal
% Done:

0%

Type:
Implementation

Description

#define WIFI_RESET_GPIO     GPIO_NUM_0   // or whatever GPIO you choose

// Check at boot — hold button during power-on to reset WiFi
gpio_config_t cfg = {
    .pin_bit_mask = (1ULL << WIFI_RESET_GPIO),
    .mode         = GPIO_MODE_INPUT,
    .pull_up_en   = GPIO_PULLUP_ENABLE,
    .intr_type    = GPIO_INTR_DISABLE,
};
gpio_config(&cfg);

if (gpio_get_level(WIFI_RESET_GPIO) == 0) {
    ESP_LOGW(TAG, "WiFi reset requested — clearing credentials");
    wifi_prov_mgr_reset_provisioning();
    ESP_LOGW(TAG, "Restarting...");
    esp_restart();
}

No data to display

Actions

Also available in: PDF Atom