Using NUT for UPS monitoring on Alt-F

56 views
Skip to first unread message

Tom Schmidt

unread,
Mar 11, 2025, 6:19:54 PMMar 11
to Alt-F
I know that this is a 10 year old thread at https://groups.google.com/g/alt-f/c/Wtc6geFyypk that never got resolved.  I recently added an APC UPS behind my DNS-327L Alt-F 1.0 NAS (and some other hardware) that I likewise am trying to use NUT on.  After a reboot, the USB connection to the UPS is not seen by NUT unless I unplug the USB cable and plug it back into the DNS-327L.  I am using the NUT package from Entware-ng.

After a reboot, lsusb does see it, but NUT does not:

[root@nas1]# lsusb -tv
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=HID, Driver=usbhid, 1.5M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=orion-ehci/1p, 480M
[root@nas1]# dmesg | grep -i usb
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
orion-ehci d0050000.usb: EHCI Host Controller
orion-ehci d0050000.usb: new USB bus registered, assigned bus number 1
orion-ehci d0050000.usb: irq 27, io mem 0xd0050000
orion-ehci d0050000.usb: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 3
usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
hub 3-0:1.0: USB hub found
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
usb 2-1: new low-speed USB device number 2 using xhci_hcd
usb 2-1: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
usbcore: registered new interface driver usblp
usbcore: deregistering interface driver usblp
usbcore: registered new interface driver usblp
[root@nas1]# upsdrvctl start
Network UPS Tools - UPS driver controller 2.8.0
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
kill: No such process
Driver exited abnormally
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
kill: No such process
Driver exited abnormally
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
kill: No such process
Driver exited abnormally
[root@nas1]# upsd -u root
Network UPS Tools upsd 2.8.0
kill: No such process
listening on 127.0.0.1 port 3493
not listening on ::1 port 3493
/opt/var/run is world readable
Can't connect to UPS [apcups] (usbhid-ups-apcups): Connection refused
[root@nas1]# upsc apcups
Error: Connection failure: Connection refused

Unplug the USB cable of the UPS and plug it back in and repeat most of the above commands:

[root@nas1]# lsusb -tv
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    |__ Port 1: Dev 5, If 0, Class=HID, Driver=usbhid, 1.5M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=orion-ehci/1p, 480M
[root@nas1]# upsdrvctl start
Network UPS Tools - UPS driver controller 2.8.0
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
kill: No such process
Using subdriver: APC HID 0.98
[root@nas1]# upsd -u root
Network UPS Tools upsd 2.8.0
fopen /opt/var/run/upsd.pid: No such file or directory
Could not find PID file '/opt/var/run/upsd.pid' to see if previous upsd instance is already running!
listening on 127.0.0.1 port 3493
not listening on ::1 port 3493
/opt/var/run is world readable
Connected to UPS [apcups]: usbhid-ups-apcups
[root@nas1]# upsc apcups
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: not set
battery.mfr.date: 2024/11/06
battery.runtime: 1380
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 13.6
battery.voltage.nominal: 12.0
device.mfr: APC
device.model: Back-UPS ES 550
device.serial: XXXXXXXXXXX
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: auto
driver.version: 2.8.0
driver.version.data: APC HID 0.98
driver.version.internal: 0.47
driver.version.usb: libusb-1.0.22 (API: 0x1000106)
input.sensitivity: high
input.transfer.high: 139
input.transfer.low: 92
input.voltage: 122.0
input.voltage.nominal: 120
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 843.K2 .D
ups.firmware.aux: K2
ups.load: 18
ups.mfr: APC
ups.mfr.date: 2010/08/29
ups.model: Back-UPS ES 550
ups.productid: 0002
ups.serial: XXXXXXXXXXX
ups.status: OL
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d

Has there ever been a fix for this other than to unplug and replug the USB port after the Alt-F NAS reboots?

Thanks in advance!
Tom Schmidt
Alt-F contributor, running Alt-F 1.0 on DNS-323 and DNS-327L NAS devices

Joao Cardoso

