Need help to compress files into ESP32

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Need help to compress files into ESP32

Postby Ritesh » Mon Feb 12, 2018 6:19 pm

Hi,

We are working on ESP32 Modules and SDK for our product development.

Right now, We are using Loboris SPIFFS component to create directory and files for our project requirement.

We have one requirement in which we need to compress files as well folders into single file and push it to cloud or local server as per requirement.

So, does ESP32 supports any inbuilt library or application to compress files and folders into single file? If not then would anyone suggest me to do it in beat feasible way.

In short, we need file and folder compression support for ESP32.

Let me know if need anything else or required more information for our requirements.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need help to compress files into ESP32

Postby Ritesh » Tue Feb 13, 2018 3:47 am

Hi Loboris or Espressif System Developers,

Do you have any update or information regarding this feature? is it possible to do into ESP32 SDK through external component?

Please suggest me best feasible option or solution for that.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need help to compress files into ESP32

Postby Ritesh » Wed Feb 14, 2018 6:45 pm

Hi Loboris or Espressif Developer,

Is there any update regarding this?
Regards,
Ritesh Prajapati

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: Need help to compress files into ESP32

Postby loboris » Wed Feb 14, 2018 8:00 pm

As far as I know, there is no folder compression support or library for ESP32.

You could use zlib library to compress the files.
Here is the link to the zlib component I'm using with only the files needed.

There is no function in it to compress the directory, you will need to create your own function to commpress the individual files and the directory info and put them in the final file, same for the decompression.

There is a third party library contrib/minizip in zlib repository which may help with that.

You can also try to port libarchive to ESP32. It contains everything you need, but I haven't try to compile it.

Probably it would be easier to just recursively download all the needed files from the remote server.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need help to compress files into ESP32

Postby Ritesh » Thu Feb 15, 2018 4:08 pm

loboris wrote:As far as I know, there is no folder compression support or library for ESP32.

You could use zlib library to compress the files.
Here is the link to the zlib component I'm using with only the files needed.

There is no function in it to compress the directory, you will need to create your own function to commpress the individual files and the directory info and put them in the final file, same for the decompression.

There is a third party library contrib/minizip in zlib repository which may help with that.

You can also try to port libarchive to ESP32. It contains everything you need, but I haven't try to compile it.

Probably it would be easier to just recursively download all the needed files from the remote server.
Hi Loboris,

Thanks for quick response.

Our requirement is to have few files into few folders which need to compress all together into single zip file and send it to cloud if have external connectivity.

It will be good if you had developed this type of example before using ESP32. So, provide it if you have that type of example
Regards,
Ritesh Prajapati

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Need help to compress files into ESP32

Postby snahmad75 » Tue Jun 19, 2018 1:05 pm

Hi,
Have any one manage to uncompress zip in esp32 and extract to folder.
Kindly share your experience.

Thanks,
Naeem

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Need help to compress files into ESP32

Postby snahmad75 » Wed Jun 20, 2018 8:36 am

The third party library contrib/minizip does not build for esp32.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Need help to compress files into ESP32

Postby snahmad75 » Fri Jun 14, 2019 3:04 pm

I managed to compile/build zlib with minizip.

It works to unzip file.

howver zipper is not working.

I tried this example

http://www.vilipetek.com/2013/11/22/zip ... iles-in-c/

It is not working for me on Windows 10 as well.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need help to compress files into ESP32

Postby Ritesh » Sun Jun 16, 2019 10:49 am

Sorry, we hadn't did any work for that as our client dropped that requirement due to uncertainty of component present into ESP32 IDF at that time.

So, it will be good if you can continue and provide proper solution which might be helpful for others as well.

Let me know if you need any help regarding that or need any further support for that
Regards,
Ritesh Prajapati

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Need help to compress files into ESP32

Postby snahmad75 » Mon Jun 17, 2019 4:28 pm

I tried

https://stackoverflow.com/questions/113 ... ip-on-zlib.

It works on windows platform.

zipOpen just hangs on esp32 platform.

Unzip using zlib and minzip is working for me to Esp32 platform.

Any idea?

Who is online

Users browsing this forum: abbas1375, Google [Bot] and 80 guests