WiFi stop and restart doesn't allow re-connect

dparkinson
Posts: 7
Joined: Tue Aug 08, 2017 12:28 pm

WiFi stop and restart doesn't allow re-connect

Postby dparkinson » Wed Feb 14, 2018 9:03 pm

I need to turn the WiFi on and off based on commands received from other peripheral interfaces. I added some debug function to an existing program to make sure turning the WiFi on/off worked before I worried about commanding it via external peripherals. In this test program, the WiFi starts okay and I can connect to it with my device and access the test webpages via a browser. Then, it stops and restarts. After this, my device still connects to the esp32 WiFi, but the browser will no longer bring up the webpage. If I wait for the WiFi to turn off again and turn back on, then everything works again.
I've tried a work-around where I just turn the Wi-Fi off for 1 seconds, back on for 1 second, then back off before I wait to turn it on for real. But that doesn't seem to work.

Anyone have any suggestions?

only running in AP mode and not connecting the ESP32 to another network or anything.
using IDF v2.1.1
running only on a single core

Here is my basic code

Code: Select all


typedef enum McmWifiStateType
{
    e_mcmWifiOff   = 0,
    e_mcmWifiOn,
    e_mcmWifiStarting,
    e_mcmWifiStopping,
    e_mcmWifiEnd,
}McmWifiState_t;

static struct netbuf    *sg_pHttpInBuf;
static char             *sg_pHttpDataBuf;
static uint16_t          sg_httpDataBufLen;
static struct netconn   *sg_pHttpConn;
static QueueHandle_t sg_wifiStateQHandle = NULL;

#if (1 == DBG_WIFI_MCM)  
#define DBG_WIFI_TIME_ON_MS (1 * 20000u)
static uint32_t sg_nextOnTimeMs = 0;
#endif 


void app_main()
{
    esp_err_t err = nvs_flash_init();
    initialize_gpio_values();

    xTaskCreatePinnedToCore(ServerTask, "ServerTask", 4096, NULL, 5, NULL, PRO_CPU_NUM); 

    while (1)
    {
        esp_task_wdt_feed(); 
        __asm__ __volatile__("nop;nop;nop;nop;nop;nop;nop;"); // Bug workaround (I found this snippet somewhere in this forum)
        vTaskDelay(pdMS_TO_TICKS(MAX_TASK_WAIT_MS));
    }
}

/***  initialize_wifi *****************************************************/
/**************************************************************************/
void initialize_wifi(void)
{
    // initialize other module variables.
    sg_pHttpInBuf = NULL;
    sg_pHttpDataBuf = NULL;
    sg_httpDataBufLen = 0;
    sg_pHttpConn = NULL;

    // setup notification Queue for signalling when to turn Wi-Fi On & off.
    sg_wifiStateQHandle = xQueueCreate(2, sizeof(McmWifiState_t));
 
    
    tcpip_adapter_init();
    tcpip_adapter_ip_info_t info;
    memset(&info, 0, sizeof(info));
    IP4_ADDR(&info.ip, 192, 168, 10, 1);
    IP4_ADDR(&info.gw, 192, 168, 10, 1);
    IP4_ADDR(&info.netmask, 255, 255, 255, 0);
    ESP_ERROR_CHECK(tcpip_adapter_dhcps_stop(TCPIP_ADAPTER_IF_AP));
    ESP_ERROR_CHECK(tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_AP, &info));
    ESP_ERROR_CHECK(tcpip_adapter_dhcps_start(TCPIP_ADAPTER_IF_AP));
    ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL));
    
    wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
    ESP_ERROR_CHECK(esp_wifi_init(&cfg));

} //initialize_wifi

/***  ServerTask *****************************************************/
/************************************************************************/
void ServerTask(void *pvParameters)
{
    initialize_wifi();  // initialize parameters used by Wi-Fi
    struct netconn *conn = NULL;
    err_t err = ERR_OK;
    nextWifiState = e_mcmWifiOff;   // Turn Wi-Fi off, if it was on for some reason.
    // task's infinite-loop 
    for (;;)
    {   
        esp_task_wdt_feed();  
        // if need to turn off Wi-Fi
        if ((e_mcmWifiStopping == nextWifiState)
            || (e_mcmWifiOff == nextWifiState)) // 2nd clause just in case
        {
            StopWifi();
            esp_task_wdt_delete(); // unsubscribe task since going to block indefinitely
#if (1 == DBG_WIFI_MCM)  
            sg_nextOnTimeMs = GET_TIMESTAMP_MS() + DBG_WIFI_TIME_ON_MS;
            while ((GET_TIMESTAMP_MS() < sg_nextOnTimeMs)
                   && (pdFALSE != xQueueIsQueueEmptyFromISR(sg_wifiStateQHandle)))
            {
#if (1 == DBG_MCM_HEAP)
                ESP_LOGD("ServerTask", "heap Size, %u", xPortGetFreeHeapSizeCaps(MALLOC_CAP_8BIT));
#endif
                ESP_LOGD("ServerTask", "WiFi Off Time remaining: %u Seconds", (sg_nextOnTimeMs - GET_TIMESTAMP_MS())/1000);
                vTaskDelay(pdMS_TO_TICKS(9000));
            }
            ChangeWiFiState(e_mcmWifiStarting);   // put what WiFi should be into queue to change it.
#endif             
            /* Block indefinitely (without a timeout) to wait for next change to wifi */
            xQueueReceive(sg_wifiStateQHandle, &nextWifiState, portMAX_DELAY);     // check next request;
            if((e_mcmWifiStarting == nextWifiState)
                   || (e_mcmWifiOn == nextWifiState)) // 2nd clause just in case
            {
                StartWifi();
                nextWifiState = e_mcmWifiOn;
#if (1 == DBG_WIFI_MCM)  
                sg_nextOnTimeMs = GET_TIMESTAMP_MS() + DBG_WIFI_TIME_ON_MS;
#endif 
            }
        } // end if need to turn wi-fi off

        conn = netconn_new(NETCONN_TCP);
        netconn_bind(conn, NULL, 80);
        netconn_listen(conn);
        if (NULL != conn)
        {
            conn->recv_timeout = MAX_TASK_WAIT_MS;
        }

        err = ERR_OK;
        // loop where work is done until an error or Wi-Fi needs to be turned off
        while((err == ERR_OK)
              && (e_mcmWifiStopping != nextWifiState)
              && (e_mcmWifiOff != nextWifiState)) 
        {
            esp_task_wdt_feed();
            err = netconn_accept(conn, &sg_pHttpConn);

            if (err == ERR_OK)
            {
                esp_task_wdt_feed(); 
                http_server_netconn_serve();
            }
            else if(err == ERR_TIMEOUT) // if timed out waiting
            {
                vTaskDelay(pdMS_TO_TICKS(10)); // delay a little to ensure round robin scheduler works and help with memory clean up
                err = ERR_OK;
            }
        
            // clean up old connection
            if (NULL != sg_pHttpConn)
            {
                netconn_delete(sg_pHttpConn);
                netconn_free(sg_pHttpConn);
                sg_pHttpConn = NULL;
            }

#if (1 == DBG_WIFI_MCM)              
            if (GET_TIMESTAMP_MS() < sg_nextOnTimeMs)
            {
                ESP_LOGD("ServerTask", "WiFi On Time remaining: %u Seconds", (sg_nextOnTimeMs - GET_TIMESTAMP_MS()) / 1000);
            }
            else
            {
                ChangeWiFiState(e_mcmWifiStopping);   
            }
#endif 
            
            // check if need to turn off Wi-Fi
            xQueueReceive(sg_wifiStateQHandle, &nextWifiState, 0);      // check next request. If no request, then don't need to turn off.
        
#if (1 == DBG_MCM_HEAP)
        ESP_LOGD("ServerTask", "heap Size, %u", xPortGetFreeHeapSizeCaps(MALLOC_CAP_8BIT));
#endif
        } // end while(err ==  ERR_OK &&  wifi is supposed to be on)
        
        // clean up and try to restart.
        if (NULL != conn)
        {
            netconn_close(conn);
            netconn_delete(conn);
            netconn_free(conn);
            conn = NULL;
        }

    } // end for(;;) infinite loop

} // ServerTask

/***  event_handler *****************************************************/
/************************************************************************/
static esp_err_t event_handler(void *ctx, system_event_t *event)
{
#if (1 == DBG_WIFI_MCM) 
    ESP_LOGD("event_handler","wifi event handler invoked");
#endif

    return ESP_OK;
 
}

/***  StartWifi *****************************************************/
/************************************************************************/
static void StartWifi(void)
{
#if (1 == DBG_WIFI_MCM) || (1 == DBG_MCM_HEAP)
    const char* TAG = "StartWifi";
    ESP_LOGD(TAG, "Starting WiFi");
#if (1 == DBG_MCM_HEAP)
    ESP_LOGD(TAG, "heap Size, %u", xPortGetFreeHeapSizeCaps(MALLOC_CAP_8BIT));
#endif  
#endif

    ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_RAM));
    
    wifi_config_t wifi_config;
    memset(&wifi_config, 0, sizeof(wifi_config));
    strcpy((char *)wifi_config.ap.ssid, "myWifi");
    wifi_config.ap.ssid_len = strlen((char *)wifi_config.ap.ssid);
    wifi_config.ap.max_connection = 4;
    
    ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_AP));
    ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_AP, &wifi_config));
    ESP_ERROR_CHECK(esp_wifi_start());
    
#if (1 == DBG_WIFI_MCM) || (1 == DBG_MCM_HEAP)
    ESP_LOGD(TAG, "Wi-Fi Started");
#if (1 == DBG_MCM_HEAP)
    ESP_LOGD(TAG, "heap Size, %u", xPortGetFreeHeapSizeCaps(MALLOC_CAP_8BIT));
#endif      
#endif
} // StartWifi

/***  StopWifi *****************************************************/
/***********************************************************************/
static void StopWifi(void)
{
#if (1 == DBG_WIFI_MCM) || (1 == DBG_MCM_HEAP) 
    const char* TAG = "StopWifi";
    ESP_LOGD(TAG, "Stopping WiFi");
#if (1 == DBG_MCM_HEAP)
    ESP_LOGD(TAG, "heap Size, %u", xPortGetFreeHeapSizeCaps(MALLOC_CAP_8BIT));
#endif 
#endif   

    esp_err_t err = ESP_OK;
    
    if (err == ESP_OK)
    {
        err = esp_wifi_stop();
#if (1 == DBG_WIFI_MCM)
        ESP_LOGD(TAG, "esp_wifi_stop() err=0x%04X", err);
#endif 
    }
    
    if (err == ESP_OK)
    {
        err = esp_wifi_set_mode(WIFI_MODE_NULL);
#if (1 == DBG_WIFI_MCM)
        ESP_LOGD(TAG, "esp_wifi_set_mode(WIFI_MODE_NULL) err=0x%04X", err);
#endif         
    }
   
    if ((err != ESP_ERR_WIFI_NOT_INIT) 
        && (err != ESP_OK))
    {
        ESP_ERROR_CHECK(err);
    }

#if (1 == DBG_WIFI_MCM) || (1 == DBG_MCM_HEAP)
    ESP_LOGD(TAG, "Wi-Fi Stopped");
#if (1 == DBG_MCM_HEAP)
    ESP_LOGD(TAG, "heap Size, %u", xPortGetFreeHeapSizeCaps(MALLOC_CAP_8BIT));
#endif     
#endif
} // StopWifi

/***  ChangeWiFiState *****************************************************/
/**
 * @brief   Short Description of Function                                \n
 *                                                                       \n
 * This description should describe the function completely from a high-
 * level standpoint.  It should also tell how this function is intended to
 * be used in the calling environment.
 *
 * @param    arg1   Description of arg1
 * @param    arg2   Description of arg2
 *
 * @returns  Description of the return value
 *
 *************************************************************************/
esp_err_t ChangeWiFiState(McmWifiState_t nextWifiState)
{
    esp_err_t err = ESP_OK;
     // send task request to change wifi state.
     if (pdTRUE != xQueueSend(sg_wifiStateQHandle, 
                              &nextWifiState, 
                              pdMS_TO_TICKS(10)))  
     {
         err =  ESP_ERR_TIMEOUT;
     }
    
    return (err);
} //ChangeWiFiState

/***  http_server_netconn_serve *****************************************************/
/*************************************************************************/
static void http_server_netconn_serve(void)
{
    err_t netErr;
    
#if (1 == DBG_MCM_HEAP)
    const char * TAG = "http_server_netconn_serve";
    ESP_LOGD(TAG, "ENTRY heap Size, %u", xPortGetFreeHeapSizeCaps(MALLOC_CAP_8BIT));
#endif
    
    netErr = netconn_recv(sg_pHttpConn, &sg_pHttpInBuf);
    
#if (1 == DBG_MCM_HEAP)
    ESP_LOGD(TAG, "after netconn_recv heap Size, %u", xPortGetFreeHeapSizeCaps(MALLOC_CAP_8BIT));
#endif    
    
    esp_task_wdt_feed(); 
    if (netErr == ERR_OK)
    {
	    // get the data from the net connection
        netbuf_data(sg_pHttpInBuf, (void**)&sg_pHttpDataBuf, &sg_httpDataBufLen);
       /***
        *  DO STUFF WITH THE DATA...
        *  - send back requested webpages,
        *  - etc.
        */

    } // end if (netErr == ERR_OK)
#if (1 == DBG_WIFI_MCM)
    else if(netErr == ERR_TIMEOUT)
    {
        ESP_LOGD(TAG, "netconn_recv TIMEOUT Error: %i\n", netErr); 
    }   
    else
    {
        printf("netconn_recv Error: %i\n", netErr);
    }
#endif
#if (1 == DBG_MCM_HEAP) 
    ESP_LOGD(TAG, "after request done heap Size, %u", xPortGetFreeHeapSizeCaps(MALLOC_CAP_8BIT));
#endif   
    // close the connection and free the buffer
    netconn_close(sg_pHttpConn);
    netbuf_delete(sg_pHttpInBuf);
    sg_pHttpInBuf = NULL;
    sg_pHttpDataBuf = NULL;
    
#if (1 == DBG_MCM_HEAP)
    esp_task_wdt_feed();
    //vTaskDelay(pdMS_TO_TICKS(500));
    ESP_LOGD(TAG, "after netbuf_delete() heap Size, %u", xPortGetFreeHeapSizeCaps(MALLOC_CAP_8BIT));
#endif        
} // http_server_netconn_serve

