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

PSU Control no longer works in 1.3.11rc2 #3112

Closed
burgedm opened this issue Apr 7, 2019 · 15 comments
Closed

PSU Control no longer works in 1.3.11rc2 #3112

burgedm opened this issue Apr 7, 2019 · 15 comments
Labels
bug Issue describes a bug not octoprint Issue is not on OctoPrint's end triage This issue needs triage

Comments

@burgedm
Copy link

burgedm commented Apr 7, 2019

PSU Control was working perfectly fine with 1.3.10 but when I upgraded to 1.3.11rc1 and then rc2 it no longer automatically turns off my printer.

The log file has an entry "Idle timeout reached after 5 minute(s). Turning heaters off prior to shutting off PSU" but it does not actually turn off the printer.

Nothing else is logged in the octopi logs or in the OS logs.

I'll reiterate that things were working perfectly fine until the upgrade - that's all that has changed.

@GitIssueBot
Copy link

Hi @burgedm,

It looks like there is some information missing from your bug report that will be needed in order to solve the problem. Read the Contribution Guidelines which will provide you with a template to fill out here so that your bug report is ready to be investigated (I promise I'll go away then too!).

If you did not intend to report a bug but wanted to request a feature or brain storm about some kind of development, please take special note of the title format to use as described in the Contribution Guidelines.

Please do not abuse the bug tracker as a support forum - that can be found at discourse.octoprint.org. Go there for any kind of issues with network connectivity, webcam functionality, printer detection or any other kind of such support requests or general questions.

Also make sure you are at the right place - this is the bug tracker of the official version of OctoPrint, not the Raspberry Pi image OctoPi nor any unbundled third party OctoPrint plugins or unofficial versions. Make sure too that you have read through the Frequently Asked Questions and searched the existing tickets for your problem - try multiple search terms please.

I'm marking this one now as needing some more information. Please understand that if you do not provide that information within the next two weeks (until 2019-04-21 21:40 UTC) I'll close this ticket so it doesn't clutter the bug tracker. This is nothing personal, so please just be considerate and help the maintainers solve this problem quickly by following the guidelines linked above. Remember, the less time the devs have to spend running after information on tickets, the more time they have to actually solve problems and add awesome new features. Thank you!

Best regards,
~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being, so don't expect any replies from me :) Your ticket is read by humans too, I'm just not one of them.

@GitIssueBot GitIssueBot added the incomplete Issue template has not been fully filled out, no further processing until fixed label Apr 7, 2019
@tedder
Copy link
Contributor

tedder commented Apr 7, 2019

Please share your octoprint.log, from startup (plugin loading) through where you trigger the PSU control. You might need to increase your log level if you believe there's truly nothing in there.

@burgedm
Copy link
Author

burgedm commented Apr 8, 2019 via email

@foosel
Copy link
Member

foosel commented Apr 8, 2019

I need all the data requested in the ticket template, otherwise I can't look into this. Also pinging @kantlivelong who's the author of the affected plugin.

@burgedm
Copy link
Author

burgedm commented Apr 8, 2019

Here's the log file, at 2019-04-09 00:45:50,849 the PSU is commanded ON, it's currently configured to turn OFF after two minutes of inactivity.

octoprint.log

@tedder
Copy link
Contributor

tedder commented Apr 9, 2019

So PSU Control is turning it on properly. That works- as confirmed by the serial connection 5 seconds later. And after a few seconds we can see the polling:

2019-04-09 00:46:11,599 - octoprint.plugins.psucontrol - DEBUG - Sensing system command executed. PID=22587, Command=/home/pi/.octoprint/scripts/power-toggle.sh
2019-04-09 00:46:11,701 - octoprint.plugins.psucontrol - DEBUG - Sensing system command returned: 0
2019-04-09 00:46:11,702 - octoprint.plugins.psucontrol - DEBUG - isPSUOn: True
2019-04-09 00:46:16,738 - octoprint.plugins.psucontrol - DEBUG - Sensing system command executed. PID=22591, Command=/home/pi/.octoprint/scripts/power-toggle.sh

I think it goes to the plugin author at this point.

@kantlivelong
Copy link
Contributor

Hmm, will have a look. Trying to get my test env up but having issues.

@foosel
Copy link
Member

foosel commented Apr 9, 2019

@kantlivelong I think it might be this sentry issue. What I don't understand is why that didn't happen earlier because the target could always be None as far as I know.

edit to add more details:

image

Looks like the offending heater is chamber, which is newly introduced in 1.3.11. I'll take a look into why it appears to be initialized differently from the tool and bed heaters after all.

@foosel
Copy link
Member

foosel commented Apr 9, 2019

Dug a bit deeper and you have the same issue with printers that do not report a bed temperature. target (and actual) can and will stay None in these cases.

A simple None check of both actual and target here would make sense and solve it.

I'm a bit reluctant to modify OctoPrint here to default to 0 instead of None because a) that will change OctoPrint's behaviour compared to prior versions and b) it will no longer allow to distinguish between "value reported by firmware" and "no value reported by firmware".

foosel added a commit to foosel/OctoPrint-PSUControl that referenced this issue Apr 9, 2019
actual and target may be None if the firmware doesn't know a heater.
So far the plugin didn't honor these situations, leading to issue with
automatic shutoff e.g. in case of a printer without a heated bed or
in the future without a heated chamber report in the response to M105.

This patch makes things a bit more resilient.

See OctoPrint/OctoPrint#3112
foosel added a commit to foosel/OctoPrint-PSUControl that referenced this issue Apr 9, 2019
actual and target may be None if the firmware doesn't know a heater.
So far the plugin didn't honor these situations, leading to issue with
automatic shutoff e.g. in case of a printer without a heated bed or
in the future without a heated chamber report in the response to M105.

This patch makes things a bit more resilient.

See OctoPrint/OctoPrint#3112
foosel added a commit to foosel/OctoPrint-PSUControl that referenced this issue Apr 9, 2019
actual and target may be None if the firmware doesn't know a heater.
So far the plugin didn't honor these situations, leading to issue with
automatic shutoff e.g. in case of a printer without a heated bed or
in the future without a heated chamber report in the response to M105.

This patch makes things a bit more resilient.

See OctoPrint/OctoPrint#3112
@foosel foosel added not octoprint Issue is not on OctoPrint's end triage This issue needs triage and removed incomplete Issue template has not been fully filled out, no further processing until fixed labels Apr 9, 2019
@kantlivelong
Copy link
Contributor

Thanks @foosel !

Tested out good here. Merged and released 0.1.8.

@foosel
Copy link
Member

foosel commented Apr 10, 2019

Perfect, closing this then.

@foosel foosel closed this as completed Apr 10, 2019
@burgedm
Copy link
Author

burgedm commented Apr 10, 2019

Uh guys ...

The firmware is reporting the temperatures just fine.
It displays on the "Temperature Pane" gives me a proper graph, it displays in the NavBar plugin, it displays on the video stream from my camera when I'm in full screen and as I reported at the beginning ... it works fine with the previous version of Octopi (1.3.10).

@foosel
Copy link
Member

foosel commented Apr 10, 2019

1.3.11 introduces parsing of chamber temperatures. The temperature data handed from OctoPrint to plugins thus contains an entry for a chamber heater. If your firmware doesn't report chamber data said data will be None though. And that is what the PSU Control's heater routine could not handle, neither for bed nor for chamber entries.

So unless you are telling me that you have a heated chamber configured in your firmware and thus data for T, B and C in your M105 outputs - this is the bug.

Of course, if you had fully filled out a ticket template as instructed in several places and even provided with during creation of a ticket, you'd also have shared a serial.log and we could have more easily verified this. As things are now we have to rely on reading code and running assumptions based on that, and your report combined with what's in the code and what's changed in 1.3.11 heavily points at the missing handling of None entries in the temperature data in the PSU Control plugin's auto shutdown code to be the culprit.

Please update the plugin and test. If it's still broken we can reevaluate this.

PS: I'm not a guy.

@burgedm
Copy link
Author

burgedm commented Apr 10, 2019

Now you're just being an ass so ... I'm done.

@kantlivelong
Copy link
Contributor

Perfect! If there's an issue be sure to open it up in the appropriate repo and fill out all required info.

@kantlivelong kantlivelong reopened this Apr 10, 2019
chriswal pushed a commit to chriswal/OctoPrint-PSUControl that referenced this issue Aug 5, 2019
actual and target may be None if the firmware doesn't know a heater.
So far the plugin didn't honor these situations, leading to issue with
automatic shutoff e.g. in case of a printer without a heated bed or
in the future without a heated chamber report in the response to M105.

This patch makes things a bit more resilient.

See OctoPrint/OctoPrint#3112
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2020
@foosel foosel added the bug Issue describes a bug label Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue describes a bug not octoprint Issue is not on OctoPrint's end triage This issue needs triage
Projects
None yet
Development

No branches or pull requests

5 participants