Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

example-1 not working in ESP32 - compression failed #277

Open
Noushadalik opened this issue Jul 19, 2023 · 8 comments
Open

example-1 not working in ESP32 - compression failed #277

Noushadalik opened this issue Jul 19, 2023 · 8 comments

Comments

@Noushadalik
Copy link

Hi,
I'm trying to run example1 with miniz version 2.0.2 for matching my esp idf component miniz version (9.1.15) but I got compression failed how to fix it?
esp idf log :
miniz.c version: 9.1.15
compress() failed!

Does anyone have any idea about the proper integration of miniz to esp32? (esp idf version 4.4.1)

@msdarici
Copy link

Could u solved? I'm encountering same problem.

@uroni
Copy link
Collaborator

uroni commented Oct 16, 2024

I think you have to use an old version from code.google.com/p/miniz to match the signature of the functions included in the ROM.

@italocjs
Copy link

italocjs commented Dec 6, 2024

Hi, did you ever find a solution?

@parraghb
Copy link

Hello all, I would also need the solution.

@italocjs
Copy link

Hello all, I would also need the solution.

i found this, will test very soon, https://github.com/nopnop2002/esp-idf-zlib.git

@italocjs
Copy link

Hello all, I would also need the solution.

i found this, will test very soon, https://github.com/nopnop2002/esp-idf-zlib.git

Just gave up, been trying for days now. absolutely NOTHING i tried has been able to compress a 32kb file. even using the exact same examples. If you ever find a solution i'd love to hear.

@parraghb
Copy link

parraghb commented Dec 14, 2024

Hello my friend,

After 2 full days of struggle I found the solution to compress files in case of ESP. I spent most of my time installing and configuring the library, but it works now. First of all, forget the miniz library and use zlib.

Try it step by step:

  • run in terminal: idf.py add-dependency zlib
  • run: idf.py build
  • check yaml file: dependencies: espressif/zlib: "*"
  • include to filesys: #include <zlib.h>
  • NEVER use this: compress(compressed_data, &compressed_size, (const Bytef *)input, input_size) != Z_OK)
  • USE this: ret = deflate(&strm, flush);
  • MANDATORY: int ret = deflateInit2(&strm, Z_BEST_COMPRESSION, Z_DEFLATED, 9, 2, Z_DEFAULT_STRATEGY);
  • NEVER use RAM!!
  • USE chunk_size.
  • USE inflate instead of decompress

If you have any questions feel free to write!
BR, Beni

@italocjs
Copy link

Hello my friend,

After 2 full days of struggle I found the solution to compress files in case of ESP. I spent most of my time installing and configuring the library, but it works now. First of all, forget the miniz library and use zlib.

Try it step by step:

  • run in terminal: idf.py add-dependency zlib
  • run: idf.py build
  • check yaml file: dependencies: espressif/zlib: "*"
  • include to filesys: #include <zlib.h>
  • NEVER use this: compress(compressed_data, &compressed_size, (const Bytef *)input, input_size) != Z_OK)
  • USE this: ret = deflate(&strm, flush);
  • MANDATORY: int ret = deflateInit2(&strm, Z_BEST_COMPRESSION, Z_DEFLATED, 9, 2, Z_DEFAULT_STRATEGY);
  • NEVER use RAM!!
  • USE chunk_size.
  • USE inflate instead of decompress

If you have any questions feel free to write! BR, Beni

Thanks very much for the response! i will try it! :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants