OctoPrint-TPLinkSmartplug doesn't turn off printer when job finished

I'm running Octoprint 1.3.9rc2 and loving it. I bought a TPLink wifi plug when I saw this plugin, and it's been great to remotely turn the printer on / off. I've configured the IP address and can turn the plug on / off with the little 'lightning' icon, but cannot get the printer to shut off automatically at the end of a print.

I've gone through the instructions at the OctoPrint-TPLinkSmartplug home page (OctoPrint-TPLinkSmartplug) but the text of the descriptions doesn't quite match the actual interface.

My log successfully shows the events of turning the plug on / off manually, but nothing happens automatically. Here are what my settings look like:

image

I'm the author. What is the GCODE command that you are using for turning off your plug? Should be the following, based on the settings in that screenshot.

M81 10.25.25.161

Put that in OctoPrint's GCODE Scripts in "After print job completes" or include at the end of your slicers end gcode commands.

1 Like

Ah, that's VERY helpful. Didn't know that I needed to enter that in the scripts section!

Lovely, I'll give this a go.

[edited to add]
Yep, that worked like a charm. I saw the reference to the M commands, but didn't realize I needed to put it in the scripts entry. Thanks a bunch! Love this plugin!

Does this command turn the printer off after it cools down, or immediately after a job is finished?

It would power off immediately after receiving the command unless you set the GCODE off delays and those are based on time, not temperature.

You can use my plugin in conjunction with ShutdownPrinter to get a temperature based power off target.

I am going to be running a Sonoff plugin, which I assume is not compatible with the one you made for the TP-Link. So I suppose my only option is to run a shutdown from the end Gcode after a set time.

Or flash your sonoff with Tasmota and use one of my Tasmota plugins.

I have configured the Tasmota plugin for my sonoff basic, and everything is working correctly through that plugin.

To allow ShutdownPrinter to work, I have my IP address obviously, but what do I need to input into the settings lines to make it work with Tasmota for Sonoff and not a TPLink?

If I remember correctly you can put the command that would be the equivalent of the gcode commands in my plugin without the M80/M81 front part. I think that plugin just adds that to the end of the gcode command for shutdown. You also have to enable gcode processing in my plugin settings.

So something like 192.168.0.2 1.

Yep, there are several options, but that should work.

did al of the thinks above. but my printer doesnt shut down.
put M81 192.168.178.99 in the terminal window doesnt work too.
any hints?
thanks

Did you enable gcode option on the plug settings?

i found the clou.
i deinstalled the plugin shutdown printer.
after that the M81 code works in the console.
i reinstalled the shutdown plugin and now it works fine.

1 Like

Hi @dogson,

nice you solved it.
Could you please tick the small check box below your last post to mark this thread solved?

Thank you.