How to get miniz working.
-
mohammedahmed248
- Posts: 1
- Joined: Wed May 29, 2019 4:14 pm
How to get miniz working.
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.
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
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
epdiy collaborator | http://fasani.de Fan of Espressif MCUs and electronic design
Re: How to get miniz working.
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.
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.
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.
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?
Anyone who know about other compression lib that is more lightweight?
-
nopnop2002
- Posts: 347
- Joined: Thu Oct 03, 2019 10:52 pm
- Contact:
Re: How to get miniz working.
>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
zlib is more lightweight.
Works with ESP32C2 with small RAM.
https://github.com/nopnop2002/esp-idf-zlib
-
DrMickeyLauer
- Posts: 209
- Joined: Sun May 22, 2022 2:42 pm
Re: How to get miniz working.
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.
I used that a long time ago. It's pretty decent, albeit not as efficient as zlib.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.
There's also https://github.com/X-Ryl669/tinytinycompress which implement both a compressor and decompressor with as small as 4 bytes for required RAM (and configurable RAM for compressor, can be as low as 128 bytes). It's probably not as efficient as zlib, but it's darn fast and doesn't have any impact on the other code so it can be dropped in easily.
Who is online
Users browsing this forum: Bing [Bot], ChatGPT-User, Qwantbot and 7 guests