Below is the log output of the program.

Code: Select all

rst:0x3 (SW_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0008,len:8
load:0x3fff0010,len:4372
load:0x40078000,len:11072
ho 0 tail 12 room 4
load:0x40080000,len:252
entry 0x40080034
I (47) boot: ESP-IDF v2.1 2nd stage bootloader
I (48) boot: compile time 13:42:24
I (48) boot: Enabling RNG early entropy source...
I (61) boot: SPI Speed      : 40MHz
I (74) boot: SPI Mode       : DIO
I (86) boot: SPI Flash Size : 4MB
I (98) boot: Partition Table:
I (110) boot: ## Label            Usage          Type ST Offset   Length
I (132) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (155) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (179) boot:  2 factory          factory app      00 00 00010000 00100000
I (202) boot:  3 params           unknown          40 00 00110000 00050000
I (225) boot:  4 filestore        Unknown data     01 81 00200000 001f0000
I (249) boot: End of partition table
I (262) boot: Disabling RNG early entropy source...
I (279) boot: Loading app partition at offset 00010000
I (1491) boot: segment 0: paddr=0x00010018 vaddr=0x00000000 size=0x0ffe8 ( 65512) 
I (1492) boot: segment 1: paddr=0x00020008 vaddr=0x3f400010 size=0x38990 (231824) map
I (1508) boot: segment 2: paddr=0x000589a0 vaddr=0x3ffb0000 size=0x024ec (  9452) load
I (1539) boot: segment 3: paddr=0x0005ae94 vaddr=0x40080000 size=0x00400 (  1024) load
I (1562) boot: segment 4: paddr=0x0005b29c vaddr=0x40080400 size=0x123f8 ( 74744) load
I (1623) boot: segment 5: paddr=0x0006d69c vaddr=0x400c0000 size=0x00000 (     0) load
I (1624) boot: segment 6: paddr=0x0006d6a4 vaddr=0x00000000 size=0x02964 ( 10596) 
I (1646) boot: segment 7: paddr=0x00070010 vaddr=0x400d0018 size=0x70cdc (462044) map
I (1674) cpu_start: Pro cpu up.
I (1684) cpu_start: Single core mode
I (1698) heap_alloc_caps: Initializing. RAM available for dynamic allocation:
I (1721) heap_alloc_caps: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (1742) heap_alloc_caps: At 3FFCFCE0 len 00010320 (64 KiB): DRAM
I (1762) heap_alloc_caps: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (1784) heap_alloc_caps: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1805) heap_alloc_caps: At 400927F8 len 0000D808 (54 KiB): IRAM
I (1826) cpu_start: Pro cpu start user code
I (1883) cpu_start: Starting scheduler on PRO CPU.
D (1886) nvs: nvs_flash_init_custom start=9 count=6
D (1894) wl_flash: init - config ID=1, stored ID=1, access_count=0, block_size=4096, max_count=16, pos=0, move_count=1
D (1894) wl_flash: init starts: crc1=-852403191, crc2 = -852403191, this->state.crc=-852403191, state_copy->crc=-852403191
D (1905) wl_flash: init: crc1=-852403191, crc2 = -852403191, result=0
D (1917) wl_flash: recoverPos - this->state.pos=0x00000161, result=00000000
D (1918) vfs_fat_spiflash: using pdrv=0
D (6419) tcpip_adapter: check: local, if=1 fn=0x4013900c

D (6419) tcpip_adapter: dhcp server stop successfully
D (6420) tcpip_adapter: call api in lwip: ret=0x0, give sem
D (6425) tcpip_adapter: check: remote, if=1 fn=0x4013900c

D (6430) tcpip_adapter: check: local, if=1 fn=0x40139168

D (6436) tcpip_adapter: call api in lwip: ret=0x0, give sem
D (6441) tcpip_adapter: check: remote, if=1 fn=0x40139168

D (6447) tcpip_adapter: check: local, if=1 fn=0x40138f00

D (6453) tcpip_adapter: dhcp server re init
D (6457) tcpip_adapter: call api in lwip: ret=0x0, give sem
D (6463) tcpip_adapter: check: remote, if=1 fn=0x40138f00

D (6468) nvs: nvs_open misc 1
D (6471) nvs: nvs_get_str_or_blob log
I (6475) wifi: wifi firmware version: 407bb27
I (6479) wifi: config NVS flash: enabled
I (6483) wifi: config nano formating: disabled
I (6487) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (6496) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
D (6506) nvs: nvs_open nvs.net80211 1
D (6510) nvs: nvs_get opmode 1
D (6513) nvs: nvs_get country 1
D (6516) nvs: nvs_get_str_or_blob sta.ssid
D (6520) nvs: nvs_get_str_or_blob sta.mac
D (6525) nvs: nvs_get sta.authmode 1
D (6528) nvs: nvs_get_str_or_blob sta.pswd
D (6532) nvs: nvs_get_str_or_blob sta.pmk
D (6536) nvs: nvs_get sta.chan 1
D (6540) nvs: nvs_get auto.conn 1
D (6543) nvs: nvs_get bssid.set 1
D (6546) nvs: nvs_get_str_or_blob sta.bssid
D (6551) nvs: nvs_get sta.phym 1
D (6554) nvs: nvs_get sta.phybw 1
D (6557) nvs: nvs_get_str_or_blob sta.apsw
D (6562) nvs: nvs_get_str_or_blob sta.apinfo
D (6566) nvs: nvs_get_str_or_blob ap.ssid
D (6570) nvs: nvs_get_str_or_blob ap.mac
D (6574) nvs: nvs_get_str_or_blob ap.passwd
D (6578) nvs: nvs_get_str_or_blob ap.pmk
D (6582) nvs: nvs_get ap.chan 1
D (6585) nvs: nvs_get ap.authmode 1
D (6589) nvs: nvs_get ap.hidden 1
D (6592) nvs: nvs_get ap.max.conn 1
D (6596) nvs: nvs_get bcn.interval 2
D (6600) nvs: nvs_get ap.phym 1
D (6603) nvs: nvs_get ap.phybw 1
D (6606) nvs: nvs_get ap.sndchan 1
D (6610) nvs: nvs_set_blob sta.mac 6
D (6614) nvs: nvs_set_blob ap.mac 6
I (6617) wifi: Init dynamic tx buffer num: 32
I (6621) wifi: Init dynamic rx buffer num: 8
I (6625) wifi: Init static tx buffer num: 16
I (6630) wifi: wifi driver task: 3ffdfcf4, prio:23, stack:4096
I (6635) wifi: Init static rx buffer num: 10
I (6638) wifi: Init dynamic rx buffer num: 8
I (6642) wifi: Init rx ampdu len mblock:7
I (6646) wifi: Init lldesc rx ampdu entry mblock:4
I (6651) wifi: wifi power manager task: 0x3ffea188 prio: 21 stack: 2560
D (6657) ServerTask: heap Size, 89312
D (6661) ServerTask: WiFi Off Time remaining: 29 Seconds
D (15666) ServerTask: heap Size, 80308
D (15666) ServerTask: WiFi Off Time remaining: 20 Seconds

....

D (33666) ServerTask: WiFi Off Time remaining: 2 Seconds
D (42666) StartWifi: Starting WiFi
D (42666) StartWifi: heap Size, 80308
I (42710) wifi: wifi timer task: 3ffed520, prio:22, stack:3584
D (42710) nvs: nvs_open phy 0
D (42710) nvs: nvs_get cal_version 4
D (42711) nvs: nvs_get_str_or_blob cal_mac
D (42715) nvs: nvs_get_str_or_blob cal_data
D (42721) nvs: nvs_close 3
I (42735) phy: phy_version: 355.1, 59464c5, Jun 14 2017, 20:25:06, 0, 0
I (42736) wifi: mode : softAP (24:0a:c4:03:44:41)
D (42738) tcpip_adapter: check: local, if=1 fn=0x40138a0c
D (42743) tcpip_adapter: dhcp server start:(ip: 192.168.130.1, mask: 255.255.255.0, gw: 192.168.130.1)
D (42751) tcpip_adapter: call api in lwip: ret=0x0, give sem
D (42757) tcpip_adapter: check: remote, if=1 fn=0x40138a0c
D (42763) event_handler: wifi event handler invoked
D (42769) StartWifi: Wi-Fi Started
D (42809) StartWifi: heap Size, 73428
D (43823) ServerTask: WiFi On Time remaining: 58 Seconds
D (43823) ServerTask: heap Size, 72976

...

