-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Response Code -3 in HTTPClient.POST #5674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Trying to do HTTP operations with 5KB free heap, and then doing the whole json thing, is too much. Your problem is obviously oom and fragmentation, your logs clearly show that. You're not even leaving enough for the tcp/ip buffers and packets.
Whatever else, it's not a problem with the core, but with the approach taken in your app. Closing. |
@devyte thanks for the feedback, I guess I am asking too much from my esp.
I considered an SD card, however, I've had bad experiences with sd and vibrations I so decided to avoid that headache. Might have to integrate an external ram to store my data, which I was trying to avoid. Hope this satisfies your curiosity, throw me a bone if you think of a more appropiate solution or for further discussion. Any rules of thumb for available space needed for HTTP operations? |
I may be misunderstanding your app, but off the top of my head:
SPIFFS has wear leveling, so it's ok to write repeatedly, as long as you don't write to the entire filesystem continuously (that would make wear leveling useless). If you go with an SD card, make sure it's a brand that is known to implement hw wear leveling (not all brands implement it). I believe at least SanDisk does. Most cheaper cards don't. |
I'm not really convinced on using SPIFFS for storing my data, reliability being my main concern, but I'll give it a try, seems pretty standard.
That is awesome |
I'm having trouble sending post using httpclient.
I think it might be related to free heap and fragmentation but have not been able to find any viable solutions or workarounds.
I'm using v2.5.0-beta2 and ArduinoJSON v5.13.4 (this might not be relevant).
So in the code I have arrays with a bunch of data which im trying to send to a backend. Due to the fact that the arrays are of considerable size, im splitting up posts to aprox less then 2kB (It should not be necessary but im running out of heap). I do this by calling this function several times, the code surrounding it retries several times in case of error:
Sorry for the long post, most of it is debug output...
Next is the output:
As you can see from the output, the exact same size of data succeeds only on the second try and eventually aborts due to lack of minimum free heap required for the json parser buffer.
The response of my http.post seems to arbitrarily fragment my memory unnecessarily, I'm not sure if it requires a minimum of heap to operate "normally"...
Until now I had been solving this issue by reducing the packet size, but now it just seems weird for my esp not to being able to send more than 1.5kB of data on one post, splitting it into smaller pieces would take forever to send.
Anyone has this problem? Is this a bug in HTTPClient? Am I asking too much for my esp?
General recommendations are welcome :)
Originally posted by @EdoMon93 in #1872 (comment)
The text was updated successfully, but these errors were encountered: