Skip to content
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

AutomaticShutdown does not shutdown #10

Closed
SHWotever opened this issue Feb 25, 2017 · 20 comments
Closed

AutomaticShutdown does not shutdown #10

SHWotever opened this issue Feb 25, 2017 · 20 comments
Labels

Comments

@SHWotever
Copy link

Hi ! I'm currently trying to use your plugin to shutdown my printer after the print but it seems that something is preventing it.

I tool a look at the code, it looks like Octoprint is still reporting state as printing while the printing is effectively finished :

2017-02-25 10:33:22,795 - octoprint.util.comm - INFO - Finished in 5645.460 s.
2017-02-25 10:33:22,809 - octoprint.plugins.automaticshutdown - INFO - Printer is currently printing/paused. No shutdown action will be preformed.

Octoprint v1.3.1
OctoPrint-AutomaticShutdown v0.1.3
Printer Anet A8 (Repetier firmware)

Process : start printing, check automatic shutdown, wait an infinite time, come back when print finishes, and ... nothing :)

If you need any additional info tell me !

@kantlivelong
Copy link
Collaborator

kantlivelong commented Feb 25, 2017 via email

@SHWotever
Copy link
Author

Yes I use webcam, but timelapse disabled (for now). I've tried two or tree times with real printer and with virtual printer. The result have always been the same. Ah ! I don't think that it could be related but I use the latest OctoPi.

@kantlivelong
Copy link
Collaborator

kantlivelong commented Feb 25, 2017 via email

@SHWotever
Copy link
Author

I'll check when my current print finishes, I keep you in touch ! Thank for your help.

I don't know which event is thrown when the plugin log the "Printer is currently printing/paused" message. Maybe a bit of additional log here could help ? If Octoprint trigger the "done" event but the printer is still in "printing" state, it could be a OctoPrint issue.

@kantlivelong
Copy link
Collaborator

That's what I'm guessing is happening but it seems weird that it would get PrintDone and still return True for is_printing() (Think I can safely assume that it wasn't paused)

So far I can't replicate it.

Are you running any plugins that would affect print functionality?

@SHWotever
Copy link
Author

Here the additionnal plugins : DisplayProgress , EmailNotifier, PortLister,
I'll try to uninstall them before more testing ;)

@SHWotever
Copy link
Author

I made the tests :
I uninstalled all the plugins ... still not working,
I enabled timelapse, yep you are on something, it worked !

Still don't know why with a timelapse it works but ... in wait of a fix some timelapses won't kill me :D

@gnosis953
Copy link

I also have the problem. Noting happens after print finishes.
So the solution might be to enable timelapse?

I will try that. thank you very much!

@kantlivelong
Copy link
Collaborator

I wouldn't say its a solution but definitely a good workaround for now until I can figure out why it thinks a print is still running even though it's not.

@gnosis953
Copy link

Works fine with timelapse enabled ;)

thank you for your plugin!
this solution will work for me the next time

@kantlivelong
Copy link
Collaborator

kantlivelong commented Feb 27, 2017

I've committed a potential fix to the issue-10 branch. Would you be willing to test?

How to install from branch

1.) Uninstall the plugin (don't reboot).

2.) Install the plugin via URL.( https://github.com/OctoPrint/OctoPrint-AutomaticShutdown/archive/issue-10.zip )

3.) Paste the URL into plugin manager(Example screenshot below):
image

@gnosis953
Copy link

gnosis953 commented Feb 27, 2017 via email

@gnosis953
Copy link

gnosis953 commented Feb 27, 2017 via email

@kantlivelong
Copy link
Collaborator

kantlivelong commented Feb 27, 2017

It shouldn't show the shut down timer if a job is cancelled but would if finished/failed.

@gnosis953
Copy link

gnosis953 commented Feb 27, 2017 via email

@kantlivelong
Copy link
Collaborator

Hmm not entirely sure how I can rework this. If a job is cancelled OctoPrint will send PrintCancelled along with PrintFailed. PrintFailed can also be sent when there is a comm issue. I can check if the printer is an error state to determine failure vs cancel but where it gets tricky is when doing timelapse rendering because it will still render regardless if it was successful, cancelled, or failed and the plugin needs to wait for rendering to finish before shutting down.

Would be a lot easier if events sent a job id.

Will see if I can figure something out.

@gnosis953
Copy link

gnosis953 commented Feb 27, 2017 via email

@kantlivelong
Copy link
Collaborator

Alright I've reworked the timelapse support (which hopefully also fixed when not using timelapse). Should also allow jobs to be canceled without displaying the timer.

Same URL if you'd be willing to test it out. ( https://github.com/OctoPrint/OctoPrint-AutomaticShutdown/archive/issue-10.zip )

Thanks

@gnosis953
Copy link

gnosis953 commented Mar 2, 2017 via email

@kantlivelong
Copy link
Collaborator

Awesome!

Merged into devel ff82a3d

kantlivelong added a commit that referenced this issue Mar 6, 2017
-Rework timelapse support (Fixes #10)
-Don't shutdown when a job is cancalled
kantlivelong added a commit that referenced this issue Mar 6, 2017
-Rework timelapse support (Fixes #10)
-Don't shutdown when a job is cancelled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants