10

I've got upsmon (nut-client) and upsd (nut-server) set up and almost fully working on an RPi3.

Connected is a CP1500PFCLCD UPS via USB. upsd and upsmon start up perfectly every time. However, given about 2-20 hours of uptime, a "data stale" error will creep in. The specific error is:

raspberrypi upsd[14612]: Data for UPS [cyberpower] is stale - check driver

Followed by many, many more errors resulting from that one, specifically:

raspberrypi upsmon[9318]: Poll UPS [cyberpower@localhost] failed - Data stale

Unlike some others, mine does not appear to reconnect on its own.

If I restart the nut-server service, then the ~2-20 hour cycle repeats. How do I "check driver" as it suggests? I need to get rid of that error, as it is causing other processes to fail.

I run "usb-devices" and the CP1500PFCLCD does show up in the list

Malachi
  • 203
  • 1
  • 2
  • 8

4 Answers4

15

Found this fix on another site, working so far for me.

It turns out that many CyberPower products reset the USB interface if a driver has not connected for 20s.

After some more fiddling I noticed that NUT was set to consider an UPS “stale” (e.g.: “Hey Mr. UPS, you haven’t spoke to me for a while. You know what? I’ll just silently assume that you’re dead and not tell anyone about that.”) after 15 seconds by default.

In order to get a CyberPower USB UPS to stay connected for more than a couple of minutes, you have to change the staleness settings in NUT to give them some headroom and the polling interval in the definition of the UPS itself.

https://nmaggioni.xyz/2017/03/14/NUT-CyberPower-UPS/

Specifically, you need to add a pollinterval = 15 line to your UPS definition in /etc/nut/ups.conf (below your [my-ups-name] line), and the two lines DEADTIME 25 and MAXAGE 25 to /etc/nut/upsmon.conf.

For example:

/etc/nut/ups.conf:

[cyber1]
        driver = "usbhid-ups"
        port = "auto"
        desc = "CyberPower CP900EPFCLCD"
        pollinterval = 15

/etc/nut/upsmon.conf:

DEADTIME 25
MAXAGE 25

(These config options taken directly from the above-linked page.)

Note: MAXAGE appears to be deprecated on the newest versions of nut so it may not be applicable to your config.

Jason Sievert
  • 166
  • 2
  • 3
  • While this may answer the question, it would be preferable if you included the important bits from the answer in case their website goes down. – Aloha Sep 25 '17 at 02:40
  • Better late than never.... but it appears that MAXAGE belongs in upsd.conf not upsmon.conf. This may be why it appears to be deprecated. – ianjs Jul 03 '21 at 08:23
  • 1
    The linked site also mentions that the pollinterval might not be needed, which makes sense - the default is 2, which is more often, it makes no sense to make it longer.

    So the DEADTIME is the important part. MAXAGE doesn't exist in newer NUT versions.

    – Amunak Jul 12 '21 at 21:06
  • Indeed pollinterval does not need to be changed and MAXAGE is in upsd.conf. Also, nut sucks. – CR. Oct 21 '22 at 03:27
  • I don't see any indication of MAXAGE being deprecated. It's still documented in https://networkupstools.org/docs/man/upsd.conf.html . The DEADTIME directive, however, is not. – nstenz Jan 23 '23 at 03:19
2

pollinterval defaults to 30 for the usbhid-ups driver in Debian buster, per the man page. 30 is also the default value in the current Github source.

With pollinterval at 15 in ups.conf and DEADTIME at 30 in upsmon.conf on buster, no "stale data" messages have been logged in three days of continuous runtime with a Cyberpower SL750U. With the default values of pollinterval and DEADTIME, "stale data" messages appeared after ~30 hours of runtime.

marcg
  • 21
  • 2
  • How is this different from the accepted answer? – user68186 Feb 25 '22 at 14:39
  • There were earlier comments that pollinterval defaults to 2s and that setting it to 15s might not be necessary. I was clarifying that the default is 30s on Github and in Debian. For those versions it needs to be reduced for the Cyberpower UPS. – marcg Feb 26 '22 at 02:02
  • This is a question answer site, not a discussion forum. Your answer does not provide any new solution to the question. When you get sufficient reputation you will be able to comment on an answer. – user68186 Mar 01 '22 at 14:42
1

I restart driver

sudo upsdrvctl start

You can do it in Cron

goldilocks
  • 58,859
  • 17
  • 112
  • 227
1

I'm running Home Assistant on a Raspberry Pi4 using HAOS with the NUT Add-on and Integrations. For months I've been struggling with this issue. I happen to have a Tripplite SMART1500LCDT UPS. I've tried about every combination of pollinterval, deadtime, and maxage that I found on other threads. I even upgraded the Pi's firmware to the latest version. None of these suggestions seem to help for very long.

Now I tried setting pollonly = "enabled" and it appears to be working without disconnection (48 hours +).

Thanks to eyal0 at https://github.com/networkupstools/nut/issues/1029 for the tip.

John
  • 11
  • 1