How much power does gzip save on IoT web access?
9 points by oliverpool
9 points by oliverpool
It would also be interesting to know if other compression algorithms yield better results (zstd or brotli for instance)
It might be a bit of a stretch implementing these for a single core ESP32-S2 microcontroller with limited RAM
In the past I would have used the getString() method to get the payload into a String object with a single call. I recently found that this method fails to return the entire payload when it’s past a certain size. It doesn’t return any error, just less data than you’re expecting. I switched to using the stream and adding a pause to wait for more data to arrive instead of giving up when available() returns 0
Wow. Either Arduino is even worse than I thought, or the OP doesn’t understand how to use the HTTP API. The code shown — a spin-loop that stops after an arbitrary 4 seconds — is awful.
ESP’s IDF library isn’t at all elegant, but at least it has APIs you can build reliable software on.
Arduino is not that bad. In this case, I think the author is using the HTTPClient
from Espressif anyway. That weird 4 second loop is not necessary.