OctoprintKlipperPlugin icon indicating copy to clipboard operation
OctoprintKlipperPlugin copied to clipboard

Feature request: Klipper toggle

Open daef opened this issue 5 years ago • 6 comments

I would like a more convenient way to switch between marlin and klipper based printers. Currently I ssh onto the pi to sudo service klipper stop and disable the OctoKlipper plugin in the Settings if I want to try a marlin config. Maybe a toggle in OctoKlippers connection panel that hides/shows the OctoKlipper UI and stops/starts the klipper service.

daef avatar Aug 26 '18 14:08 daef

You can disable the simplification of OctoPrints connection panel in the plugins settings ("Settings/OctoKlipper/Basic/Replace Connection Panel") there should be no need to disable the plugin. You need to restart OctopPrint and refresh your browser for a change in this setting to take effect. To control the klipper service from inside OctoPrint is not that simple as "sudo" is required. I need to check how OctoPrint handles that for the OctoPrint service.

mmone avatar Aug 26 '18 15:08 mmone

I can always set a sticky bit on a script or binary - that should be no problem. Unchecking replace connection panel made no visible difference but I thought I've restarted the server, will retry with Ctrl+F5 after the next print is finished :)

daef avatar Aug 26 '18 19:08 daef

Ctrl+F5 should do it. Octoprint does some pretty heavy caching.

mmone avatar Aug 26 '18 19:08 mmone

To control the klipper service from inside OctoPrint is not that simple as "sudo" is required. I need to check how OctoPrint handles that for the OctoPrint service.

On raspbian/octopi, the user pi can use sudo without providing a password, so octopi just uses commands like sudo service octoprint restart. If you disable that, you can always configure sudo to allow specific commands without a password by adding lines like this to /etc/sudoers:

pi ALL=NOPASSWD:/usr/sbin/service klipper start
pi ALL=NOPASSWD:/usr/sbin/service klipper stop
pi ALL=NOPASSWD:/usr/sbin/service klipper restart

fritzw avatar Nov 12 '18 22:11 fritzw

you could also set the SUID bit on your binary I guess...

daef avatar Nov 14 '18 08:11 daef

Yes, this feature would be very helpful!

Haffwa avatar Nov 19 '18 22:11 Haffwa