I'm trying to use curl to make a restful request every minute or so ( though for testing I've calling every 5 seconds). The issue I'm running into is that everything works fine until this pops up:
I (12667) wifi: pm start, type:0
Once that message hits, the calls timeout even though the wifi shows connected. The calls continue to timeout for some time and eventually a disconnect event happens:
I (98237) wifi_utils: event_handler - DISCONNECTED EVENT reason: 2 (WIFI_REASON_AUTH_EXPIRE)
Does anyone know what is going on? Is there a call that needs to be made to let the wifi know it's still being used or to avoid power-management?
If, not has anyone seen an example that calls curl more than a couple times?
How to keep Wifi from timing out / multiple Curl calls example / wifi: pm start, type:0
-
- Posts: 44
- Joined: Mon Nov 07, 2016 5:04 pm
Re: How to keep Wifi from timing out / multiple Curl calls example / wifi: pm start, type:0
I've run this example for more than 12 hours without issue...
https://github.com/loboris/ESP32_curl_example
https://github.com/loboris/ESP32_curl_example
-
- Posts: 44
- Joined: Mon Nov 07, 2016 5:04 pm
Re: How to keep Wifi from timing out / multiple Curl calls example / wifi: pm start, type:0
@loboris - thanks!
Looking through your example, there were a few things that I thought might fix it:
Looking through your example, there were a few things that I thought might fix it:
- Set WIFI_PS_NONE using: "ESP_ERROR_CHECK( esp_wifi_set_ps(WIFI_PS_NONE));".
** Unfortunately, it didn't seem to make a difference. Also, noticed that https://github.com/espressif/arduino-es ... esp_wifi.h says esp_wifi_set_ps is "not supported yet" and "Default power save type is WIFI_PS_NONE". - Your code uses pinning - "xTaskCreatePinnedToCore(&testCurl, "testCurl", 10*1024, NULL, 5, NULL, tskNO_AFFINITY);" whereas the IDF example I was following used xTaskCreate.
** Unfortunately that didn't seem to affect the results either.
Who is online
Users browsing this forum: No registered users and 74 guests