usb-smart-switch

command module
v0.0.0-...-cf150a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2023 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

usb-smart-switch

Allows you to control usb power through a HomeKit device using the uhubctl command and the hc library. This has only been tested on the Raspberry Pi with Raspberry Pi OS Buster.

WARNING

The method used to turn off a USB device is a bit heavy handed as it turns off all USB ports and should be used in a headless Raspberry Pi setup where you don't depend a USB keyboard, mouse, or and other USB device.

Dependencies

uhubctl is required and can be installed on debian based distros with apt:

sudo apt install -y uhubctl

Run

The uhubctl command requires root access so you can build and run with the following command:

go build .
sudo ./usb-smart-switch

Run at boot

One way to run this command at boot is to add the following to /etc/rc.local:

usbSmartSwitchDir={path_to_usb-smart-switch}
cd ${usbSmartSwitchDir}
${usbSmartSwitchDir}/usb-smart-switch &

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址