NUT - Connection failure

I have an Eaton 5E UPS connected via USB. The connection worked (my previous post) and after connecting the UPS to Windows it stopped.

psdrvctl start
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
Using subdriver: MGE HID 1.3
upsc -l
Error: Connection failure: Connection refused

upsc Eaton_5E
Error: Connection failure: Connection refused

cat ups.conf 
# Network UPS Tools: example ups.conf
#
# --- SECURITY NOTE ---
#
# If you use snmp-ups and set a community string in here, you 
# will have to secure this file to keep other users from obtaining
# that string.  It needs to be readable by upsdrvctl and any drivers,
# and by upsd.
#
# ---
#
# This is where you configure all the UPSes that this system will be
# monitoring directly.  These are usually attached to serial ports, but
# USB devices and SNMP devices are also supported.
#
# This file is used by upsdrvctl to start and stop your driver(s), and
# is also used by upsd to determine which drivers to monitor.  The 
# drivers themselves also read this file for configuration directives.
#
# The general form is:
# 
# [upsname]
#       driver = <drivername>
#         port = <portname>
#       < any other directives here >
#
# The section header ([upsname]) can be just about anything as long as
# it is a single word inside brackets.  upsd uses this to uniquely 
# identify a UPS on this system.
#
# If you have a UPS called snoopy, your section header would be "[snoopy]".
# On a system called "doghouse", the line in your upsmon.conf to monitor
# it would look something like this:
#
#       MONITOR snoopy@doghouse 1 upsmonuser mypassword master
#
# It might look like this if monitoring in slave mode:
#
#       MONITOR snoopy@doghouse 1 upsmonuser mypassword slave
#
# Configuration directives
# ------------------------
# 
# These directives are common to all drivers that support ups.conf:
#
#  driver: REQUIRED.  Specify the program to run to talk to this UPS.  
#          apcsmart, bestups, and sec are some examples.
#
#    port: REQUIRED.  The serial port where your UPS is connected.  
#          /dev/ttyS0 is usually the first port on Linux boxes, for example.
#
# sdorder: optional.  When you have multiple UPSes on your system, you
#          usually need to turn them off in a certain order.  upsdrvctl
#          shuts down all the 0s, then the 1s, 2s, and so on.  To exclude
#          a UPS from the shutdown sequence, set this to -1.
#
#          The default value for this parameter is 0.
#
#  nolock: optional, and not recommended for use in this file.
#
#          If you put nolock in here, the driver will not lock the
#          serial port every time it starts.  This may allow other 
#          processes to seize the port if you start more than one by 
#          mistake.
#
#          This is only intended to be used on systems where locking
#          absolutely must be disabled for the software to work.
#
# maxstartdelay: optional.  This can be set as a global variable
#                above your first UPS definition and it can also be
#                set in a UPS section.  This value controls how long
#                upsdrvctl will wait for the driver to finish starting.
#                This keeps your system from getting stuck due to a
#                broken driver or UPS.
#
#                The default is 45 seconds.
#
# synchronous: optional.  The driver work by default in asynchronous
#              mode (i.e *synchronous=no*).  This means that all data
#              are pushed by the driver on the communication socket to
#              upsd (Unix socket on Unix, Named pipe on Windows) without
#              waiting for these data to be actually consumed.  With
#              some HW, such as ePDUs, that can produce a lot of data,
#              asynchronous mode may cause some congestion, resulting in
#              the socket to be full, and the driver to appear as not
#              connected.  By enabling the 'synchronous' flag
#              (value = 'yes'), the driver will wait for data to be
#              consumed by upsd, prior to publishing more.  This can be
#              enabled either globally or per driver.
#
#              The default is 'no' (i.e. asynchronous mode) for backward
#              compatibility of the driver behavior.
#
# Anything else is passed through to the hardware-specific part of
# the driver.
# 
# Examples
# --------
#
# A simple example for a UPS called "powerpal" that uses the blazer_ser
# driver on /dev/ttyS0 is:
#
# [powerpal]
#       driver = blazer_ser
#       port = /dev/ttyS0
#       desc = "Web server"
#
# If your UPS driver requires additional settings, you can specify them
# here.  For example, if it supports a setting of "1234" for the
# variable "cable", it would look like this:
# 
# [myups]
#       driver = mydriver
#       port = /dev/ttyS1
#       cable = 1234
#       desc = "Something descriptive"
#
# To find out if your driver supports any extra settings, start it with
# the -h option and/or read the driver's documentation.