D (76143) ServerTask: WiFi On Time remaining: 26 Seconds
D (76143) ServerTask: heap Size, 72976
I (76946) wifi: n:1 0, o:1 0, ap:1 1, sta:255 255, prof:1
I (76946) wifi: station: e0:aa:96:da:25:7a join, AID=1, n, 20
D (76948) event_handler: wifi event handler invoked
D (77153) ServerTask: WiFi On Time remaining: 25 Seconds
D (77153) ServerTask: heap Size, 72368
D (78163) ServerTask: WiFi On Time remaining: 24 Seconds
D (78163) ServerTask: heap Size, 72368
D (79173) ServerTask: WiFi On Time remaining: 23 Seconds
D (79173) ServerTask: heap Size, 72368
D (80183) ServerTask: WiFi On Time remaining: 22 Seconds
D (80183) ServerTask: heap Size, 72368
D (81193) ServerTask: WiFi On Time remaining: 21 Seconds
D (81193) ServerTask: heap Size, 72320
D (81456) http_server_netconn_serve: ENTRY heap Size, 69928
D (81457) http_server_netconn_serve: after netconn_recv heap Size, 69888
D (81485) http_server_netconn_serve: after request done heap Size, 68292
D (81491) http_server_netconn_serve: after netbuf_delete() heap Size, 71752
D (81498) ServerTask: WiFi On Time remaining: 21 Seconds
D (81502) ServerTask: heap Size, 71824
D (81607) http_server_netconn_serve: ENTRY heap Size, 66320
D (81610) http_server_netconn_serve: after netconn_recv heap Size, 66280
D (81617) http_server_netconn_serve: after request done heap Size, 64676
D (81622) http_server_netconn_serve: after netbuf_delete() heap Size, 68136
D (81625) ServerTask: WiFi On Time remaining: 21 Seconds
D (81631) ServerTask: heap Size, 68344
D (81634) http_server_netconn_serve: ENTRY heap Size, 68344
D (81641) http_server_netconn_serve: after netconn_recv heap Size, 68304
D (81649) http_server_netconn_serve: after request done heap Size, 65092
D (81658) http_server_netconn_serve: after netbuf_delete() heap Size, 70168
D (81661) ServerTask: WiFi On Time remaining: 21 Seconds
D (81665) ServerTask: heap Size, 70228
D (81673) http_server_netconn_serve: ENTRY heap Size, 70364
D (81676) http_server_netconn_serve: after netconn_recv heap Size, 70324
D (81685) http_server_netconn_serve: after request done heap Size, 67132
D (81691) http_server_netconn_serve: after netbuf_delete() heap Size, 71036
D (81697) ServerTask: WiFi On Time remaining: 21 Seconds
D (81701) ServerTask: heap Size, 71232

...

D (101664) ServerTask: WiFi On Time remaining: 1 Seconds
D (101664) ServerTask: heap Size, 69984
D (102674) ServerTask: WiFi On Time remaining: 0 Seconds
D (102674) ServerTask: heap Size, 69984
D (103684) ServerTask: heap Size, 69984
D (103686) StopWifi: Stopping WiFi
D (103686) StopWifi: heap Size, 70336
I (103727) wifi: station: e0:aa:96:da:25:7a leave, AID = 1
I (103728) wifi: n:1 0, o:1 0, ap:1 1, sta:255 255, prof:1
D (103729) tcpip_adapter: check: local, if=0 fn=0x40138b5c
D (103732) tcpip_adapter: call api in lwip: ret=0x5001, give sem
D (103739) tcpip_adapter: check: remote, if=0 fn=0x40138b5c
D (103744) event_handler: wifi event handler invoked
D (103749) event_handler: wifi event handler invoked
D (103755) tcpip_adapter: check: local, if=1 fn=0x40138b5c
D (103760) tcpip_adapter: call api in lwip: ret=0x0, give sem
D (103766) tcpip_adapter: check: remote, if=1 fn=0x40138b5c
D (103772) event_handler: wifi event handler invoked
I (104778) wifi: lmac stop hw txq
D (104779) StopWifi: esp_wifi_stop() err=0x0000
D (104780) StopWifi: esp_wifi_set_mode(WIFI_MODE_NULL) err=0x0000
D (104823) StopWifi: Wi-Fi Stopped
D (104823) StopWifi: heap Size, 72560
D (104823) ServerTask: heap Size, 72584
D (104823) ServerTask: WiFi Off Time remaining: 30 Seconds
D (113829) ServerTask: heap Size, 76556
D (113829) ServerTask: WiFi Off Time remaining: 20 Seconds
D (122829) ServerTask: heap Size, 76556
D (122829) ServerTask: WiFi Off Time remaining: 11 Seconds
D (131829) ServerTask: heap Size, 76556
D (131829) ServerTask: WiFi Off Time remaining: 2 Seconds
D (140829) StartWifi: Starting WiFi
D (140829) StartWifi: heap Size, 76556
I (140874) wifi: wifi timer task: 3ffed538, prio:22, stack:3584
D (140874) nvs: nvs_open phy 0
D (140874) nvs: nvs_get cal_version 4
D (140876) nvs: nvs_get_str_or_blob cal_mac
D (140880) nvs: nvs_get_str_or_blob cal_data
D (140885) nvs: nvs_close 4
I (140888) wifi: mode : softAP (24:0a:c4:03:44:41)
D (140892) tcpip_adapter: check: local, if=1 fn=0x40138a0c
D (140899) tcpip_adapter: dhcp server start:(ip: 192.168.130.1, mask: 255.255.255.0, gw: 192.168.130.1)
D (140906) tcpip_adapter: call api in lwip: ret=0x0, give sem
D (140912) tcpip_adapter: check: remote, if=1 fn=0x40138a0c
D (140918) event_handler: wifi event handler invoked
D (140924) StartWifi: Wi-Fi Started
D (140964) StartWifi: heap Size, 71216
D (141977) ServerTask: WiFi On Time remaining: 58 Seconds
D (141977) ServerTask: heap Size, 70868
I (142434) wifi: n:1 0, o:1 0, ap:1 1, sta:255 255, prof:1
I (142435) wifi: station: e0:aa:96:da:25:7a join, AID=1, n, 20
D (142436) event_handler: wifi event handler invoked
D (142989) ServerTask: WiFi On Time remaining: 57 Seconds
D (142989) ServerTask: heap Size, 70204
D (143999) ServerTask: WiFi On Time remaining: 56 Seconds
D (143999) ServerTask: heap Size, 70204
D (145009) ServerTask: WiFi On Time remaining: 55 Seconds
D (145009) ServerTask: heap Size, 70076

