Hi SirG(ent?)<br><br><div class="gmail_quote">2012/10/6 SirG <span dir="ltr"><<a href="mailto:nut-upsuser@gleizer.net" target="_blank">nut-upsuser@gleizer.net</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have had a similar problem to many other people for the last few<br>
months with my Cyberpower UPS. It was working properly after reboot<br>
about one in five times; the rest of the time it  would endlessly<br>
disconnect and reconnect, according to syslog messages.<br>
<br>
The latest I was able to find towards a solution is<br>
<a href="http://www.mail-archive.com/nut-upsuser@lists.alioth.debian.org/msg06671.html" target="_blank">http://www.mail-archive.com/nut-upsuser@lists.alioth.debian.org/msg06671.html</a><br>
<br>
The root cause is identified as a Cyberpower firmware behavior, that<br>
disconnects the box, unless a driver claims it within 20 seconds of<br>
connection. Since the driver is started by an rc script only at boot,<br>
if that boot script does not run at the right time, the only recovery<br>
is to run 'upsdrvctl start' manually - which is what I had been doing.<br>
<br>
The suggestion in the above article is to re-arrange the boot scripts<br>
to have nut start earlier.<br>
<br>
In my case this was a bit harder to control (Ubuntu uses upstart) and<br>
did not seem very robust; I came up with an alternative solution for<br>
systems that use udev.<br>
<br>
The solution is to have udev run 'upsdrvctl start' when this device<br>
connects. To do so, add ", RUN+="/sbin/upsdrvctl start" to the end of<br>
the udev config line for your device. Mine looks like this:<br>
<br>
#  Dynex DX-800U?, aloso 825AVRLCD  - usbhid-ups<br>
ATTR{idVendor}=="0764", ATTR{idProduct}=="0501", MODE="664",<br>
GROUP="nut", RUN+="/sbin/upsdrvctl start"<br>
<br>
In Ubuntu, the recommended way to do this is described in<br>
/etc/udev/rules.d/README. I  copied<br>
/lib/udev/rules.d/*-nut-usbups.rules to<br>
/etc/udev/rules.d/nut-usbups.rules and modified my device's line as<br>
shown above.<br>
<br>
Works like a charm, very stable, and, as a fringe benefit, I can<br>
hotplug my UPS, if I need to rearrange my USB cables.<br></blockquote></div><br>thanks for sharing this solution with the list.<br><br>Side questions:<br>- have you (and others) reported this issue to CyberPower, and asked for a fix.<br>
- do you know (at least approx.) which firmware/models are impacted.<br><br>Side comment: your solution has some limitations.<br>Mainly, whenever or (SW or HW) disconnection will happen, another instance of usbhid-ups will be started.<br>
So you may either create a wrapper script or use the following line:<br clear="all">/sbin/upsdrvctl stop ; /sbin/upsdrvctl start<br>or<br>/usr/bin/killall -9 usbhid-ups ; /sbin/upsdrvctl start<br><br>cheers<br>Arnaud<br>-- <br>
Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org" target="_blank">http://www.networkupstools.org</a><br>Debian Developer - <a href="http://www.debian.org" target="_blank">http://www.debian.org</a><br>
Free Software Developer - <a href="http://arnaud.quette.fr" target="_blank">http://arnaud.quette.fr</a><br><br>