I'm working on making a binary encoded g-code format that should reduce file sizes significantly for SD card uploads, but it requires a custom serial format that's not covered in standard Marlin. I've already implemented the protocol on the firmware side, as well as python utility for encoding the format, but for it to be useful I need to write a plugin for octoprint to run the encode script, as well as method for grabbing the octoprint serial stream and sending binary data out. As far as I can tell most plugins can enqueue standard g-code which obviously won't be handled correctly with raw binary data.
It seems the strategy used for the firmware upload plugins is to connect to a serial port directly through a third party utility, but I think this is kind of a bad experience for uploading a file since it requires triggering a disconnect/reconnect and synchronizing printer state externally.
The behavior I'd like to implement is something like this:
-user clicks a new binary upload button and selects a g-code file
-plugin calls an encoding script that makes a new .binGcode file
-plugin takes exclusive use of the open serial port, disabling timers for background communication like temperature queries and keep-alives
-plugin streams the binary encoded file through a custom protocol
-plugin releases serial port and returns things to normal operation