<div dir="ltr"><div>Hi Stuart,</div><div>You steered me on the right path!</div><div>With that infor I did a bit of Ducking and found that Raspberry-pi's are actually PPPS capable!<br></div><div>So I downloaded the script from:  <a href="https://github.com/mvp/uhubctl">https://github.com/mvp/uhubctl</a> and compiled it and sure enough: it works!</div><div>So now I can reload the driver and reset the power in a shell script but the question I still have is how to make nut to run that script?</div><div>Is there a way to run that script when the ups is 'stale'..?</div><div>Thanks soo much for your help!</div><div>Cor Koelewijn</div><div>Tororo - Uganda (where power is TOOOO unstable ;-)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 24, 2020 at 9:43 PM Stuart D Gathman <<a href="mailto:stuart@gathman.org">stuart@gathman.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, 24 Nov 2020, Marco Walther wrote:<br>
<br>
> On 11/24/20 9:11 AM, Kirk Bocek wrote:<br>
>><br>
>>  On 11/24/2020 8:10 AM, David Zomaya wrote:<br>
>>>>>  Only when I physically unplug it and plug it in again will it start.<br>
<br>
You need a USB hub that supports either mandatory all ports off (even<br>
though it is mandatory, very few hubs sold actually implement it),<br>
or optional PPPS (per port power switching).  With older kernels,<br>
I was able to use hub-ctrl to power off the port with the UPS, and<br>
then power it on again - which has the same effect as unplugging the<br>
cable.  I put all this into a package (trippfix on github) for CentOS-6.<br>
<br>
With newer kernels, e.g. CentOS-8, the kernel knows how to deal with<br>
this kind of braindamage, and will do the PPPS power cycle<br>
automatically (which won't work, of course, unless you have a hub<br>
that actually supports it).  So with C8, I don't need my package.<br>
<br>
Here is an example from dmesg of the kernel doing the power cycle<br>
automatically:<br>
<br>
[1909765.932951] usb 2-1.4-port4: disabled by hub (EMI?), re-enabling...<br>
[1909765.933328] usb 2-1.4.4: USB disconnect, device number 17<br>
[1909766.898490] usb 2-1.4-port4: Cannot enable. Maybe the USB cable is<br>
bad?<br>
[1909767.754326] usb 2-1.4-port4: Cannot enable. Maybe the USB cable is<br>
bad?<br>
[1909767.754586] usb 2-1.4-port4: attempt power cycle<br>
[1909768.774301] usb 2-1.4.4: new low-speed USB device number 20 using<br>
ehci-pci<br>
[1909768.817887] usb 2-1.4.4: New USB device found, idVendor=09ae,<br>
idProduct=3016, bcdDevice= 0.02<br>
<br>
>>>>>  Is there a way I can do something about that?<br>
<br>
Get a hub that supports PPPS.<br>
<br>
Since all USB microcontrollers on the market support PPPS, you can <br>
also add it yourself if you are so inclined:<br>
<br>
<a href="http://hackaday.com/2014/02/05/software-controlled-per-port-power-switching-for-usb-hubs/" rel="noreferrer" target="_blank">http://hackaday.com/2014/02/05/software-controlled-per-port-power-switching-for-usb-hubs/</a><br>
<br>
For a list of working hubs when I bought mine in 2016:<br>
<br>
<a href="https://github.com/codazoda/hub-ctrl.c" rel="noreferrer" target="_blank">https://github.com/codazoda/hub-ctrl.c</a><br>
<br>
This is not something NUT can really do anything about (other than<br>
the driver recovering properly when the UPS goes away and then comes back).<br>
It is braindead USB hardware in many Tripplite boxes.<br>
<br>
My Tripplite does really well at handling the surges that come with<br>
power failures and switching to alternate circuits or home generator<br>
power.  So it was worth it to work around its USB braindamage.  Buying a<br>
higher end device might have been more cost effecting considering<br>
my time - but wouldn't be nearly as fun...<br>
<br>
<br>
_______________________________________________<br>
Nut-upsuser mailing list<br>
<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a></blockquote></div>