kantlivelong / OctoPrint-PSUControl

Smart control of your power supply via GPIO, GCODE Command, System Command, or variety of sub-plugins.
GNU Affero General Public License v3.0
202 stars 112 forks source link

No power-off when OctoPrint-Emc2101 is active. #250

Open lost-carrier opened 1 year ago

lost-carrier commented 1 year ago

What were you doing?

I've installed PSU Control with Tasmota Plugin which works fine.

Now I also installed OctoPrint-Emc2101 Plugin (https://github.com/JeremyLaurenson/octoprint-emc2101) to control a fan on the enclosure and also monitor enclosure temperature.

What did you expect to happen?

PSU Control turning off the PSU after idle - just as without Emc2101 plugin enabled

What happened instead?

When activating that Emc2101 PSU Control will not longer succede in turning off.

(reproduceable: Emc2101 plugin disabled -> power-off works, Emc2101 plugin enabled -> power-off does not work)

As I've found this https://github.com/kantlivelong/OctoPrint-PSUControl/issues/68 (old) bug, I guess that OctoPrint-Emc2101 is somehow providing an additional temparature, which PSU control is waiting for, but somehow fails in interpreting stuff from Emc2101. Enclosure temperature reported from EMC2101 is around 23°C, so way below the 50°C specified for PSU Control.

Version of OctoPrint-PSUControl

Operating System running OctoPrint

2022-09-18 12:28:44,963 - octoprint.environment - INFO - Detected environment is Python 3.7.3 under Linux (linux). Details:
|  hardware:
|    cores: 4
|    freq: 1200.0
|    ram: 914006016
|  os:
|    bits: 32
|    id: linux
|    platform: linux
|  plugins:
|    pi_support:
|      model: Raspberry Pi 3 Model B Rev 1.2
|      octopi_version: 0.18.0
|      octopiuptodate_build: 0.18.0-1.8.2-20220816135025
|      throttle_check_enabled: true
|      throttle_check_functional: true
|      throttle_state: '0x0'
|  python:
|    pip: 20.3.3
|    version: 3.7.3
|    virtualenv: /home/pi/oprint

Printer model & used firmware incl. version

Prusa i3 MK3S+ Firmware 3.11.0

Link to octoprint.log with octoprnt.plugins.psucontrol set to DEBUG

2022-09-18 12:29:55,189 - octoprint.plugins.psucontrol - INFO - Idle timeout reached after 1 minute(s). Turning heaters off prior to shutting off PSU.
2022-09-18 12:29:55,190 - octoprint.plugins.psucontrol - DEBUG - Heater tool0 already off.
2022-09-18 12:29:55,191 - octoprint.plugins.psucontrol - DEBUG - Heater bed already off.
2022-09-18 12:29:55,191 - octoprint.plugins.psucontrol - INFO - Turning off heater: Default
2022-09-18 12:30:00,134 - octoprint.plugins.psucontrol - DEBUG - Polling PSU state...
2022-09-18 12:30:00,416 - octoprint.plugins.psucontrol_tasmota - DEBUG - cmd=Status 0, status_code=200, text={"Status":{"Module":0,"DeviceName":"3D-Drucker","FriendlyName":["Tasmota","Tasmota2","Tasmota3","Tasmota4"],"Topic":"3d-drucker","ButtonTopic":"0","Power":6,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0},"StatusPRM":{"Baudrate":4800,"SerialConfig":"8E1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Software/System restart","Uptime":"4T16:00:08","StartupUTC":"2022-09-13T19:29:52","Sleep":50,"CfgHolder":4617,"BootCount":75,"BCResetTime":"2022-09-12T20:58:57","SaveCount":243,"SaveAddress":"F9000"},"StatusFWR":{"Version":"10.1.0(tasmota)","BuildDateTime":"2022-01-11T13:45:52","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8285","CR":"391/699"},"StatusLOG":{"SerialLog":0,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["outside-the-matrix",""],"TelePeriod":10,"Resolution":"558180C0","SetOption":["04008009","2805C80001000680003C5A0A000000000000","00000080","00006000","00004000"]},"StatusMEM":{"ProgramSize":616,"Free":384,"Heap":22,"ProgramFlashSize":1024,"FlashSize":1024,"FlashChipId":"144051","FlashFrequency":40,"FlashMode":3,"Features":["00000809","8FDAC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","00000020"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45","Sensors":"1,2,3,4,5,6"},"StatusNET":{"Hostname":"3d-drucker","IPAddress":"10.41.42.121","Gateway":"10.41.42.1","Subnetmask":"255.255.255.0","DNSServer1":"10.41.42.53","DNSServer2":"0.0.0.0","Mac":"E0:98:06:DC:37:39","Webserver":2,"HTTP_API":1,"WifiConfig":4,"WifiPower":17.0},"StatusMQT":{"MqttHost":"mqtt","MqttPort":1883,"MqttClientMask":"3d-drucker","MqttClient":"3d-drucker","MqttUser":"DVES_USER","MqttCount":486,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4},"StatusTIM":{"UTC":"2022-09-18T11:30:00","Local":"2022-09-18T11:30:00","StartDST":"2022-03-27T02:00:00","EndDST":"2022-10-30T03:00:00","Timezone":"+00:00","Sunrise":"05:31","Sunset":"17:57"},"StatusPTH":{"PowerDelta":[0,0,0],"PowerLow":0,"PowerHigh":0,"VoltageLow":0,"VoltageHigh":0,"CurrentLow":0,"CurrentHigh":0},"StatusSNS":{"Time":"2022-09-18T11:30:00","ANALOG":{"A0":1024},"ENERGY":{"TotalStartTime":"2022-09-12T20:58:57","Total":9.325,"Yesterday":2.422,"Today":0.444,"Power":58,"ApparentPower":84,"ReactivePower":61,"Factor":0.69,"Voltage":232,"Current":0.362}},"StatusSTS":{"Time":"2022-09-18T11:30:00","Uptime":"4T16:00:08","UptimeSec":403208,"Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":486,"POWER1":"OFF","POWER2":"ON","POWER3":"ON","POWER4":"OFF","Wifi":{"AP":1,"SSId":"outside-the-matrix","BSSId":"E4:8D:8C:6B:B8:65","Channel":5,"Mode":"11n","RSSI":32,"Signal":-84,"LinkCount":2,"Downtime":"0T00:00:09"}}}
2022-09-18 12:30:00,419 - octoprint.plugins.psucontrol - DEBUG - isPSUOn: True
2022-09-18 12:30:05,425 - octoprint.plugins.psucontrol - DEBUG - Polling PSU state...
...

Not entierly sure how to interpret this, but I maybe important:

Recv: T:23.2 /0.0 B:24.4 /0.0 T0:23.2 /0.0 @:0 B@:0 P:0.0 A:30.0
Recv: T:23.2 /0.0 B:23.4 /0.0 T0:23.2 /0.0 @:0 B@:0 P:0.0 A:29.9
Recv: T:23.2 /0.0 B:24.3 /0.0 T0:23.2 /0.0 @:0 B@:0 P:0.0 A:29.3
Recv: T:23.1 /0.0 B:23.7 /0.0 T0:23.1 /0.0 @:0 B@:0 P:0.0 A:29.5
Recv: T:23.3 /0.0 B:23.8 /0.0 T0:23.3 /0.0 @:0 B@:0 P:0.0 A:30.1
Recv: T:22.9 /0.0 B:23.8 /0.0 T0:22.9 /0.0 @:0 B@:0 P:0.0 A:29.1
Recv: T:22.8 /0.0 B:24.0 /0.0 T0:22.8 /0.0 @:0 B@:0 P:0.0 A:31.0
Recv: T:23.5 /0.0 B:24.0 /0.0 T0:23.5 /0.0 @:0 B@:0 P:0.0 A:30.1
Recv: T:23.6 /0.0 B:24.2 /0.0 T0:23.6 /0.0 @:0 B@:0 P:0.0 A:29.5
Recv: T:22.8 /0.0 B:24.1 /0.0 T0:22.8 /0.0 @:0 B@:0 P:0.0 A:30.2
Recv: T:23.4 /0.0 B:24.0 /0.0 T0:23.4 /0.0 @:0 B@:0 P:0.0 A:30.2

Bildschirmfoto 2022-09-18 um 13 33 49

mdeeter commented 1 year ago

I fixed mine (Octoprint 1.8.4) using my Ender 3 S1 by adding M155 to the ignore commands option in the plug in.

image

https://marlinfw.org/docs/gcode/M155.html M155 is the temperature report that spits out that date you referenced:

image

I noticed that the M155 command is kicked off in the terminal at Octoprint startup.

kantlivelong commented 1 year ago

Would need full DEBUG logs (not snippets) and serial logs. If the plugin you mention does anything to interfere with GPIO state of another pin then that might be an issue. This plugin only interfaces with the GPIO pins specified whereas some other plugins may wipe or modify the entire GPIO config across the board.

@mdeeter a single M155 won't or at least shouldn't make a difference