Crates.io | usbautoreset |
lib.rs | usbautoreset |
version | 0.1.3 |
source | src |
created_at | 2024-04-02 17:55:53.58366 |
updated_at | 2024-04-02 18:41:13.925167 |
description | Tool to automatically reset USB devices on error |
homepage | |
repository | https://github.com/SamiKalliomaki/usbautoreset |
max_upload_size | |
id | 1193901 |
size | 6,381 |
If you are like me, your USB devices sometimes stop working and even unplugging and plugging them back in doesn't help. This is a simple script that resets the USB devices by unbinding and binding them.
It looks for errors like this:
xhci_hcd 0000:00:14.0: WARN: buffer overrun event for slot 10 ep 1 on endpoint
xhci_hcd 0000:00:14.0: WARN: buffer overrun event for slot 10 ep 1 on endpoint
When it sees a message like this, it does the equivalent of:
echo -n "0000:00:14.0" > /sys/bus/pci/drivers/xhci_hcd/unbind && echo -n "0000:00:14.0" > /sys/bus/pci/drivers/xhci_hcd/bind
cargo install usbautoreset
sudo ./usbautoreset