-
Notifications
You must be signed in to change notification settings - Fork 20
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
Refresh USB-OTG g_mass_storage after file upload/delete #20
Comments
It would probably help to share my printer model and software version, to help snapshot this issue. I think some resin printers do refreshes the USB Drive contents automatically. Printer Model: Anycubic Photon Mono X |
I've found that OctoPrint has an Event Manager section in the settings. I am currently leveraging this to run a It appears the have some decent events to trigger on, like: Based on debug logging, it appears I am currently using the following command to refresh the USB Drive contents: Currently, the debug shows that sleep commands are removed. I will have to play around with getting some delay introduced. Right now, |
I don't do this in the plugin because its generally bad practice to run sudo commands within a python application. |
Fair point, I’ve been looking to see if there are projects to do this “as a user”. There appears to be python-FunctionFS project that might be able to do this. The hardest part is figuring out when to “unplug/plug” for a refresh. I wouldn't want to do this during a print. So knowing whether a print is in progress would be helpful to block the “unplug/plug” function. I want to say there is a way to block “uploads” during a print. I’m not in a good place to check this right now. |
Could support be added to refresh the USB-OTG "piusb.bin" file after certain events?
I'm wondering if there are hooks in Octoprint that could run system commands after events occur?
Step 10 of this article shares steps to "unplug/Plug" the media, so the printer can pickup the new files:
https://magpi.raspberrypi.com/articles/pi-zero-w-smart-usb-flash-drive
Essentially the steps are:
sudo modprobe g_mass_storage file=/piusb.bin stall=0 ro=1
sudo modprobe -r g_mass_storage
It would be nice to have some blocking in place, if a file is being printed.
Exposing some configuration settings, so this could be disabled if it cause issues, could be helpful.
But i'm also not sure what happens to a resin printer when the drive is pulled during a print. Does it pause? Does it cancel?
I might have to try this and see...
The text was updated successfully, but these errors were encountered: