Searching in the topics for tplink and layer did not provide the answer I am looking for. Sorry if this is a duplicate.
I have a KP303 with 3 outlets and I connected 10 my printer ( Flashforge Creator Pro V.2016), 2- a webcam power supply and 3- an external fan
I can control my KP303 from octoprint and it sees g-code commands ( it does shut the printer correctly after a print
What I want to acheive is to be able to start the external fan on a specific layer or height and I can't find the correct way to make this work
What did you already try to solve it?
Searched on the net and in this forum
Additional information about your setup
OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible
I have octoprint.version : 1.5.1
OctoPi Version 0.17.0, running on Raspberry Pi 4 Model B Rev 1.2
TP-Link Smartplug (0.9.26) plugin
printer is a flashforge Creator Pro, manual control of my outlets work from the octoprint gui.
The TP-Link plugin doesn't have this capability. You would have to ask the author for an enhancement.
I'm going to guess that you can also control the plugs from the RPi. If so, then one way to do this would be to use another plugin like GCode System Commands. To do this you would edit the gcode file and insert an OCTO command where you want the fan to turn on. Some slicers have post processing extensions or macros that could help automate this.
My Fan Speed Mirror plugin might be used for this if instead of a particular layer or height, you are willing to accept a certain fan speed as your trigger. The script would turn the fan on when the M106 command was above a certain value and off with an M107.
It does do this. There is the @TPLINKON <ip> or M80 <ip> commands that you can use to inject into your gcode, assuming you can do that with your slicer.
my problem is inserting the right gcode at the right place from the slicer.
But since Octoprint knows at which layer he is, I thought that it could be an info that could be used to trigger to power on
@b-morgan
The more I think about it, the more it looks like what I exctly need
This way I would not need to inject g-code and both fans would start at the same time whatever the layer I choose in my slicer.
That's not going to work. Fan Speed Mirror executes an RPi system command passing the S parameter value of the M106 gcode command as an argument. The RPi won't know what to do with "M80" or "@TPLINKON"
Your choices are either to teach your slicer to insert an M80 or @TPLINKON into the gcode output it creates or write an RPi script that turns the plug on when Fan Speed Mirror calls it with the argument above some threshold (the argument values are 0-255).
To put it another way, the TP-Link plugin and Fan Speed Mirror plugin don't talk to each other.