-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] On-device decompression for saving time on slow wifi transfers #26216
Comments
Marlin already has meatpack and binary file transfer both of which have compressed gcode. This issue is that esp3d does not support either of these (as far as im aware) |
I never heard of meatpack.
Of course, having meatpack is better than nothing, however, just using ztds enables having even better compression with saving all the comments (e.g. mks preview images within the gcode). I thought wifi_upload should not care of the encoding as it sends the file with HTTP post (see https://github.com/Jeredian/mks-wifi-plugin/blob/17103b3f9dbbf17ba27cb255c98b15693115d25d/MKSOutputDevice.py#L514-L520), and the device stores it as a file. WDYT of adding a gcode for decompressing a file like |
Both the current systems don't create a compressed file I don't think a .z gcode files would work, marlin needs to be able to skip around the file, difficult to do while compressed. |
I mean receive compressed file, then decompress, and print decompressed file only. In other words, I do not suggest printing from a compressed file. |
Prusa has purposed bgcode https://github.com/prusa3d/libbgcode |
It is sad prusa3d/libbgcode use a mix of INI and binary encoding. It would be so much better if they went with a protobuf or a similar schema format. |
Now try to imagine how it would work. Having schema would require all fields to be supported by all slicers and all firmwares. Then, you need some kind of committee to agree on whoch options to include in schema. Good luck having all manufacturers to agree on something. Okay. Then you need some kind of extension system that makes it possible to include fields supported by manufacturers. Having schema would not bring anything to the table and would be impossible to actually use. Binary encoding? Maybe. But its only benefit is compact size and it's irrelevant for options section because it's very small compared to gcode which is compressed. And with cbor you will have keys and values encoded as strings anyway. |
Not really. In proto3 all fields are optional, so they are replaced with null or the corresponding default value depending on the schema. It does not force producers and consumers to generate or recognize "unknown" fields.
INI lacks data types.
A common extension to g-code is a blob with an image that might better be shared and declared similarly across firmwares. See prusa3d/libbgcode#28.
Sure "total filament length" is irrelevant for laser cutters, however, well, the fields are optional.
Binary encoding is easier to parse. |
It's not the point. Point is that you need to have schema supported and updated everywhere. In protobuf, fileds defined with field number, not even symbolic keywords. Even if by some miracle there will be some "default" set of fields, at some point manufacturers will need to extend format. No one will be held responsible to follow agreements on how to avoid conflicts. You'll simply end up with a mess of incompatible bgcodes where manufacturer A encodes field 34 as integer for flow control and manufacturer B encodes field 34 as text for object name or whatever. They most likely will not publish updated schemas too. To support all this bs in every firmware you need to make workarounds. OR in all slicers you will need to make additional "flavors" so produced gcodes won't fail. And one important thing is that gcode by design is not printer specific format, so any kind of printer-centric schema basically bolts down file format to be used for printers only.
In this issue I also listed why it's impractical so I won't repeat myself here too. You need to understand that bgcode is basically just a container. And you're trying to "enhance" it by limiting its ability to contain stuff.
INI isn't hard to parse by any means. There are tons of INI parses available too. It may not be the best choice. But it's good enough choice. |
You are 100% right. The numeric fields in the schema should be declared by someone. There's a lightweight option to have extra fields in the schema:
Let's imagine there was a GitHub repository
Could you please elaborate? Since schema fields are optional, the other device types can have their metadata: there might be a metadata section for laser cutters, a metadata section for CNC, and so on. I do not quite understand why you mention "limiting its ability" |
Not IF, people absolutely will do that. You're trying to imagine perfect world where everyone follows agreements and everything just works. It's not like that in the real world. |
Is your feature request related to a problem? Please describe.
I want sending a compressed gcode over wifi, and I want decompress the file before printing.
It would reduce wifi transfer times.
Are you looking for hardware support?
No response
Describe the feature you want
I need a gcode for decompressing files on board. I do not need folder management, when unzipping, and one input one output would be enough
Additional context
I use mks nano robin 3.2 board, and wifi seems to be limited to 115kbps there, however, the CPU is 178MHz. I expect zstd decompressor to work reasonably well on that board.
Having a second pass over the received gcode might help for verifying the input as well (see #26016)
The text was updated successfully, but these errors were encountered: