Switching off power

The posts from yesterday evening and this morning belong to your 0.8.9 zip file.

Correct. I pushed updates to the same branch, it's working now. You can reinstall with the previous url.

Good work, seem to be correct now:

Using button:

[2020-02-15 17:28:04,839] DEBUG: Using backlog commands with a delay value of 1100
[2020-02-15 17:28:04,840] DEBUG: Sending command http://192.168.178.142/cm?user=admin&password=&cmnd=backlog%20delay%201100%3BPower1%20off%3B
[2020-02-15 17:28:04,994] DEBUG: Running system command: sudo shutdown -h in 0
[2020-02-15 17:28:04,996] DEBUG: Disconnnecting from printer
[2020-02-15 17:28:05,016] DEBUG: Response: {'POWER1': 'OFF'}
[2020-02-15 17:32:42,562] DEBUG: Checking status of 192.168.178.142 index 1.
[2020-02-15 17:32:42,584] DEBUG: {'label_extended': '', 'autoConnect': False, 'ip': '192.168.178.142', 'backlog_on_delay': 0,

Using M81 192.168.178.140 1:

[2020-02-15 17:42:46,955] DEBUG: 192.168.178.142 index 1 is ON
[2020-02-15 17:43:15,063] DEBUG: Received M81 command, attempting power off of 192.168.178.142 index 1.
[2020-02-15 17:43:15,078] DEBUG: Sending gcode off
[2020-02-15 17:43:15,082] DEBUG: Sending turn off for 192.168.178.142 index 1
[2020-02-15 17:43:15,112] DEBUG: Turning off {'label_extended': '', 'autoConnect': False, 'ip': '192.168.178.142', 'backlog_on_delay': 0, 'off_color': '#FF0000', 'autoDisconnectDelay': 0, 'sysCmdOff': True, 'gcodeEnabled': True, 'backlog_off_delay': '110', 'gcodeOnDelay': 0, 'label': '', 'warnPrinting': True, 'thermal_runaway': True, 'gcodeOffDelay': 0, 'sysCmdOnDelay': 0, 'username': 'admin', 'sysRunCmdOff': 'sudo shutdown -h', 'use_backlog': True, 'autoDisconnect': True, 'sysRunCmdOn': '', 'unknown_color': '#808080', 'password': '', 'icon': 'icon-bolt', 'idx': '1', 'displayWarning': False, 'sensor_identifier': '', 'autoConnectDelay': 10, 'sysCmdOn': False, 'on_color': '#00FF00', 'currentState': 'on', 'sysCmdOffDelay': 0} 
[2020-02-15 17:43:15,123] DEBUG: Using backlog commands with a delay value of 1100
[2020-02-15 17:43:15,125] DEBUG: Sending command http://192.168.178.142/cm?user=admin&password=&cmnd=backlog%20delay%201100%3BPower1%20off%3B
[2020-02-15 17:43:15,276] DEBUG: Running system command: sudo shutdown -h in 0
[2020-02-15 17:43:15,277] DEBUG: Disconnnecting from printer
[2020-02-15 17:43:15,308] DEBUG: Response: {'POWER1': 'OFF'}
[2020-02-15 17:44:57,181] DEBUG: Checking status of 192.168.178.142 index 1.
[2020-02-15 17:44:57,185] DEBUG: {'label_extended': '', 'autoConnect': False, 'ip': '192.168.178.142', 'backlog_on_delay': 0,

The "sudo shutdown -h" command is different compared to the octoprint system menu command shutdown. The user interface is still online, even if the power is off ??? The interface reloads when the power is back. Maybe I user the wrong command string?

-h in the command just means halt everything instantly. If you use the same command as in the system menu command does it act any differently? In theory they both are doing the same thing, shutting down the pi, so not sure why the web interface wouldn't react the same unless OctoPrint wraps the shutdown with shutdown octoprint first. Glad it's working now. I just pushed an update that incorporates the automatic shutdown option, major UI tweaks in the editor window, and a couple of other tweaks.

1 Like

Ok. Updated. Now I use the 192.168.178.142 that is realy connect to the powerline of my printer (the 192.168.178.140 has identical setup and hardware, is on my desk, has no load).

  1. Test the thermal runaway, detected (see log) but no relay activity, no shutdown, no power off, waited for 8 minutes:
2020-02-16 09:19:47,534] DEBUG: 192.168.178.142 index 1 is ON
[2020-02-16 09:19:54,015] DEBUG: Max bed temp reached, shutting off plugs.
[2020-02-16 09:20:47,539] DEBUG: Checking status of 192.168.178.142 index 1.
[2020-02-16 09:20:47,542] DEBUG: {'username': 'admin', 'autoConnect': False, 'ip': '192.168.178.142', 'backlog_on_delay': 0, 'off_color': '#FF0000', 'autoDisconnectDelay': 0, 'sysCmdOff': True, 'gcodeEnabled': True, 'gcodeOnDelay': 0, 'backlog_off_delay': '110', 'label': '', 'warnPrinting': True, 'thermal_runaway': True, 'gcodeOffDelay': 0, 'sysCmdOnDelay': 0, 'label_extended': '', 'sysRunCmdOff': 'sudo shutdown -h', 'use_backlog': True, 'autoDisconnect': True, 'automaticShutdownEnabled': True, 'sysRunCmdOn': '', 'unknown_color': '#808080', 'password': '', 'icon': 'icon-bolt', 'idx': '1', 'displayWarning': False, 'sensor_identifier': '', 'autoConnectDelay': 10, 'sysCmdOn': False, 'sysCmdOffDelay': 0, 'currentState': 'on', 'on_color': '#00FF00'}
  1. Test the button and removed the "-h" from the shutdown command. Powered off with correct delay:
[2020-02-16 09:30:07,351] DEBUG: Using backlog commands with a delay value of 1100
[2020-02-16 09:30:07,352] DEBUG: Sending command http://192.168.178.142/cm?user=admin&password=&cmnd=backlog%20delay%201100%3BPower1%20off%3B
[2020-02-16 09:30:07,633] DEBUG: Running system command: sudo shutdown in 0
[2020-02-16 09:30:07,635] DEBUG: Disconnnecting from printer
\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00
[2020-02-16 09:30:31,082] DEBUG: abortTimeout: 30
[2020-02-16 09:30:31,085] DEBUG: automatic_power_off: True
[2020-02-16 09:32:00,904] DEBUG: Checking status of 192.168.178.142 index 1.
[2020-02-16 09:32:00,909] DEBUG: {'username': 'admin', 'autoConnect': False, 'ip': '192.168.178.142', 'backlog_on_delay': 0, 'off_color': '#FF0000', 'autoDisconnectDelay': '30', 'sysCmdOff': True, 'gcodeEnabled': True, 'gcodeOnDelay': 0, 'backlog_off_delay': '110', 'label': '', 'warnPrinting': True, 'thermal_runaway': True, 'gcodeOffDelay': 0, 'sysCmdOnDelay': 0, 'label_extended': '', 'sysRunCmdOff': 'sudo shutdown', 'use_backlog': True, 'autoDisconnect': True, 'automaticShutdownEnabled': True, 'sysRunCmdOn': '', 'unknown_color': '#808080', 'password': '', 'icon': 'icon-bolt', 'idx': '1', 'displayWarning': False, 'sensor_identifier': '', 'autoConnectDelay': 10, 'sysCmdOn': False, 'sysCmdOffDelay': 0, 'currentState': 'off', 'on_color': '#00FF00'}

The "-h" doesn't make a big difference. Are you really shure that the shutdown was called? I can find it in any other log (system, message,octoprint) and the tasmota log is damaged (\00\00...) as expected when poweroff the pi without shutdown.

Edit:
3) "sudo shutdown now" does the job :slight_smile:
4) poweroff after print works now as expected :+1:

2020-02-16 11:54:39,574 - octoprint.printer.standard.job - INFO - Print job done - origin: local, path: M5_M6_v6.gcode, owner: dab
2020-02-16 11:54:41,520 - octoprint.util.comm - INFO - Changing monitoring state from "Finishing" to "Operational"
2020-02-16 11:55:09,792 - octoprint.util.comm - INFO - Changing monitoring state from "Operational" to "Offline"
2020-02-16 11:55:10,175 - octoprint.server - INFO - Shutting down...
2020-02-16 11:55:10,580 - octoprint.events - INFO - Processing shutdown event, this will be our last event
2020-02-16 11:55:10,587 - octoprint.events - INFO - Event loop shut down
2020-02-16 11:55:11,611 - octoprint.server - INFO - Goodbye!

5 ) thermal runaway is detected but does not shutdown, multiple tests made.

Thanks for the great testing and detailed report, I really appreciate it. I'll look into the temperature related shutdown not working as expected.

Can you reproduce the thermal run away issue?

I just released an update that should theoretically resolve this issue for you. I didn't update the calls to the off command for thermal monitoring.

Honestly don’t understand the need to shut off the RPi. The best way to use Octopi is to run it on separate non-moderated power. Then you can use it to turn the printer off AND on. The amount of power it consumes is negligible.

4 Likes

Hello,

Sorry I don't speak English so I use a translator which is not always perfect.

I would like to know if it is possible to turn off the Sonoff basic (flash with tasmota of course), when the temperature of the nozzle reaches a low threshold? Or failing that, a timer.

Hello @Chris_SV !

You can do it with these plugins:

You need both

Man, don't leave out the Original...you only need one...

2 Likes