apc ups commlost

Started by JediFonger, July 20, 2026, 04:49:40 PM

Previous topic - Next topic
OPNsense 26.7-amd64
^running latest

any tips on gettin APC UPS battery connected via usb online? have os-nut & apcupsd installed but i got:
APC      : 001,017,0434
DATE     : 2026-07-16 00:46:52 -0400 
HOSTNAME : router.localdomain
VERSION  : 3.14.14 (31 May 2016) freebsd
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2026-07-16 00:46:44 -0400 
STATUS   : COMMLOST

usbconfig doesn't see it. on a windows box off the same connection it works perfectly fine. any tips?

I haven't made the switch to OPNsense 26.7 yet.

Was Apcupsd communicating with the UPS just prior to the upgrade to 26.7?

Have you ruled out the USB port by plugging the cable in to other USB ports on OPNsense firewall?

Have you ruled out the USB cable by using another known working cable?

Another test is to disable Apcupsd and configure NUT to monitor the UPS using the UPS Type 'USBHID-Driver' and see if it is able to communicate with the UPS.

i honestly can't remember because i this setup is new and i coulda sworn it worked? maybe, but i was plugging it in at the same time i was upgrading to 26.7. maybe i dreamt it, i dunno if there logs to check.

it's not the UPS/cable because i can take my w11 laptop plug it in and everything is detected and APC UPS software can see it everything works 100% fine.

currently os-nut tool service isn't running, i assume it's supposed to run? i dunno. i haven't ever gotten this to work yet, but i suspect usbconfig not detecting the ups is probably a big issue.

Quote from: lmoore on Today at 05:27:49 AMI haven't made the switch to OPNsense 26.7 yet.

Was Apcupsd communicating with the UPS just prior to the upgrade to 26.7?

Have you ruled out the USB port by plugging the cable in to other USB ports on OPNsense firewall?

Have you ruled out the USB cable by using another known working cable?

Another test is to disable Apcupsd and configure NUT to monitor the UPS using the UPS Type 'USBHID-Driver' and see if it is able to communicate with the UPS.

Quote from: JediFonger on Today at 06:58:36 AMcurrently os-nut tool service isn't running, i assume it's supposed to run?

- This may be the cause of os-nut service not running on you system - https://github.com/opnsense/plugins/issues/5387
- Apply a patch to 26.7 to fix an OPNsense display issue affecting NUT - https://forum.opnsense.org/index.php?topic=52380.msg270981#msg270981

In the past, I did find that when apcupsd initiated a shutdown of OPNsense, it would simply halt the system rather than power it off. If your UPS was commanded to got to sleep/hibernate x number of seconds after shut down, you might be alright, otherwise, if the utility power returns before the UPS has gone off and the UPS is not configured to power-cycle itself after such an event, one would need to forcibly power-cycle the OPNsense box as even a PS2 keyboard is useless at this point - see https://github.com/opnsense/plugins/issues/5383.

My OPNsense test box is currently off as I have other test machines on the bench. It will be a few days at least before I can perform any tests with OPNsense.

If either of the two issues in GitHub are at play and affecting you, you'd be better off disabling Apcupsd and using NUT and the USB driver mentioned earlier.

This is my /usr/local/etc/rc.d/nut

#!/bin/sh

# PROVIDE: nut
# REQUIRE: NETWORKING devfs devd syslogd apcupsd
# BEFORE: local
# KEYWORD: shutdown

before i updated it, there was no apcupsd and BEFORE was LOGIN

i applied this, rebooted and os-nut tool still isn't running.

as for the os-nut fix, i applied that already and that got my nut gui to open. i followed the first link instructions and still no dice... am i suppose to remove the # marks?


Quote from: lmoore on Today at 10:22:53 AM
Quote from: JediFonger on Today at 06:58:36 AMcurrently os-nut tool service isn't running, i assume it's supposed to run?

- This may be the cause of os-nut service not running on you system - https://github.com/opnsense/plugins/issues/5387
- Apply a patch to 26.7 to fix an OPNsense display issue affecting NUT - https://forum.opnsense.org/index.php?topic=52380.msg270981#msg270981

In the past, I did find that when apcupsd initiated a shutdown of OPNsense, it would simply halt the system rather than power it off. If your UPS was commanded to got to sleep/hibernate x number of seconds after shut down, you might be alright, otherwise, if the utility power returns before the UPS has gone off and the UPS is not configured to power-cycle itself after such an event, one would need to forcibly power-cycle the OPNsense box as even a PS2 keyboard is useless at this point - see https://github.com/opnsense/plugins/issues/5383.

My OPNsense test box is currently off as I have other test machines on the bench. It will be a few days at least before I can perform any tests with OPNsense.

If either of the two issues in GitHub are at play and affecting you, you'd be better off disabling Apcupsd and using NUT and the USB driver mentioned earlier.

To my knowledge APCupsd and NUT are completely separate software packages. Why are you trying to run both?
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: JediFonger on Today at 02:40:12 PMbefore i updated it, there was no apcupsd and BEFORE was LOGIN

That was a suggested fix for upstream port in FreeBSD. If this isn't in the default package installation on OPNsense, don't change it.

I would like to think that what is reported in the two issues is enough to dissuade you from using apcupsd.

I would advise you revert the change to the script and disable apcupsd and use NUT with the USBHID-Driver.

In relation to the problem you reported, it is unclear the USB ports on your OPNsense firewall are working. Perhaps an easy way to check this is to connect a USB keyboard, attach a screen to the display and see if keystrokes are reflected on the screen, maybe even log on to OPNsense.

Quote from: lmoore on Today at 03:25:55 PMIn relation to the problem you reported, it is unclear the USB ports on your OPNsense firewall are working.

Or with the UPS plugged in, in a root shell type:

usbconfig
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: Patrick M. Hausen on Today at 02:49:56 PMTo my knowledge APCupsd and NUT are completely separate software packages. Why are you trying to run both?

Hi Patrick,

NUT includes the driver APCUPSD-Driver and it may tempt some users to use it.

I see very little benefit in using APCupsd, whether it is used on its own or with NUT. However, considering the NUT service fails to start when APCupsd is enabled, it doesn't make for a reliable environment

When using NUT and a driver other than APCUPSD-Driver, there are some settings you cannot apply to an APC UPS over the USB port like you can when using a serial port.

That said and having had to replace a UPS recently, modern APC UPS's have control panels where you can go in and adjust the settings - fiddly, but doable.

Quote from: lmoore on Today at 03:47:17 PMNUT includes the driver APCUPSD-Driver and it may tempt some users to use it.

From the thread I got the impression they were trying to install and run the standalone apcupsd alongside NUT which probably won't work.
There is an os-apcupsd plugin. Don't run that if you intend to run NUT and vice versa.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

https://www.reddit.com/r/opnsense/comments/1mxg4lj/connected_an_apc_ups_which_plugin_nut_or_apcupsd/
^this thread says to use both

Quote from: Patrick M. Hausen on Today at 02:49:56 PMTo my knowledge APCupsd and NUT are completely separate software packages. Why are you trying to run both?



i reverted script and rebooted back to where it was.

either os-nut standalone or apcupsd standalone is working.

i've been using usb keyb on the console & also have mounted usb hdd on it, no problem. so the usb is working fine. and the ups's cable and port is also working as i stated from other laptop tests. it seems like the router hw is not 'seeing' ups usb. on other linux distros i could lspci, but i dunno how fbsd does things and especially how opnsense does stuff.


Quote from: lmoore on Today at 03:25:55 PM
Quote from: JediFonger on Today at 02:40:12 PMbefore i updated it, there was no apcupsd and BEFORE was LOGIN

That was a suggested fix for upstream port in FreeBSD. If this isn't in the default package installation on OPNsense, don't change it.

I would like to think that what is reported in the two issues is enough to dissuade you from using apcupsd.

I would advise you revert the change to the script and disable apcupsd and use NUT with the USBHID-Driver.

In relation to the problem you reported, it is unclear the USB ports on your OPNsense firewall are working. Perhaps an easy way to check this is to connect a USB keyboard, attach a screen to the display and see if keystrokes are reflected on the screen, maybe even log on to OPNsense.


# usbconfig
ugen2.1: <EHCI root HUB Intel> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.1: <XHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen1.1: <EHCI root HUB Intel> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen2.2: <8 channel internal hub Intel Corp.> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.2: <Hub Intel Corp.> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)


Quote from: Patrick M. Hausen on Today at 03:45:33 PM
Quote from: lmoore on Today at 03:25:55 PMIn relation to the problem you reported, it is unclear the USB ports on your OPNsense firewall are working.

Or with the UPS plugged in, in a root shell type:

usbconfig


currently, i removed apcupsd & os-nut tool service is still not running.

Quote from: lmoore on Today at 03:47:17 PM
Quote from: Patrick M. Hausen on Today at 02:49:56 PMTo my knowledge APCupsd and NUT are completely separate software packages. Why are you trying to run both?

Hi Patrick,

NUT includes the driver APCUPSD-Driver and it may tempt some users to use it.

I see very little benefit in using APCupsd, whether it is used on its own or with NUT. However, considering the NUT service fails to start when APCupsd is enabled, it doesn't make for a reliable environment

When using NUT and a driver other than APCUPSD-Driver, there are some settings you cannot apply to an APC UPS over the USB port like you can when using a serial port.

That said and having had to replace a UPS recently, modern APC UPS's have control panels where you can go in and adjust the settings - fiddly, but doable.

apcupsd and NUT work together without any issues. I use apcupsd alongside NUT because it provides features such as automatic shutdown of the OPNsense host and configurable battery thresholds.

Since the NUT configuration in OPNsense doesn't work properly, I'm using apcupsd alongside it.

nut.conf, upsd.conf, ups.conf ...etc configure not working


Quote from: Patrick M. Hausen on Today at 03:51:49 PM
Quote from: lmoore on Today at 03:47:17 PMNUT includes the driver APCUPSD-Driver and it may tempt some users to use it.

From the thread I got the impression they were trying to install and run the standalone apcupsd alongside NUT which probably won't work.
There is an os-apcupsd plugin. Don't run that if you intend to run NUT and vice versa.