Use TPLink smart plug with Mainsail.
DEPRECATED
Last updated
DEPRECATED
Last updated
see link below:
This is the one piece that I was really missing form Octoprint. The plugin that handled the TPLink wifi smart plug that my printer is connected to. In order to make this work, we need to use two GitHub Repos.
First, we are going to need to find the IP of your TP Link smart plug. The easiest way is to use the Fing app
Before you plug your smart plug to the wall, do a first scan of your network with Fing. Then plug it into the wall, wait for it to turn on and connect and scan again. the extra IP that pops up is your plug! Note that IP for later...
The first one is https://github.com/softScheck/tplink-smartplug copy it to your Raspberry pi via SSH with:
(make sure you already have git installed otherwise do: sudo apt-get install git -y
)
Now let's install powermanager from https://github.com/Raabi91/powermanager
open the moonraker.config and put the power devices in it
put this at the end of the file.
Old code from previous Moonraker version below
Rename the printer to whatever you want. Then Ctrl-X
then Y
then Enter
to save.
Time to install powermanager
and edit powermanager's config.
In the config change the two lines for printer_off
and printer_on
(line 5 and 7) to :
use your plug's IP that we noted earlier. Then Ctrl-X
then Y
then Enter
to save.
Now you need to restart your Pi. You can do that in Mainsail by clicking HOST REBOOT in settings or via SSH with:
You're done! You can now setup Klipper to reconnect when it detects the MCU being powered on by following my other tutorial: