[Nut-upsuser] NUT USB Delayed Communication

Jim Klimov jimklimov+nut at gmail.com
Tue Jan 31 19:51:33 GMT 2023


Hello,

Yes, "pollonly" is a driver option for certain devices (and relevant to
just some drivers).

Disconnects are probably relevant, at least to loss of connection (and
staying that way, with less agressive retries in NUT v2.7.4 and before).
There is a logged issue that "pollonly" mode might have trouble detecting a
disconnection/staleness, I'm not sure there's merit to it in practice
though.

However if the device (or USB hub) goes to some power-saving mode due to
lack of recent comms, the regular polling from driver might in fact avoid
this cause.

Jim

PS: Please do "Reply All", in particular to get more ideas from more people
on the list. And to keep hints in archive for later searches.


On Tue, Jan 31, 2023, 17:26 Jack <jack at violetdragonsnetwork.co.uk> wrote:

> On 2023-01-31 16:07, Jim Klimov wrote:
> > Hello,
> >
> > On one hand, sorry to hear that higher polling frequency in upsmon did
> > not help. On another, question is if the driver gets the info (online
> > state and its changes) from device quickly enough.
> >
> > Initially I meant for you to also try if the "pollonly" flag (in each
> > device section of ups.conf for usbhid-ups instances) would make a
> > difference?.. I'd expect data-transfer interrupts to be less laggy -
> > but that's as long as they work reliably or at all, which may rely on
> > whole chain from vendor firmware implem to chips, hubs, OS drivers,
> > powersaving and whatnot. And everyone cuts corners.
> >
> > Running the drivers in debug mode can expose the events and state
> > changes: stop their services, run `usbhid-ups -a vdn-ups01 -DDDDDD`,
> > watch console as you pull the plug and put it back.
> >
> > Also current NUT (master certainly, 2.8.0 release maybe) should try
> > harder to reconnect upon problems. Possibly an upgrade would address
> > your ling-term stability issues.
> >
> > Jim
> >
> > PS: returning discussion to mailing list :)
> >
> > On Tue, Jan 31, 2023, 16:07 jack Bamford
> > <jack at violetdragonsnetwork.co.uk> wrote:
> >
> >> Hi,
> >>
> >> I am still having problems with NUT, it stops communication
> >> completely after a few days of uptime, however I have messed with
> >> Polfreg and Polintervals but none makes no difference, if i restart
> >> nut-server it shows it looses communication between the UPS then
> >> connects again however pulling the plug it does not detect that the
> >> UPS is on battery, I have tried on multiple systems, pfSense, Debian
> >> on a Raspberry Pi and on a old Laptop and same problem occurs.
> >>
> >> Any ideas?
> >>
> >> Regards
> >>
> >> Jack
> >> On 08/01/2023 01:33, Jim Klimov wrote:
> >>
> >> Given this mentioned APC, I assume usbhid-ups. It should support
> >> those options via ups.conf sections.
> >>
> >> Also, `upsmon` client may be strobed by POLLFREQ setting to talk to
> >> upsd more pr less intensively, but by default it is 5s (check if
> >> distro did differently?)
> >>
> >> Are you using distro-packaged NUT (likely old 2.7.4 then), or 2.8.0+
> >> - maybe custom build from github?
> >>
> >> Jim Klimov
> >>
> >> On Sat, Jan 7, 2023, 23:38 jack Bamford
> >> <jack at violetdragonsnetwork.co.uk> wrote:
> >>
> >> Hi,
> >>
> >> Thanks for your reply,
> >>
> >> On Server side i don't have have pollonly or interrupts. What you
> >> recommend to try?
> >>
> >> Regards
> >>
> >> Jack
> >> On 07/01/2023 22:33, Jim Klimov wrote:
> >>
> >> I would guess configuration of `pollonly` vs. interrupts (lack of
> >> pollonly) can play a difference - at least worth trying. Different
> >> HW (mis-)behaves differently with these option, no "one to rule them
> >> all".
> >>
> >> Jim
> >>
> >> On Sat, Jan 7, 2023, 20:44 jack Bamford via Nut-upsuser
> >> <nut-upsuser at alioth-lists.debian.net> wrote:
> >> Good evening folks,
> >>
> >> So I configured NUT on a Raspberry Pi 4 both UPS are connected over
> >> USB
> >> however the switch from AC Power to Battery seems to be delayed on
> >> the
> >> NUT communication would anyone have any ideas? The Pi Reports that
> >> the
> >> UPS is on battery around 30 seconds later I think this delay is
> >> long. I
> >> have tested it on a physical computer and the detection is around 5
> >> to 6
> >> seconds with the communication from the UPS to the machine. I have
> >> tested both USB 2 and 3 Ports but same problem
> >>
> >> Specs of Pi
> >>
> >> Raspberry Pi4
> >>
> >> Debian Raspbian
> >>
> >> 32GB Sandisk SSD
> >>
> >> POE Hat
> >>
> >> Both UPS's are APC Smart 1000 non Display
> >>
> >> Regards
> >>
> >> Jack
> >>
> >> --
> >> VioletDragons Network
> >> VioletDragons Projects
> >> Violets Data Center
> >> Malvern
> >> United Kingdom
> >> Phone:  +44(0)7413 601663
> >> Email: jack at violetdragonsnetwork.co.uk
> >> Website: www.violetdragonsnetwork.co.uk [1]
> >>
> >> _______________________________________________
> >> Nut-upsuser mailing list
> >> Nut-upsuser at alioth-lists.debian.net
> >> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
> >
> > --
> > VioletDragons Network
> > VioletDragons Projects
> > Violets Data Center
> > Malvern
> > United Kingdom
> > Phone:  +44(0)7413 601663
> > Email: jack at violetdragonsnetwork.co.uk
> > Website: www.violetdragonsnetwork.co.uk [1]
> >
> > --
> > VioletDragons Network
> > VioletDragons Projects
> > Violets Data Center
> > Malvern
> > United Kingdom
> > Phone:  +44(0)7413 601663
> > Email: jack at violetdragonsnetwork.co.uk
> > Website: www.violetdragonsnetwork.co.uk
> >  [1]
> >
> >
> > Links:
> > ------
> > [1] http://www.violetdragonsnetwork.co.uk
>
> Hi Jim,
>
> Thanks for your reply, oh so I add pollonly per UPS in ups.conf ? I was
> adding it at the top of the config my bad. One thing I have noticed
> under dmesg is a few disconnects regard USB so not sure if that is
> related or not.
>
> This is what I have in ups.conf
>
> pollinterval = 1
> maxretry = 3
>
> [vdn-ups01]
>      driver = usbhid-ups
>      port = auto
>      desc = "VDN-UPS01 APC Smart-UPS 1000VA RM"
>      vendorid = 051d
>      productid = 0002
>      serial = AS061
>
> [vdn-ups02]
>      driver = usbhid-ups
>      port = auto
>      desc = "VDN-UPS02 APC Smart-UPS 1000VA RM"
>      vendorid = 051d
>      productid = 0002
>      serial = AS06
>
> Regards
>
> Jack
>
> --
> VioletDragons Network
> VioletDragons Projects
> Violets Data Center
> Malvern
> United Kingdom
> Phone:  +44(0)7413 601663
> Email: jack at violetdragonsnetwork.co.uk
> Website: www.violetdragonsnetwork.co.uk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20230131/d2f98943/attachment-0001.htm>


More information about the Nut-upsuser mailing list