B4R Question send BIG HTTP POST request

peacemaker

Expert
Licensed User
Longtime User
Hi, All

I have to send long map (result of the FFT) to a web-server.
It's 500 records "frequency number":magnitude float number. Minumum, actually, maybe 1000 ... 2000 records...
It's around 50....200 kB of JSON text.

I didn't try yet.

PHP POST request by default can receive up to 8 MB amount, but question is about the MCU esp32 family possibility.
And the sketch is much bigger than just FFT result array.

How better ?
 
Last edited:
Solution
Whole the day i was experimenting with POST requests by chunks.
But PHP server needs some settings of the Nginx to be the chunks parsed automatically to PHP's $_POST.

Finally - SOLVED.

hatzisn

Expert
Licensed User
Longtime User
Why don't you send with AsyncStreams the data to a B4J app and then have it post the data to your server?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Question how to be sure that MCU RAM is OK for big data amount.
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
Question how to be sure that MCU RAM is OK for big data amount.

You do not have to be sure. Use only two variables (frequency and magnitude) and each calculation you do, send it seperately (or in groups - make the two variables two small arrays), directly to B4J app. In B4J app add it in a list and when list.size = the threshold you want, make the post asyncronously (using JobDone sub and not Wait For) and clear the list.
 
Last edited:
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Whole the day i was experimenting with POST requests by chunks.
But PHP server needs some settings of the Nginx to be the chunks parsed automatically to PHP's $_POST.

Finally - SOLVED.
 
Upvote 0
Solution
Top