moonraker icon indicating copy to clipboard operation
moonraker copied to clipboard

Add support for USB hub power control via uhubctl

Open Jckf opened this issue 3 years ago • 1 comments

This adds support for toggling power to certain USB hubs/ports on or off via the command line tool uhubctl (available via apt on Raspbian). This is useful to completely shut down MCUs, LCDs, and other peripherals that are powered over USB.

On my RPi 3 + RAMPS 1.4 printer setup, the following config lets me turn off the entire printer plus its webcam (port 2 controls power to all 4 ports on the RPi):

[power USB]
type: uhubctl
port: 1-1.2
bound_service: klipper

Disclaimer: I am not a Python developer, and the entire Klipper ecosystem is new to me as of a few days ago, but I've done my best 😅 Feedback welcome 🙂

Signed-off-by: Jim C K Flaten [email protected]

Jckf avatar Oct 15 '22 22:10 Jckf

Thanks. I took an initial look and found a few things that should be addressed.

Arksine avatar Oct 16 '22 14:10 Arksine