Open yanshay opened 1 month ago
While it shows some failed memory allocations the real error is MBEDTLS_ERR_X509_CERT_VERIFY_FAILED = -9984
- did you change the example to connect to a different IP? Otherwise it's most probably due to expired certificates: https://github.com/esp-rs/esp-mbedtls?tab=readme-ov-file#certificates
Thanks, I used genssl
, that still generated an allocation issue, but only 64 bytes, I increased the wifi heap size to 98000 and it worked. I received a 404 page but I guess that's ok.
Also, for the async-client I needed to specify the feature esp-hal-embassy
, you may want to consider adding that in the doc (or having it set automatically).
Also in the async version, after returning the response it prints out continuously
WARN - Unable to allocate 2308 bytes
WARN - Unable to allocate 2308 bytes
WARN - Unable to allocate 2308 bytes
WARN - Unable to allocate 2308 bytes
WARN - Unable to allocate 2308 bytes
WARN - Unable to allocate 2308 bytes
WARN - Unable to allocate 2308 bytes
WARN - Unable to allocate 2308 bytes
WARN - Unable to allocate 2308 bytes
WARN - Unable to allocate 2308 bytes
WARN - Unable to allocate 2308 bytes
WARN - Unable to allocate 2308 bytes
Seems like it's really tight on memory, does it mean that if I rely on it I will get such memory allocations issues in ESP32 depending on what exactly I'm trying to do? Or once it's working it's going to work well? I prefer not to spend a lot of time just to find out that it works only in demo apps.
Also, the memory that's exhausted is only the dram.seg2, right? (which normally isn't in use by applications). The rest of the RAM is available for my usage?
Those heap allocations depend on what is really happening and not all of that is controlled by your code but depend on the network connection etc. - if memory is already very tight that's for sure not ideal
In the case of ESP32 the WiFi ram and esp-mbedtls RAM is dram-seg2, yes. For other chips it's not separated
I tried to run the sync_client and async_client examples on ESP32, both had memory issues as below.
I tried to increase the esp_wifi heap size incrementally and tested, it always failed on memory allocation, until it couldn't compile anymore due to too large heap, reporting: section
.dram2_uninit' will not fit in region
dram2_seg'Any way to get it to work? And even if I do, does it mean no memory will be left for my app? I don't need much but would need something.
Here are the execution logs: