I'd like to create an OctoPrint plugin to upload files to the printer's sdcard via a custom protocol. It appears that the hook, "octoprint.printer.sdcardupload", is the proper mechanism, but I've two issues:
It seems that I can get access to the serial port with
printer.get_transport(), but not unfettered access to read and write. While the file is uploading, I need to "suspend" OctoPrint's normal serial processing that occurs in the "monitoring" and "sending" threads. It appears that setting flags,
Falsewill terminate the threads, not temporarily suspend them. Is there a proper way to temporarily take control of the serial connection?
Also, what is the prefered way to indicate the file's upload progress in Octoprint?
All in all, my upload plugin should be a fairly straight-forward endeavor, and I think, will work well in OctoPrint. Hopefully, an OctoPrint expert can comment and get me over these two technical hurdles. I appreciate any help or insight.