mmone / OctoprintKlipperPlugin

A plugin for a better integration of Klipper into OctoPrint.
GNU General Public License v3.0
83 stars 62 forks source link

Feature request: Klipper toggle #18

Open daef opened 6 years ago

daef commented 6 years ago

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.

mmone commented 6 years ago

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.

daef commented 6 years ago

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 :)

mmone commented 6 years ago

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

fritzw commented 5 years ago

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
daef commented 5 years ago

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

Haffwa commented 5 years ago

Yes, this feature would be very helpful!