[Nut-upsuser] new NUT release please!

Marco Walther marco at sonic.net
Mon Sep 11 18:21:31 UTC 2017


On 09/11/2017 10:49 AM, Sam Varshavchik wrote:
> Mike writes:
>
>> On 9/10/2017 6:41 PM, Sam Varshavchik wrote:
>> > Dutchman01 writes:
>> >
>> >> Hello all,
>> >>
>> >>
>> >>
>> >> I request a new NUT release as current dates back to March 9, 
>> 2016: NUT 2.7.4
>> >>
>> >> The fact stays that not all distro’s use latest snapshots/commits 
>> from github
>> >> dev tree.
>> >>
>> >>
>> >>
>> >> So please do release a new up to date version please.
>> >
>> > I updated Fedora's nut rpms with a custom rpm package that was 
>> built off the
>> > libusb-1.0 branch. It's been running fine, for the last 4-5 months, 
>> or so;
>> > subject to Tripplite's typical crappiness, of course.
>>
>>
>>
>> > subject to Tripplite's typical crappiness, of course.
>>
>> Oh, so it's not just me that has had the "pleasure" of using their 
>> UPS....
>
> The libusb-1.0 branch is more stable with that UPS, but the UPS is 
> still crap. The communications can be reliably reset by disconnecting 
> and reconnecting the USB cable, so it should be theoretically possible 
> to recover by completely shutting down and reenabling the USB port, 
> but I haven't found a way to do that in Linux.

You can [hardly any more] find some USB hubs, which allow ports to be 
powered on & off via software control. I'm using an older Linksys hub 
(http://a.co/gPhfi45) and the following little loop to reset the USB 
when there is a problem:

root at odroid:~/bin# cat check_ups.sh
#!/bin/bash

while true
do
     x=$(curl -s -o - 
'http://192.168.1.5:85/cgi-bin/nut/upsstats.cgi?host=tripplite@127.0.0.1:3493' 
| sed  's:<[^>]*>::g' | awk 'BEGIN {s = 0; } $1 == "Status:" { s = 1; 
next; } s == 1 { print $0; s = 0; }')
     if [ "$x" != "ONLINE" ]
     then
         logger -p daemon.warning "Triplite is not offline, trying to 
restart USB"
         /root/bin/hub-ctrl -b 001 -d 005 -P 1 -p 0
         sleep 5
         /root/bin/hub-ctrl -b 001 -d 005 -P 1 -p 1
         sleep 30
     else
         sleep 300
     fi
done


(https://github.com/codazoda/hub-ctrl.c is the little USB power switch 
helper)

root at odroid:~/bin# fgrep Triplite /var/log/daemon.log /var/log/daemon.log.1
/var/log/daemon.log:Sep 10 21:17:08 odroid logger: Triplite is not 
offline, trying to restart USB
/var/log/daemon.log.1:Sep  4 11:39:09 odroid logger: Triplite is not 
offline, trying to restart USB
/var/log/daemon.log.1:Sep  4 11:39:44 odroid logger: Triplite is not 
offline, trying to restart USB
/var/log/daemon.log.1:Sep  9 09:06:15 odroid logger: Triplite is not 
offline, trying to restart USB


root at odroid:~/src/hub-ctrl.c# lsusb
Bus 001 Device 006: ID 0bc2:ab24 Seagate RSS LLC
Bus 001 Device 054: ID 09ae:3016 Tripp Lite <--- Tripplite
Bus 001 Device 005: ID 0409:0058 NEC Corp. HighSpeed Hub <--- Hub
Bus 001 Device 004: ID 0424:ec00 Standard Microsystems Corp. 
SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 003: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 002: ID 0424:3503 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
root at odroid:~/src/hub-ctrl.c# lsusb -^C
root at odroid:~/src/hub-ctrl.c# lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=s5p-ehci/3p, 480M
     |__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/3p, 480M
         |__ Port 1: Dev 3, If 0, Class=Hub, Driver=hub/5p, 480M
             |__ Port 1: Dev 4, If 0, Class=Vendor Specific Class, 
Driver=smsc95xx, 480M
             |__ Port 2: Dev 5, If 0, Class=Hub, Driver=hub/4p, 480M 
<--- Hub
                 |__ Port 1: Dev 54, If 0, Class=Human Interface Device, 
Driver=usbfs, 1.5M <--- Tripplite
             |__ Port 3: Dev 6, If 0, Class=Mass Storage, 
Driver=usb-storage, 480M


Hope, that helps a bit;-)
-- Marco

> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser





More information about the Nut-upsuser mailing list