Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Compression lib

    Scheduled Pinned Locked Moved LoPy
    librarycompression
    5 Posts 4 Posters 1.6k Views 6 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      this.wiederkehr
      last edited by

      Is there a compression library for micropython which can do stream compression?

      This would be especially useful when transferring large amount of data over wlan. As ram is limited it would have to be a stream compression library.

      does any body know of something like this?

      I see that upstream has a lib uzlib https://docs.micropython.org/en/latest/pyboard/library/uzlib.html which supports decompression. However compression seems not supported.

      I think miniz is included in esp-idf (https://github.com/espressif/esp-idf/blob/master/components/esp32/include/rom/miniz.h )so at best there would be an interface to this mirroring the cpython api (ttps://docs.python.org/3/library/zlib.html).

      1 Reply Last reply Reply Quote 1
      • IplookyI Offline
        Iplooky
        last edited by

        @this-wiederkehr I am also interested in this. I have short test messages that are sent and the next line that contains useful (large) data is completly ignored. Did you find something useful ?

        1 Reply Last reply Reply Quote 2
        • T Offline
          this.wiederkehr
          last edited by

          No sorry. Nothing useful. However here is the upstream thread on the implementation of the uzlib:

          https://github.com/micropython/micropython/issues/741

          Not sure if there is a blocker with respect to compression ...

          1 Reply Last reply Reply Quote 1
          • C Offline
            campbellsinclair
            last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • S Offline
              Shriya dhar
              last edited by

              I am facing a challenge when attempting to decompress data compressed using the miniz library on the ESP32 platform. My objective is to compress data using miniz library in flasher_stub compoment of esp-idf and then decompress the data on the cloud side using some python script that can be compatible with miniz decompression style like zlib.

              As per the documentation and information available, the miniz library is described as a "lossless, high-performance data compression library" that implements the zlib (RFC 1950) and Deflate (RFC 1951) compressed data format specification standards. However, I am encountering difficulties when attempting to decompress the compressed data using Python.

              Specifically, when using the Python zlib module, which should be compatible with the zlib and Deflate formats, I am receiving an "unknown compression method" error. I have verified that the file and data are correct, and they were compressed using the miniz library on the ESP32. Despite this, I am unable to successfully decompress the data.

              I would greatly appreciate any help or any insights that you can provide regarding how to properly decompress data that has been compressed with the miniz library using Python.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post

              Pycom on Twitter

              Pycom