system_event: SYSTEM_EVENT_STA_DISCONNECTED, reason:2 (auth expired)

julienD
Posts: 32
Joined: Fri Sep 13, 2019 12:38 pm

system_event: SYSTEM_EVENT_STA_DISCONNECTED, reason:2 (auth expired)

Postby julienD » Sat Apr 11, 2020 11:46 am

Hello

With esp-wroom-32d, idf v4.0-beta2-366-gaa51829ec, xtensa-esp32-elf-gcc (crosstool-NG esp32-2019r1) 8.2.0 :


My app connects to wifi hotspot. it opens a webserver and websocket. The apps works correctly (basically, set on or off some pins based on data received from websocket, and push buttons).
After some days, the application is still running (buttons still do what they are intended to) but the app in unreachable using wifi connection.

It seems that the esp is disconnected due to "auth expire".
I was unable to get the log from the point where the app stopped working but this is the log that is continuously running after:

Code: Select all

D (502437089) system_event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Freebox-648BE6, ssid_len:14, bssid:00:00:00:00:00:00, reason:205 (other reason)<ESC>[0m
D (502437089) event: running post WIFI_EVENT:5 with handler 0x400d6b00 on loop 0x3ffbee00<ESC>[0m
<ESC>[0;32mI (502437099) Wifi: DISCONNECTED<ESC>[0m
D (502437109) event: running post WIFI_EVENT:5 with handler 0x400dd380 on loop 0x3ffbee00<ESC>[0m
D (502437109) event: running post WIFI_EVENT:5 with handler 0x40103d44 on loop 0x3ffbee00<ESC>[0m
D (502437119) tcpip_adapter: if0 start ip lost tmr: enter<ESC>[0m
D (502437129) tcpip_adapter: if0 start ip lost tmr: no need start because netif=0x3ffc7998 interval=120 ip=0<ESC>[0m
I (502437229) wifi: new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1
I (502437229) wifi: state: init -> auth (b0)
I (502437229) wifi: state: auth -> assoc (0)
I (502437239) wifi: state: assoc -> run (10)
I (502441239) wifi: state: run -> init (2c0)
I (502441239) wifi: new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1
I (502441239) wifi: new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1
D (502441249) system_event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Freebox-648BE6, ssid_len:14, bssid:e4:9e:12:a5:12:80, reason:2 (auth expire)<ESC>[0m
D (502441259) event: running post WIFI_EVENT:5 with handler 0x400d6b00 on loop 0x3ffbee00<ESC>[0m
<ESC>[0;32mI (502441269) Wifi: DISCONNECTED<ESC>[0m
D (502441279) event: running post WIFI_EVENT:5 with handler 0x400dd380 on loop 0x3ffbee00<ESC>[0m
D (502441279) event: running post WIFI_EVENT:5 with handler 0x40103d44 on loop 0x3ffbee00<ESC>[0m
D (502441289) tcpip_adapter: if0 start ip lost tmr: enter<ESC>[0m
D (502441299) tcpip_adapter: if0 start ip lost tmr: no need start because netif=0x3ffc7998 interval=120 ip=0<ESC>[0m
D (502443319) system_event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Freebox-648BE6, ssid_len:14, bssid:00:00:00:00:00:00, reason:205 (other reason)<ESC>[0m
D (502443329) event: running post WIFI_EVENT:5 with handler 0x400d6b00 on loop 0x3ffbee00<ESC>[0m
<ESC>[0;32mI (502443329) Wifi: DISCONNECTED<ESC>[0m
D (502443339) event: running post WIFI_EVENT:5 with handler 0x400dd380 on loop 0x3ffbee00<ESC>[0m
D (502443349) event: running post WIFI_EVENT:5 with handler 0x40103d44 on loop 0x3ffbee00<ESC>[0m
D (502443359) tcpip_adapter: if0 start ip lost tmr: enter<ESC>[0m
D (502443359) tcpip_adapter: if0 start ip lost tmr: no need start because netif=0x3ffc7998 interval=120 ip=0<ESC>[0m
I (502443459) wifi: new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1
I (502443459) wifi: state: init -> auth (b0)
I (502443469) wifi: state: auth -> assoc (0)
I (502443469) wifi: state: assoc -> run (10)
I (502447469) wifi: state: run -> init (2c0)
I (502447469) wifi: new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1
I (502447469) wifi: new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1
D (502447479) system_event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Freebox-648BE6, ssid_len:14, bssid:e4:9e:12:a5:12:80, reason:2 (auth expire)<ESC>[0m
D (502447489) event: running post WIFI_EVENT:5 with handler 0x400d6b00 on loop 0x3ffbee00<ESC>[0m
<ESC>[0;32mI (502447499) Wifi: DISCONNECTED<ESC>[0m
D (502447509) event: running post WIFI_EVENT:5 with handler 0x400dd380 on loop 0x3ffbee00<ESC>[0m
D (502447509) event: running post WIFI_EVENT:5 with handler 0x40103d44 on loop 0x3ffbee00<ESC>[0m
D (502447519) tcpip_adapter: if0 start ip lost tmr: enter<ESC>[0m
D (502447529) tcpip_adapter: if0 start ip lost tmr: no need start because netif=0x3ffc7998 interval=120 ip=0<ESC>[0m
D (502449549) system_event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:Freebox-648BE6, ssid_len:14, bssid:00:00:00:00:00:00, reason:205 (other reason)<ESC>[0m
the wifi_event_handler code is:

Code: Select all

static void wifi_event_handler(void* arg, esp_event_base_t event_base,
                               int32_t event_id, void* event_data) {
    switch (event_id) {
        case WIFI_EVENT_STA_START:
            ESP_LOGI(TAG, "SYSTEM_EVENT_STA_START");
            tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_STA, HOSTNAME);
            esp_wifi_connect();
            break;
        case WIFI_EVENT_STA_DISCONNECTED: {
            ESP_LOGI(TAG, "DISCONNECTED");
            esp_wifi_connect();
            break;
        }
        case WIFI_EVENT_SCAN_DONE:
            ESP_LOGI(TAG, "WIFI_EVENT_SCAN_DONE");
            break;
//---
// ...   Snip, all other cases only writes on console like the above case.
//---
        default:
            break;
    }
}
I don't understand why the esp does not reconnect. It is physically very close to the AP.

What can happen?

Thanks
Julien

Who is online

Users browsing this forum: No registered users and 159 guests