Tripp Lite UPS Disconnects from NUT Server Intermittently

A workaround to fix an issue where Tripp Lite UPS's intermittently disconnect from NUT.

Tripp Lite UPS Disconnects from NUT Server Intermittently
Photo by Thomas Kelley / Unsplash

I use NUT (Network UPS Tools) - https://networkupstools.org/ to monitor two TRIPP LITE SMART1500RM2U that I don't have network interface cards for.

The two UPS's connect to a Raspberry Pi running NUT Server using USB from the serial port on the back of the UPS to the Raspberry Pi.

The issue:

Intermittently, both UPS's USB connections will "flap" or re-initiate and the NUT server will not pick up on this and remain in a failed state, unable to monitor for power blips, outages, etc.

A workaround to fix the issue:

I found this workaround here - https://serverfault.com/questions/994338/how-can-i-fix-my-ups-repeatedly-disconnecting-and-reconnecting

The poster found this workaround here - https://alioth-lists.debian.net/pipermail/nut-upsuser/2019-June/011451.html


Applying the workaround:

Add a new udev rule in directory /etc/udev/rules.d

sudo nano /etc/udev/rules.d/99-nut-ups.rules
SUBSYSTEM!="usb", GOTO="nut-usbups_rules_end"

# TrippLite
#  e.g. TrippLite SMART1500LCD - usbhid-ups
ACTION=="add|change", SUBSYSTEM=="usb|usb_device", SUBSYSTEMS=="usb|usb_device", ATTR{idVendor}=="09ae", ATTR{idProduct}=="3015", MODE="664", GROUP="nut", RUN+="/sbin/upsdrvctl stop; /sbin/upsdrvctl start"

LABEL="nut-usbups_rules_end"

/etc/udev/rules.d/99-nut-ups.rules/etc/udev/rules.d/99-nut-ups.rules

This rule is watching for USB add or change actions for the set variables idvendor and idproduct which are shown if you query your UPS with "upsc" as outputs "ups.vendorid" and "ups.productid". Set these to match your specific UPS if they do not match up. On this rule being triggered, "upsdrvctl" is stopped and then started again.

Set your poll interval in /etc/nut/upsmon.conf

sudo nano /etc/nut/upsmon.conf
...
POLLFREQ 5
...

/etc/nut/upsmon.conf

I have poll frequency set to 5 without any issue for the last few months. The original posting explains to set the poll frequency to 1, however, I found this to cause stability issues for me.

I also went ahead and set the deadtime parameter to 15.

...
DEADTIME 15
...

/etc/nut/upsmon.conf

Here's my current /etc/nut/ups.conf file

I choose to identify each one by the serial parameter and simply call them by ups1 and ups2.

pollinterval = 1
maxretry = 3
offdelay = 120
ondelay = 240
override.battery.charge.low = 30
override.battery.runtime.low = 180

[ups1]
driver = usbhid-ups
port = auto
desc = "Tripp Lite 1500VA SmartUPS"
serial = 2506BY0SM820600607

[ups2]
driver = usbhid-ups
port = auto
desc = "Tripp Lite 1500VA SmartUPS"
serial = 2502BY0SM820600204

/etc/nut/ups.conf

Restart NUT Server

After performing any changes to the NUT configuration files, go ahead and restart the service. Once the service comes back up, query each of your UPS's to make sure they are working as expected.

sudo systemctl restart nut-server.service

Expected outputs:

UPS1 Output

# upsc ups1@localhost
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 30
battery.runtime: 28448
battery.temperature: 37.9
battery.type: PbAC
battery.voltage: 40.9
battery.voltage.nominal: 36.0
device.mfr: Tripp Lite
device.model: TRIPP LITE SMART1500RM2U
device.serial: 2506BY0SM820600607
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 1
driver.parameter.port: auto
driver.parameter.serial: 2506BY0SM820600607
driver.parameter.synchronous: auto
driver.version: 2.8.0
driver.version.data: TrippLite HID 0.84
driver.version.internal: 0.47
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
input.frequency: 59.8
input.transfer.high: 0.0
input.transfer.low: 0.0
input.voltage: 123.0
input.voltage.nominal: 120
output.current: 0.0
output.frequency: 59.8
output.frequency.nominal: 60
output.voltage: 0.0
output.voltage.nominal: 120
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 0
ups.mfr: Tripp Lite
ups.model: TRIPP LITE SMART1500RM2U
ups.power: 0.0
ups.power.nominal: 1500
ups.productid: 3015
ups.serial: 2506BY0SM820600607
ups.status: OL
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.timer.start: -1
ups.vendorid: 09ae
ups.watchdog.status: 0

UPS2 Output

# upsc ups2@localhost
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 30
battery.runtime: 1226
battery.temperature: 38.9
battery.type: PbAC
battery.voltage: 40.9
battery.voltage.nominal: 36.0
device.mfr: Tripp Lite
device.model: TRIPP LITE SMART1500RM2U
device.serial: 2502BY0SM820600204
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 1
driver.parameter.port: auto
driver.parameter.serial: 2502BY0SM820600204
driver.parameter.synchronous: auto
driver.version: 2.8.0
driver.version.data: TrippLite HID 0.84
driver.version.internal: 0.47
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
input.frequency: 59.7
input.transfer.high: 0.0
input.transfer.low: 0.0
input.voltage: 122.2
input.voltage.nominal: 120
output.current: 3.0
output.frequency: 59.7
output.frequency.nominal: 60
output.voltage: 0.0
output.voltage.nominal: 120
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 27
ups.mfr: Tripp Lite
ups.model: TRIPP LITE SMART1500RM2U
ups.power: 0.0
ups.power.nominal: 1500
ups.productid: 3015
ups.serial: 2502BY0SM820600204
ups.status: OL
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.timer.start: -1
ups.vendorid: 09ae
ups.watchdog.status: 0

These two Tripp Lite UPS's have been stable for a while now. The outputs are both showing unique for each serial number and NUT has been fully functional.