- <Bunch of bootloader stuff>
- I (0) cpu_start: Starting scheduler on APP CPU.
- I (654) wifi:wifi driver task: 3ffc2240, prio:23, stack:6656, core=0
- I (654) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
- I (654) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
- I (684) wifi:wifi firmware version: aa5336b
- I (684) wifi:config NVS flash: enabled
- I (684) wifi:config nano formating: disabled
- I (684) wifi:Init dynamic tx buffer num: 32
- I (684) wifi:Init data frame dynamic rx buffer num: 32
- I (694) wifi:Init management frame dynamic rx buffer num: 32
- I (694) wifi:Init management short buffer num: 32
- I (704) wifi:Init static rx buffer size: 1600
- I (704) wifi:Init static rx buffer num: 10
- I (714) wifi:Init dynamic rx buffer num: 32
- I (714) example_connect: Connecting to FBI Surveillance Van...
- I (814) phy: phy_version: 4180, cb3948e, Sep 12 2019, 16:39:13, 0, 0
- I (824) wifi:mode : sta (8c:aa:b5:85:55:1c)
- I (944) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1
- I (1924) wifi:state: init -> auth (b0)
- I (1924) wifi:state: auth -> init (8a0)
- I (1924) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1
- I (1924) example_connect: Wi-Fi disconnected, trying to reconnect...
- I (3984) example_connect: Wi-Fi disconnected, trying to reconnect...
- I (4104) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1
- I (4104) wifi:state: init -> auth (b0)
- I (4114) wifi:state: auth -> assoc (0)
- I (4114) wifi:state: assoc -> run (10)
- I (4154) wifi:connected with FBI Surveillance Van, aid = 1, channel 1, BW20, bssid = ec:aa:a0:33:df:b8
- I (4154) wifi:security: WPA2-PSK, phy: bgn, rssi: -43
- I (4154) wifi:pm start, type: 1
- I (4204) wifi:AP's beacon interval = 102400 us, DTIM period = 1
- I (5144) tcpip_adapter: sta ip: 10.0.0.63, mask: 255.255.255.0, gw: 10.0.0.1
- I (5644) example_connect: Connected to FBI Surveillance Van
- I (5644) example_connect: IPv4 address: 10.0.0.63
- I (5644) example_connect: IPv6 address: fe80:0000:0000:0000:8eaa:b5ff:fe85:551c
- I (5654) HTTP_CLIENT: Connected to AP, begin http example
- The main task stack margin is: 7888 // Look Here
- Priority of main task is 5
- I (5954) HTTP_CLIENT: HTTP GET Status = 200, content_length = 270
- I (6564) HTTP_CLIENT: HTTP POST Status = 200, content_length = 444
- I (6564) HTTP_CLIENT: HTTP_EVENT_DISCONNECTED
- The main task stack margin is: 6320 // Look Here
- Priority of main task is 5
- I (6874) HTTP_CLIENT: HTTP GET Status = 200, content_length = 270
- I (7384) HTTP_CLIENT: HTTP POST Status = 200, content_length = 444
- I (7654) HTTP_CLIENT: HTTP PUT Status = 200, content_length = 443
- I (7804) HTTP_CLIENT: HTTP PATCH Status = 200, content_length = 335
- I (7914) HTTP_CLIENT: HTTP DELETE Status = 200, content_length = 336
- I (8104) HTTP_CLIENT: HTTP HEAD Status = 200, content_length = 270
- I (8104) HTTP_CLIENT: HTTP_EVENT_DISCONNECTED
- E (8204) esp-tls: couldn't get hostname for :not.existent.url:
- E (8204) esp-tls: Failed to open new connection
- E (8204) TRANS_SSL: Failed to open a new connection
- E (8214) HTTP_CLIENT: Connection failed, sock < 0
- E (8214) HTTP_CLIENT: Error perform http request ERROR
- I (8224) HTTP_CLIENT: HTTP_EVENT_DISCONNECTED
- I (8224) HTTP_CLIENT: Last esp error code: 0x8001
- I (8234) HTTP_CLIENT: Last mbedtls failure: 0x0
- The main task stack margin is: 6096 // Look Here
- Priority of main task is 5
- I (8244) HTTP_CLIENT: Finish http example
- static void http_test_task(void *pvParameters)
- {
- UBaseType_t StackMargin = uxTaskGetStackHighWaterMark(NULL);
- UBaseType_t MainPriority = uxTaskPriorityGet(NULL);
- printf("The main task stack margin is: %d\r\n", StackMargin);
- printf("Priority of main task is %d\r\n", MainPriority);
- http_rest_with_url();
- StackMargin = uxTaskGetStackHighWaterMark(NULL);
- MainPriority = uxTaskPriorityGet(NULL);
- printf("The main task stack margin is: %d\r\n", StackMargin);
- printf("Priority of main task is %d\r\n", MainPriority);
- http_rest_with_hostname_path();
- // http_auth_basic();
- // http_auth_basic_redirect();
- // http_auth_digest();
- // http_relative_redirect();
- // http_absolute_redirect();
- // https_with_url();
- // https_with_hostname_path();
- // http_redirect_to_https();
- // http_download_chunk();
- // http_perform_as_stream_reader();
- // https_async();
- https_with_invalid_url();
- StackMargin = uxTaskGetStackHighWaterMark(NULL);
- MainPriority = uxTaskPriorityGet(NULL);
- printf("The main task stack margin is: %d\r\n", StackMargin);
- printf("Priority of main task is %d\r\n", MainPriority);
- ESP_LOGI(TAG, "Finish http example");
- vTaskDelete(NULL);
- }
The problem is that all of this eats stack even though the active routines have calls to esp_http_client_cleanup(), which is advertised to return all resources involved in the network transactions.
What am I missing here? And can anyone point me to some code that executes a clean HTTP POST through a WiFi connection that does not eat stack, or a some resource that explains how to properly do the seemingly simple thing I want to do? My application needs to wait until a condition worth POSTing to a network server arises, which might have a period of anywhere between a few minutes to 24 hours. When testing with minimum report periods, I get stack overflows, and that's not good.
Forgive my naivete, but everyone has to start somewhere.