[Eaton_5E]
        driver = usbhid-ups
        port = auto
        desc = "Eaton 5E"
        vendorid = 0463
        offdelay = 30
        ondelay = 40

Do you have any idea what is wrong?

Every time I had a Connection failure warning with NUT I had to move the part of the connector attached to the UPS for proper connection. I think I might move it inadvertently because it’s tight between a wall and the computer desk. Try to un/plug it to the UPS and see if it connects again.

I changed the USB port, it didn’t help.
The UPS is connected, but the UPSC can’t connect:

lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0463:ffff MGE UPS Systems UPS
Bus 001 Device 003: ID 05e3:0716 Genesys Logic, Inc. Multislot Card Reader/Writer
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

upsc -l
Error: Connection failure: Connection refused

My configuration files:

  • /etc/ups/nut.conf
...
MODE=standalone
  • /etc/ups/ups.conf
...
[Salicru]
        driver = blazer_usb
        #port = auto
        port = /dev/uhid
        desc = "SAI Salicru"
  • /etc/ups/upsd.conf
...
LISTEN 127.0.0.1 3493
...
localhost:/etc/ups # upsc -l
Salicru

Still no success :frowning:

sty 16 08:20:55 homeserver kernel: usb 1-4: new full-speed USB device number 4 using xhci_hcd
sty 16 08:20:56 homeserver kernel: usb 1-4: New USB device found, idVendor=0463, idProduct=ffff, bcdDevice= 1.00
sty 16 08:20:56 homeserver kernel: usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=4
sty 16 08:20:56 homeserver kernel: usb 1-4: Product: Eaton 5E
sty 16 08:20:56 homeserver kernel: usb 1-4: Manufacturer: EATON
sty 16 08:20:56 homeserver kernel: usb 1-4: SerialNumber: BLANK
sty 16 08:20:58 homeserver kernel: hid-generic 0003:0463:FFFF.0002: hiddev96,hidraw0: USB HID v1.10 Device [EATON Eaton 5E] on usb-0000:00:14.0-4/input0
sty 16 08:21:25 homeserver usbhid-ups[14435]: Signal 15: exiting
sty 16 08:21:34 homeserver usbhid-ups[15657]: Startup successful
lines 1495-1570/1570 (END)

homeserver:~ # upsc -l
Error: Connection failure: Connection refused

Showing some random lines of unknown logs without as much as describing what you did to generate these logs and where they come from is of little use. Still trying educated guess

Signal 15 is SIGTERM and it appears after approximately 90 seconds (shown lines obviously did not include starting of your program) which is the default systemd timeout so most likely the unit definition of your service does not match the actual program behavior. As the result, systemd believes that your service failed to start and stops all processes started so far during service activation.

All logs after connecting the UPS to USB and executing commands. Should I provide any other logs?

homeserver:~ # upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
Using subdriver: MGE HID 1.39
homeserver:~ # upsc -l
Error: Connection failure: Connection refused
homeserver:~ # 

sty 17 09:02:24 homeserver systemd[14751]: Queued start job for default target Main User Target.
sty 17 09:02:24 homeserver systemd[14751]: Created slice User Application Slice.
sty 17 09:02:24 homeserver systemd[14751]: Started Daily Cleanup of User's Temporary Directories.
sty 17 09:02:24 homeserver systemd[14751]: Reached target Paths.
sty 17 09:02:24 homeserver systemd[14751]: Reached target Timers.
sty 17 09:02:24 homeserver systemd[14751]: Starting D-Bus User Message Bus Socket...
sty 17 09:02:24 homeserver systemd[14751]: Starting Create User Files and Directories...
sty 17 09:02:24 homeserver systemd[14751]: Listening on D-Bus User Message Bus Socket.
sty 17 09:02:24 homeserver systemd[14751]: Finished Create User Files and Directories.
sty 17 09:02:24 homeserver systemd[14751]: Reached target Sockets.
sty 17 09:02:24 homeserver systemd[14751]: Reached target Basic System.
sty 17 09:02:24 homeserver systemd[14751]: Reached target Main User Target.
sty 17 09:02:24 homeserver systemd[14751]: Startup finished in 405ms.
sty 17 09:02:24 homeserver systemd[1]: Started User Manager for UID 0.
sty 17 09:02:24 homeserver systemd[1]: Started Session 1 of User root.
sty 17 09:02:24 homeserver sshd[14747]: pam_unix(sshd:session): session opened for user root by (uid=0)
sty 17 09:03:00 homeserver kernel: usb 1-7: new full-speed USB device number 3 using xhci_hcd
sty 17 09:03:01 homeserver kernel: usb 1-7: New USB device found, idVendor=0463, idProduct=ffff, bcdDevice= 1.00
sty 17 09:03:01 homeserver kernel: usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=4
sty 17 09:03:01 homeserver kernel: usb 1-7: Product: Eaton 5E
sty 17 09:03:01 homeserver kernel: usb 1-7: Manufacturer: EATON
sty 17 09:03:01 homeserver kernel: usb 1-7: SerialNumber: BLANK
sty 17 09:03:01 homeserver systemd[1]: Started Daily Cleanup of Snapper Snapshots.
sty 17 09:03:01 homeserver dbus-daemon[910]: [system] Activating via systemd: service name='org.opensuse.Snapper' unit='snapperd.service' requested by ':1.24' (uid=0 pid=14810 comm="/usr/lib/snapper/systemd-helper --cleanup ")
sty 17 09:03:01 homeserver systemd[1]: Starting DBus interface for snapper...
sty 17 09:03:01 homeserver dbus-daemon[910]: [system] Successfully activated service 'org.opensuse.Snapper'
sty 17 09:03:01 homeserver systemd-helper[14810]: running cleanup for 'root'.
sty 17 09:03:01 homeserver systemd[1]: Started DBus interface for snapper.
sty 17 09:03:01 homeserver systemd-helper[14810]: running number cleanup for 'root'.
sty 17 09:03:03 homeserver kernel: usbcore: registered new interface driver usbhid
sty 17 09:03:03 homeserver kernel: usbhid: USB HID core driver
sty 17 09:03:03 homeserver kernel: hid-generic 0003:0463:FFFF.0001: hiddev96,hidraw0: USB HID v1.10 Device [EATON Eaton 5E] on usb-0000:00:14.0-7/input0
sty 17 09:03:03 homeserver kernel: BTRFS info (device nvme0n1p3): qgroup scan completed (inconsistency flag cleared)
sty 17 09:03:03 homeserver systemd-helper[14810]: running timeline cleanup for 'root'.
sty 17 09:03:03 homeserver systemd-helper[14810]: running empty-pre-post cleanup for 'root'.
sty 17 09:03:04 homeserver systemd[1]: snapper-cleanup.service: Deactivated successfully.
sty 17 09:04:04 homeserver systemd[1]: snapperd.service: Deactivated successfully.
sty 17 09:04:10 homeserver usbhid-ups[15299]: Startup successful

:man_facepalming:
I forgot about:

systemctl start nut-server
systemctl enable nut-server

upsc UPS
battery.charge: 100
battery.charge.low: 30
battery.protection: yes
battery.runtime: 7010
battery.type: PbAc
device.mfr: EATON
device.model: Eaton 5E 900 G2
device.serial: BLANK
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: no
driver.parameter.vendorid: 0463
driver.version: 2.7.4
driver.version.data: MGE HID 1.39
driver.version.internal: 0.41
input.voltage: 241.0
outlet.1.status: on
outlet.desc: Main Outlet
outlet.id: 0
outlet.switchable: no
output.frequency: 50.0
output.frequency.nominal: 50
output.voltage: 241.0
output.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.firmware: 01.02.0009
ups.load: 6
ups.mfr: EATON
ups.model: Eaton 5E 900 G2
ups.power: 58
ups.power.nominal: 900
ups.productid: ffff
ups.realpower: 31
ups.realpower.nominal: 480
ups.serial: BLANK
ups.start.battery: yes
ups.status: OL
ups.timer.shutdown: 0
ups.timer.start: 0
ups.vendorid: 0463

1 Like