unread,
Mar 13, 2025, 8:32:22 PMMar 13
to Alt-F
On Tuesday, March 11, 2025 at 10:19:54 PM UTC Tom Schmidt wrote:
I know that this is a 10 year old thread at https://groups.google.com/g/alt-f/c/Wtc6geFyypk that never got resolved.  I recently added an APC UPS behind my DNS-327L Alt-F 1.0 NAS (and some other hardware) that I likewise am trying to use NUT on.  After a reboot, the USB connection to the UPS is not seen by NUT unless I unplug the USB cable and plug it back into the DNS-327L.  I am using the NUT package from Entware-ng.

After a reboot, lsusb does see it, but NUT does not
 ...
[root@nas1]# dmesg | grep -i usb
...
According to  this post

> Dmesg output: hid-generic 0003:051D:0002.0001: device has no listeners, quitting
 
Does that appears also in your dmesg output? Your dmesg filtering might have removed it

Has there ever been a fix for this other than to unplug and replug the USB port after the Alt-F NAS reboots?

According to this post,

> The reason your UPS isn't recognized is because USB_HIDDEV is not defined in the kernel config of the Alt-F builds

I remember to have confirmed that at the time, and also checked on other places that it is indeed the culprit, so only a kernel rebuild will solve the issue.
My own kernels (5.4) have that defined now, but a new Alt-F release is pending by more than two years now... so there is not much hope.

João

Tom Schmidt

unread,
Mar 13, 2025, 9:26:10 PMMar 13
to al...@googlegroups.com
João,
    Thanks for the reply.  Yes, I do have the same error in dmesg.  Also, each time that I replug the USB port it increments the device number.  So currently dmesg has entries like this:

[root@nas1]# dmesg | egrep '(usb|051D)'
orion-ehci d0050000.usb: EHCI Host Controller
orion-ehci d0050000.usb: new USB bus registered, assigned bus number 1
orion-ehci d0050000.usb: irq 27, io mem 0xd0050000
orion-ehci d0050000.usb: USB 2.0 started, EHCI 1.00
usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
usb 2-1: new low-speed USB device number 2 using xhci_hcd
usb 2-1: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
hid-generic 0003:051D:0002.0001: device has no listeners, quitting
usbcore: registered new interface driver usblp
usb 2-1: USB disconnect, device number 2
usb 2-1: new low-speed USB device number 3 using xhci_hcd
usb 2-1: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
hid-generic 0003:051D:0002.0002: device has no listeners, quitting
usb 2-1: USB disconnect, device number 3
usb 2-1: new low-speed USB device number 4 using xhci_hcd
usb 2-1: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
hid-generic 0003:051D:0002.0003: device has no listeners, quitting

    I guess there is no fix until a new update for Alt-F is released.  I am quite proficient with Linux, so let me know if I can help in any way.  I have submitted a few fixes and enhancements for Alt-F 1.0.

Tom

--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/alt-f/45ccdcc9-35af-4010-bed2-9331f96e86fen%40googlegroups.com.

Bill R

unread,
Mar 15, 2025, 6:18:52 PMMar 15
to Alt-F
Tom,

I was in the same situation a few years back and ended up doing by own Alt-F build with USB_HIDDEV in the kernel config. It was a learning experience for me, and I ended up pulling in all the recent package commits as well as figuring out some other fixes on my own. I created a thread here over a year ago where I went through each step and João made a few additional suggestions that I followed. The firmware has been very stable for me. I only built for the 320/320L/325, so I can't guarantee you won't have a problem or other step unique to the 327L though. Unless any package source URLs have changed since I went through this, it should be a straightforward process overall. Happy to assist if you run into a problem.

Bill

Tom Schmidt

unread,
Mar 16, 2025, 12:10:32 AMMar 16
to al...@googlegroups.com
Thanks Bill for the response.  I will look for your previous thread about building the updates into the kernel.  We could take this offline from the forum if you want and report back the results.

Tom

Bill R

unread,
Mar 16, 2025, 11:47:39 AMMar 16
to Alt-F
Sure, you can PM me and I'll try to help.
Reply all
Reply to author
Forward
0 new messages