Skip to content

how to handle an external ON / OFF for a power device correctly #2138

Answered by pmax3
pmax3 asked this question in Help
Discussion options

You must be logged in to vote

I just want to report that I found a way how to handle the external power on.

In short it involves using a shell script querying the status of klipper service and sending restart and depending on the staus also a power on command to the power device. Here is the script:

As it uses some delays to wait for the printer to be ready it has to be called by a system service from the udev rule and not directly.

SUBSYSTEM=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="614e", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="e3poweron.service"

The service itself I have defined as so:

[Unit]
Description=Ender3 PowerOn Service

[Service]
User=pi
ExecStart=/home/pi/power_on.sh
#Restart=always

[…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@pmax3
Comment options

Comment options

You must be logged in to vote
1 reply
@meteyou
Comment options

Answer selected by meteyou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants