Notifications
Clear all

OctoPrint and Safety Timer  

  RSS
Tango
(@tango)
Reputable Member
OctoPrint and Safety Timer

My printers are in my workshop, in my barn. I do a lot of my design work in my study, in my house. I'm often finishing my work late at night, in my study, and send the file down to my printer and have it print. With most test prints, that means that by the time I wake up, the print is done and I can go down to the barn and check out the test prints. Most of my filament is stored to deal with humidity, but I do keep a spool or two for test prints. Sometimes I take off the dry filament and put on the test filament before I leave the shop. That way, when I finish something late at night, I can print out a test.

Normally I don't have a problem with swapping filaments like this, but every once in a while I forget I removed and autoloaded filament, so the heat safety timer is triggered. Once that happens, OctoPrint does not get any notification, at least that shows up in Printer Notifications. This happened last night and my test print was going to take about 6 1/2 hours, so I did not want to wait until the next day to print. It's a real pain, especially if you're just about to go to bed, to have to put on clothes, walk through below-freezing temperatures to a barn 500' away, just to reset the printer! (Yes, I know, it's a first world problem - things could be much worse.)

I've seen this situation come up on the OctoPrint boards, without a resolution. The discussion just kind of petered out with no answers.

Is there something I can do, through OctoPrint to deal with this? Maybe a way to reboot the printer or some other signal I can send to my MK3S+ to get it to get out of the "waiting for dial to be pressed" mode?

Best Answer by Neophyl:

I don't use octoprint or a pi but disconnecting the USB and reconnecting it at the printer causes a firmware reset.  I should imagine if you reboot the pi then it will possibly also cause a printer reset as the usb on the pi goes off/on.  If that isn't viable then doesn't octo have plug in that can activate outputs on the pi ?  Should it should be possible to control a mains socket that could reset the printer or something wired to the printers reset button to do a remote reset.

Posted : 21/01/2023 7:36 pm
Neophyl
(@neophyl)
Illustrious Member
RE: OctoPrint and Safety Timer

I don't use octoprint or a pi but disconnecting the USB and reconnecting it at the printer causes a firmware reset.  I should imagine if you reboot the pi then it will possibly also cause a printer reset as the usb on the pi goes off/on.  If that isn't viable then doesn't octo have plug in that can activate outputs on the pi ?  Should it should be possible to control a mains socket that could reset the printer or something wired to the printers reset button to do a remote reset.

Posted : 21/01/2023 10:35 pm
Tango
(@tango)
Reputable Member
Topic starter answered:
RE: OctoPrint and Safety Timer

I should imagine if you reboot the pi then it will possibly also cause a printer reset as the usb on the pi goes off/on. 

This is an example of how I can get tunnel vision. I was so focused on the printer, it didn't occur to me that maybe rebooting OctoPrint might generate a reset. I just sent a 4 hour print job to my printer that's already started printing, so maybe in the next 5-6 hours, I'll get to test that idea. I'll report what I find.

If that isn't viable then doesn't octo have plug in that can activate outputs on the pi ? 

I don't know. I have it hooked up via a USB cable. This Pi controls 2 printers and 2 cameras (currently 3 cameras until I get the other setup so it can replace an active one). I've thought about hooking up the Pi in the way Prusa provides, but I haven't had time to look into it. But it might be that I can run a cable from the GPIO port and have only ground and a signal wire that could reset a Prusa. I'll have to check on that if a simple OctoPrint reset or reboot doesn't do it. (I'm betting the reboot does it and the reset doesn't. But, hey, I'm still an ignorant and eager amateur, so what do I know?)

Posted : 21/01/2023 11:29 pm
Tango
(@tango)
Reputable Member
Topic starter answered:
RE: OctoPrint and Safety Timer

I did NOT expect to be replying so quickly, but got lucky in terms of timing. I had a bad print (due to my rushing something in Blender and not realizing things weren't aligned, so it wasn't a printer issue). I needed to run out some filament to make sure the nozzle didn't clog up during that problematical print. I did that and forgot to turn off the preheat, so the timer kicked in and shut it off. I was fixing the object in Blender and sent it from PrusaSlicer to OctoPrint - but the temperature wasn't going up on the printer. I checked and it had timed out. I went on and rebooted OctoPrint and it reset my Prusa. So that worked.

I have two instances of OctoPrint running on the Pi, so I can't do a reboot if it's controlling a print on the other printer. I don't know if I can just restart one instance of OctoPrint without it disturbing the other instance. I'll have to check that out to see if restarting will reset the Prusa and if I can do it without disturbing the other OctoPrint instance.

If I pick a comment as the solution, will this forum still allow more posts on the thread? I feel like I have an answer, but more information from testing will help.

Posted : 21/01/2023 11:36 pm
Neophyl
(@neophyl)
Illustrious Member
RE:

Yeah the thread is still open even if you mark something as an answer.

Didn't realise you were controlling multiple printers though.  That's going to limit the reset the pi hack 🙂   While I'm not familiar with octo I do have some knowledge of embedded electronics and I doubt the USB will be reset unless you actually reset the entire pi rather than an application instance.  Then again there may be a command in the pi OS that allows for resetting of specific hardware ports so maybe it still possible using a terminal (that's a big maybe though). 

I'm pretty sure I've seen mention of Octoprint being used to control power strips that are network connected.  That way you could just reset the power to a specific printer and wouldn't have to reset the pi or your octoprint session.  If not via Octo I know I have a couple of meross brand sockets that sit on my home network that I can control from my phone.  I bet with a bit of research you can find a bunch of alternative options.

Posted : 21/01/2023 11:51 pm
Tango
(@tango)
Reputable Member
Topic starter answered:
RE: OctoPrint and Safety Timer

I had time to do some testing and started with "least destructive" actions. I just clicked the "Disconnect" and then "Connect." It reset the connection with the printer. My printer is far enough that I can't see the LCD screen from my computer. By the time I read the display on the web page and got to the printer, it looked like it might have rebooted, but I can't be sure. I did see the main info screen. So whether or not it reset or restarted the printer, it did reset the connection so I could regain control over the printer. That's my main goal. (So no more putting on warm clothes at 3 AM to walk 500' through the woods in 29°F temps to reset my printer so it can finish test prints before I get up the next morning!)

Posted : 22/01/2023 4:43 am
JimB
 JimB
(@jimb)
Estimable Member
RE: OctoPrint and Safety Timer

You could also consider power relay that could be controlled via the GPIO pins on Pi.  Something like https://www.sparkfun.com/products/14236

Another alternative is if you happen to already have any home (barn) automation in place (like zigbee, z-wave).  You could use that to control the power to the printer.  I am using a plugin with Octoprint to control the power to the printer: when I send a print, it powers on automatically, and then powers off about 30 minutes after completion.

Posted : 22/01/2023 12:43 pm
Share: