-
I have a tasmota socket to power my printer and with the [power] integration in moonraker it works quite well to switch it on / off via mainsail UI. What doesn't work is when the socket is switched on or off externally (with the button on the socket). The system does not recognize the new situation. This works for me as well but I thought there must be a better way to get rid of the messages "Klipper reports: STARTUP or SHUTDOWN or ERROR" and instead having the proper message "Printer is power off" So I was looking for a way of making an API call to moonraker to power ON the printer or to mainsail to press that "power ON" button when the USB device gets connected. But I could not find any suitable solution. Since I posted this question in another older thread and was asked to post it in here I switched back to not set the bound_services as shown here and must say I could live with these STARTUP/SHUTDOWN/ERROR messages. Since I can easily walk on my printer, switch it on on the plug and can operate it from the old fashioned LCD without using a phone or PC nearby. So if anyone has a good idea how to handle this remote ON/OFF better then this restart command I'd be happy to try it out. Thanks and regards |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
can you please enable initial_state and bound_services, poweroff the printer via mainsail/moonraker and then power on the printer manually and then upload the moonraker.log here? i just have to see how moonraker behaves in this case "according to the log". but i think only a udev rule will fix your issue. |
Beta Was this translation helpful? Give feedback.
-
here are the log files as requested. Started the printer from UI did a homing and some manual moves and powerd off from UI. After some seconds I switched on externally but nothing happed on the UI. Still the info box visible with "Printer is powerd off". I just switched to the MASCHINE page to download the log files. Thanks |
Beta Was this translation helpful? Give feedback.
-
thx for the log and i also doublecheck all settings with the moonraker maintainer. right now, there will be never any action from moonraker to restart klipper, when you change the state external and another issue here is the tasmota plug itself. it will be controlled via http calls and these dont update moonraker, when you press the button. to have a 2 way option, you can use MQTT as protocoll from your plug (but you need a MQTT broker in your network then). and for the klipper restart, you have to use a udev rule. there is no way around it right now. so disable all function for that in moonraker and just use the udev rule to restart klipper, when the board is connecting to your SBC. |
Beta Was this translation helpful? Give feedback.
-
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] [Service] [Install] To be able to evaluate the response from moonraker API I used jq, which has to be installed as it is not included in the standard MainsailOS package. From my side we can close this topic now and mark it answerd. Thanks |
Beta Was this translation helpful? Give feedback.
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
[…