Closed tobozo closed 3 years ago
Hi @tobozo,
I'm pretty confident the Assistant computes the right capacity; however, some settings can affect the result:
String
or const char*
.It's also possible that the DynamicJsonDocument
fails to allocate the memory pool.
Please check the value of JsonDocument::capacity()
to confirm that the allocation succeeded.
If the problem persists, please provide an MCVE.
Best regards, Benoit
Hello @bblanchon
Thanks for hinting at capacity(), it's returning 0 as you probably suspected.
Making the DynamicJsonDocument jsonAppBuffer(8192);
declaration global seemed to change the game as I got a memory error on the https connection instead:
[ 65150][E][ssl_client.cpp:36] _handle_error(): [start_ssl_client():253]: (-10368) X509 - Allocation of memory failed
Using http.end()
after collecting the https payload and before feeding the DynamicJsonDocument
seemed to solve my issue.
Having 55771 bytes of heap free seems enough to decode 8Kb of json, or at least it was with esp32-arduino-core 1.x.x.
My guess is arduino-core-2.0.0-rc2 has just become a huge memory sink when it comes to use TLS, and the free heap reported isn't exactly free.
I'm closing this as it's not really an ArduinoJSON issue, but feel free to ask if you need me to test this edgy case with some experimental changes.
Thanks again for your availability an patience on this marvelous project :+1:
You're welcome, @tobozo. Maybe the reported free heap is accurate, but the heap is highly fragmented... BTW, the ArduinoJson Troubleshooter could have helped you diagnose this issue.
Hey @bblanchon thanks for your great library!
I'm getting a
NoMemory
error even though I've used the assistant.String
andconst char*
Serial output:
here's my software stack: