Latest News:
*New 11.2 series Release:
2019-06-20: XigmaNAS - released!

*New 12.0 series Release:
2019-06-20: XigmaNAS - released!

We really need "Your" help on XigmaNAS translations. Please help today!

Producing and hosting XigmaNAS cost money, please consider a donation to our project so we can continue to offer you the best.
We need your support! eg: PAYPAL

Hack to reset usb device after "data stale" errors

Uninterruptable Power Supply service using NUT.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
Posts: 2
Joined: 20 Dec 2018 00:19
Status: Offline

Hack to reset usb device after "data stale" errors


Post by elliotn » 20 Dec 2018 00:53

I have an APC Back UPS 600 that I was able to get working with the usbhid-ups driver. Unfortunately, it was frequently crapping out due to "data stale" issues. Adding "pollinterval=30" to Additional Drivers reduced the frequency. Unfortunately, once connectivity was lost it was never regained. I was able to manually reestablish connectivity by resetting the usb device.

I'd love to know how to actually solve the "data stale" issue. In the meantime, I added this hack as a cron job to check ups connectivity and reset device if need be. Change the first 3 variables to fit your needs:


# change to fit your environment
UPSSTRING="American Power Conversion Back"

# find device
UPSDEV=$(usbconfig | sed -n -e "/$UPSSTRING/s/:.*//p")
if [ -z "$UPSDEV" ]; then
echo "no matching UPS device found: $UPSSTRING"
exit -1

# reset device if need be
upsc $UPSNAME@localhost > /dev/null 2>&1
if [ $? -ne 0 ]; then
for xxx in $(seq 1 $RESETATTEMPTS); do
usbconfig -d $UPSDEV reset

Post Reply

Return to “UPS”