TP-Link power adaptors only trigger first instance) IE I have 2 power adaptors

What is the problem?

I have two TP-Link ac adaptors that work with the Plugin (KP105)

One powers LEDs, the second the PRINTER.

When a print finishes, The call to turn off the LEDs works, but the 2nd call to turn off printer does not.

My GCODEfor the Before Print Job starts is

;M80 ; Printer. 
;Catch 22, can't connect to a printer if the printer isn't already on..If anyone knows a way around this it ;would be swell
M80 ; turn on LEDs

After print job completes

M81; turn off LEDs
M81; turn off PRINTER

My slicer Ending script

G91 ; sets to relative (where head is)
G1 F1800 E-3
G1 F3000 Z10
G90 ; sets to absolute
G28 X0; home x
M106 S0 ; turn off cooling fan
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
G1 Y300 F3600 ; move Y forward
M109 R45 ; wait for nozzle to hit 45 degrees
M84 ; disable motors

What did you already try to solve it?

Googled. Tried running code in different sections.
I can confirm the slicer end script runs and the LEDs turn off, however the printer remains on.
I do have the power lines from the Raspberry Pi covered in Tape so the LCD does not remain on with the Printers power off

Have you tried running in safe mode?

Yes, no luck

Did running in safe mode solve the problem?

Yes, no change

Systeminfo Bundle (27.0 KB)

Additional information about your setup

Version 1.7.3
Creality Cr-10s running Marlin
Windows 10



Have you tried commeting the lcd line and only keeping the psu one? Does it work then?

Best way to try and tell what's happening is to enable debug logging in the plugin settings, restart OctoPrint and try it again. This will create additional information in plugin_tplinksmartplug_debug.log file that you can share to try and figure out what's happening.

;Catch 22, can't connect to a printer if the printer isn't already on..If anyone knows a way around this it ;would be swell

Yeah, can't really make this work without some major code updates on the plugin side that I'm hesitant to implement because it would require hacking the core OctoPrint. I personally use the start print on upload from my slicer to automatically power on my printer. For Cura you can configure the OctoPrint connection plugin to manage the power state. Prusa/Super Slicer both have the option to start on upload.

I personally don't depend on gcode scripts in favor of using the idle timer for managing my TPLink Power Strip and that might be a better solution for your use case as well.


Thank you, makes sense.
I have changed it to be based on the idle time and removed the gcode