Pymakr Atom release v1.4.9 - Upload using zlib compression



  • Pymakr for Atom v1.4.9 has just been released with an experimental feature that might be interesting to some.

    When updated to firmware >=1.20.0 and enabled 'fast upload' , pymakr will use bigger chunks and use zlib compression to speed up the upload process. Larger files will upload drastically faster. An 800kb file used to take about 5 minutes, which is now down to a little under 90 seconds.

    The same feature is almost ready in the VSCode plugin and will be released later this week.



  • @protean Pymakr is indeed using the zlib.decompress() micropython function for this feature. Normal upload also still works of course, but this way is faster for large files. Let me give you some pointers on how to code it:
    The zlib function on the micropython side is documented here. Pymakr is compressing the files before uploading (here using this python file), writing the compressed file to the board with os.write() like always, and then decompressing them right after that (here). It'll definitely make uploading bigger files faster. Just realise that for files under 4k, it's actually slower because the overhead of compressing/decompressing is bigger than the savings of compressing the file.



  • Is there any documentation of this stuff on a lower level? Let's say I want to use a tertiary serial device (for example, a modem) to push OOB device updates, without using Atom or VSCode. Is reversing the Pymakr plugin my only route to ensure compression support? I've been pushing OOB firmware updates with simple os.write() calls and such manually on the REPL, is it safe to assume y'all are just inlining zlib.compress/decompress w/ some intermediary string encoding of some kind?



  • @marcozennaro No worries, glad it works fine :)


  • Pycom Ambassadors

    It works fine! Sorry!



  • HI @marcozennaro, Atom v1.27.2 is a bit outdated (latest is v1.34.0). Please update to one of the latest versions and try again.


  • Pycom Ambassadors

    Hi! I just updated to the latest version of the plugin (1.4.9) and I now get an error:

    Failed to load the pymakr package
    Could not locate the bindings file. Tried:
    ā†’ /Users/marco/.atom/packages/pymakr/node_modules/serialport/build/serialport.node

    I am running Atom 1.27.2 on Mac OSX.

    Suggestions?

    Thanks,
    Marco


Log in to reply
 

Pycom on Twitter