• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Micropython, ESP32 & Compression

Q&A Forum › Category: ESP32 › Micropython, ESP32 & Compression
0 Vote Up Vote Down
grog asked 6 years ago

Hello!
Has anyone used any of the compression utilities in ESP32?
That would be zlib, or uzlib? If so, what issues were encountered? I’ve tried,here’s the test code:
import zlib
import binascii
buf = ‘abcdefghijklmnopqrstuvwxyz’
data = zlib.compress(buf,4)
print(‘Compressed data: ‘ + binascii.hexlify(data))
ucomp = zlib.decompress(data)
print(‘Original data: ‘ + ucomp)
But getting this message when it runs:
AttributeError: ‘module’ object has no attribute ‘compress’
Any suggestions?
Thanks!
 

Question Tags: zlib
2 Answers
0 Vote Up Vote Down
grog answered 6 years ago

Figured it out. Micropython’s version only decompresses. Weird. Like taking a long walk on a short pier.

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Thanks for letting me know your workaround. Regards,
Rui

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.