Page 1 of 1
How to get miniz working.
Posted: Wed May 29, 2019 9:13 pm
by mohammedahmed248
Hey guys, I am very new to the ESP32 environment, so bear with me. I am wanting to compress/decompress a file in the ESP32, and I saw that a library called miniz is included in the idf. But I am honestly completely clueless on how to use this library, as there isn't an example for it. If anyone can help guide me in the right direction , I would greatly appreciate it. Thank you for your time!
Re: How to get miniz working.
Posted: Wed Dec 11, 2019 9:13 am
by fasani
There is an example on the IDF :
https://github.com/espressif/esp-idf/bl ... st_miniz.c
Now keep in mind that #include "esp32/rom/miniz.h" includes only the low level deflate / inflate methods.
I'm sending compressed data (
led matrix video) from an
Android app and I found Brotli to be a very reliable decompressor for ESP32. Check google's library with my fork to update headers and tests for ESP32 here:
https://github.com/martinberlin/brotli
Re: How to get miniz working.
Posted: Fri Oct 02, 2020 2:13 pm
by flipatoms
I've managed to get miniz working in my project by inluding both .c and .h
Only problem is I don't have enough ram to run compress function.
Is there any plan to include a compression lib in esp-idf that will work out of the box without tweeking? (I think a lot of people will appreciate that)
We are running an IoT startup and need to send log data etc to AWS IOT. Would help a lot if we could compress log files before transfer.
Re: How to get miniz working.
Posted: Fri Oct 02, 2020 2:49 pm
by ESP_Sprite
I don't think lack of ram is a problem that is easily solvable... due to the nature of zlib-style compression, the compressor needs to keep large chunks of data in RAM to compare incoming data with, to see if it can be replaced by a backreference.
Re: How to get miniz working.
Posted: Fri Oct 02, 2020 4:46 pm
by flipatoms
I see. Though there seems to be a lot of people that got it running....
Anyone who know about other compression lib that is more lightweight?
Re: How to get miniz working.
Posted: Tue Jan 23, 2024 10:13 am
by nopnop2002
>Anyone who know about other compression lib that is more lightweight?
zlib is more lightweight.
Works with ESP32C2 with small RAM.
https://github.com/nopnop2002/esp-idf-zlib
Re: How to get miniz working.
Posted: Tue Jan 23, 2024 2:17 pm
by DrMickeyLauer
https://github.com/atomicobject/heatshrink claims to work with memory footprints of 50 bytes. I'm not sure how it compares in terms of compression size, but it's on my to-evaluate list.
Re: How to get miniz working.
Posted: Wed Jan 24, 2024 8:52 am
by ESP_Sprite
I used that a long time ago. It's pretty decent, albeit not as efficient as zlib.