... 

D (200560) ServerTask: WiFi On Time remaining: 0 Seconds
D (200560) ServerTask: heap Size, 70076
D (201570) ServerTask: heap Size, 70076
D (201572) StopWifi: Stopping WiFi
D (201572) StopWifi: heap Size, 70424
I (201613) wifi: station: e0:aa:96:da:25:7a leave, AID = 1
I (201614) wifi: n:1 0, o:1 0, ap:1 1, sta:255 255, prof:1
D (201615) tcpip_adapter: check: local, if=0 fn=0x40138b5c
D (201619) tcpip_adapter: call api in lwip: ret=0x5001, give sem
D (201625) tcpip_adapter: check: remote, if=0 fn=0x40138b5c
D (201631) event_handler: wifi event handler invoked
D (201636) event_handler: wifi event handler invoked
D (201641) tcpip_adapter: check: local, if=1 fn=0x40138b5c
D (201647) tcpip_adapter: call api in lwip: ret=0x0, give sem
D (201652) tcpip_adapter: check: remote, if=1 fn=0x40138b5c
D (201658) event_handler: wifi event handler invoked
I (202664) wifi: lmac stop hw txq
D (202665) StopWifi: esp_wifi_stop() err=0x0000
D (202666) StopWifi: esp_wifi_set_mode(WIFI_MODE_NULL) err=0x0000
D (202711) StopWifi: Wi-Fi Stopped
D (202711) StopWifi: heap Size, 73600
D (202711) ServerTask: heap Size, 73624
D (202711) ServerTask: WiFi Off Time remaining: 30 Seconds
D (211717) ServerTask: heap Size, 78660
D (211717) ServerTask: WiFi Off Time remaining: 20 Seconds
D (220717) ServerTask: heap Size, 78660
D (220717) ServerTask: WiFi Off Time remaining: 11 Seconds
D (229717) ServerTask: heap Size, 78660
D (229717) ServerTask: WiFi Off Time remaining: 2 Seconds
D (238717) StartWifi: Starting WiFi
D (238717) StartWifi: heap Size, 78660
I (238763) wifi: wifi timer task: 3ffed520, prio:22, stack:3584
D (238763) nvs: nvs_open phy 0
D (238763) nvs: nvs_get cal_version 4
D (238765) nvs: nvs_get_str_or_blob cal_mac
D (238769) nvs: nvs_get_str_or_blob cal_data
D (238774) nvs: nvs_close 5
I (238777) wifi: mode : softAP (24:0a:c4:03:44:41)
D (238781) tcpip_adapter: check: local, if=1 fn=0x40138a0c
D (238788) tcpip_adapter: dhcp server start:(ip: 192.168.130.1, mask: 255.255.255.0, gw: 192.168.130.1)
D (238795) tcpip_adapter: call api in lwip: ret=0x0, give sem
D (238801) tcpip_adapter: check: remote, if=1 fn=0x40138a0c
D (238807) event_handler: wifi event handler invoked
D (238852) StartWifi: Wi-Fi Started
D (238852) StartWifi: heap Size, 73328
D (239866) ServerTask: WiFi On Time remaining: 58 Seconds
D (239866) ServerTask: heap Size, 72976

...

D (247946) ServerTask: WiFi On Time remaining: 50 Seconds
D (247946) ServerTask: heap Size, 72976
D (248956) ServerTask: WiFi On Time remaining: 49 Seconds
D (248956) ServerTask: heap Size, 72976
I (249539) wifi: n:1 0, o:1 0, ap:1 1, sta:255 255, prof:1
I (249540) wifi: station: e0:aa:96:da:25:7a join, AID=1, n, 20
D (249541) event_handler: wifi event handler invoked
D (249966) ServerTask: WiFi On Time remaining: 48 Seconds
D (249966) ServerTask: heap Size, 72368

...

D (257036) ServerTask: WiFi On Time remaining: 41 Seconds
D (257036) ServerTask: heap Size, 72192
D (257676) http_server_netconn_serve: ENTRY heap Size, 69928
D (257677) http_server_netconn_serve: after netconn_recv heap Size, 69888
D (257714) http_server_netconn_serve: after request done heap Size, 68292
D (257721) http_server_netconn_serve: after netbuf_delete() heap Size, 71740
D (257728) ServerTask: WiFi On Time remaining: 41 Seconds
D (257731) ServerTask: heap Size, 71960
D (257793) http_server_netconn_serve: ENTRY heap Size, 70536
D (257797) http_server_netconn_serve: after netconn_recv heap Size, 68496
D (257802) http_server_netconn_serve: after request done heap Size, 65288
D (257809) http_server_netconn_serve: after netbuf_delete() heap Size, 67628
D (257813) ServerTask: WiFi On Time remaining: 41 Seconds
D (257819) ServerTask: heap Size, 69436
D (257822) http_server_netconn_serve: ENTRY heap Size, 69436
D (257829) http_server_netconn_serve: after netconn_recv heap Size, 69396
D (257837) http_server_netconn_serve: after request done heap Size, 66196
D (257842) http_server_netconn_serve: after netbuf_delete() heap Size, 68532
D (257851) ServerTask: WiFi On Time remaining: 41 Seconds
D (257853) ServerTask: heap Size, 70332
D (257858) http_server_netconn_serve: ENTRY heap Size, 70332
D (257865) http_server_netconn_serve: after netconn_recv heap Size, 70292
D (257873) http_server_netconn_serve: after request done heap Size, 67092
D (257881) http_server_netconn_serve: after netbuf_delete() heap Size, 69568
D (257885) ServerTask: WiFi On Time remaining: 40 Seconds
D (257889) ServerTask: heap Size, 71232
D (257920) http_server_netconn_serve: ENTRY heap Size, 70124
D (257921) http_server_netconn_serve: after netconn_recv heap Size, 70084
Unknown GET request: GET /favicon.ico HTTP/1.1
D (257948) http_server_netconn_serve: after request done heap Size, 68488
D (257952) http_server_netconn_serve: after netbuf_delete() heap Size, 70820
D (257955) ServerTask: WiFi On Time remaining: 40 Seconds
D (257957) ServerTask: heap Size, 71024

...

D (298347) ServerTask: WiFi On Time remaining: 0 Seconds
D (298347) ServerTask: heap Size, 69984
D (299357) ServerTask: heap Size, 69984
D (299359) StopWifi: Stopping WiFi
D (299359) StopWifi: heap Size, 70336
I (299400) wifi: station: e0:aa:96:da:25:7a leave, AID = 1
I (299401) wifi: n:1 0, o:1 0, ap:1 1, sta:255 255, prof:1
D (299402) tcpip_adapter: check: local, if=0 fn=0x40138b5c
D (299406) tcpip_adapter: call api in lwip: ret=0x5001, give sem
D (299412) tcpip_adapter: check: remote, if=0 fn=0x40138b5c
D (299418) event_handler: wifi event handler invoked
D (299423) event_handler: wifi event handler invoked
D (299428) tcpip_adapter: check: local, if=1 fn=0x40138b5c
D (299434) tcpip_adapter: call api in lwip: ret=0x0, give sem
D (299439) tcpip_adapter: check: remote, if=1 fn=0x40138b5c
D (299445) event_handler: wifi event handler invoked
I (300451) wifi: lmac stop hw txq
D (300452) StopWifi: esp_wifi_stop() err=0x0000
D (300453) StopWifi: esp_wifi_set_mode(WIFI_MODE_NULL) err=0x0000
D (300496) StopWifi: Wi-Fi Stopped
D (300496) StopWifi: heap Size, 72560
D (300496) ServerTask: heap Size, 72584
D (300496) ServerTask: WiFi Off Time remaining: 30 Seconds
D (309502) ServerTask: heap Size, 76556

...

Who is online

Users browsing this forum: Bing [Bot] and 101 guests