[Nut-upsuser] NUT 2.8.0-7 with Rasp Pi5 bookworm error driver

Andrea Santiccioli santiccioli.andrea at verabox.org
Tue Feb 11 21:13:19 GMT 2025


Hello everyone,
I am a italian basic user with a problem using NUT and Raspberry Pi 5 Bookworm.
Version NUT 2.8.0-7
i have APC i have used driver: usbhid-ups
I successfully used NUT on Raspberry Pi 3 and Bullseye without any issues.
I changed the Raspberry Pi and the operating system version, and now it no longer works.

sudo systemctl stop nut-server.service
/path/to/driver -DD -a nomeups

/path/to/driver: No such file or directory

The main issue is that notifications are not being received.
The obvious error occurs when I try to execute:

---------
sudo systemctl restart nut-driver.service

Failed to restart nut-driver.service: Unit nut-driver.service not found.

---------------------

If I run lsusb, I get this output:

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 046d:c077 Logitech, Inc. Mouse
Bus 003 Device 004: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 046d:c34b Logitech, Inc. USB Keyboard
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

------------------------------------

upsc nomeups

Init SSL without certificate database
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: 2001/09/25
battery.mfr.date: 2014/09/27
battery.runtime: 4405
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 27.0
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Back-UPS RS 900G
device.serial: 3B
device.type: ups
[driver.nam](http://driver.name)e: 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.26 (API: 0x1000109)
input.sensitivity: medium
input.transfer.high: 294
input.transfer.low: 176
input.voltage: 224.0
input.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 879.L4 .I
ups.firmware.aux: L4
ups.load: 7
ups.mfr: American Power Conversion
ups.mfr.date: 2014/09/27
ups.model: Back-UPS RS 900G
ups.productid: 0002
ups.realpower.nominal: 540
ups.serial: 3B
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d

----------------------------------

This is the configuration I set up, and I also installed an email sending service.

----------------------
/etc/nut/ups.conf
[nomeups]
driver = usbhid-ups
port = auto
#maxretry = 3

---------------------------

/etc/nut/upsd.users
[andreanut]
password = password123
andreanut master

--------------------------------
/etc/nut/upsmon.conf

NOTIFYCMD /etc/nut/notifycmd.sh

#SHUTDOWNCMD "/sbin/shutdown -h +0"

NOTIFYMSG ONLINE "UPS %s on line power"
NOTIFYMSG ONBATT "UPS %s on battery"
NOTIFYMSG LOWBATT "UPS %s battery is low"
NOTIFYMSG FSD "UPS %s: forced shutdown in progress"
NOTIFYMSG COMMOK "Communications with UPS %s established"
NOTIFYMSG COMMBAD "Communications with UPS %s lost"
NOTIFYMSG SHUTDOWN "Auto logout and shutdown proceeding"
NOTIFYMSG REPLBATT "UPS %s battery needs to be replaced"
NOTIFYMSG NOCOMM "UPS %s is unavailable"
NOTIFYMSG NOPARENT "upsmon parent process died - shutdown impossible"

ONLINE : UPS is back online
ONBATT : UPS is on battery
LOWBATT : UPS has a low battery (if also on battery, it's "critical")
FSD : UPS is being shutdown by the primary (FSD = "Forced Shutdown")
COMMOK : Communications established with the UPS
COMMBAD : Communications lost to the UPS
SHUTDOWN : The system is being shutdown
REPLBATT : The UPS battery is bad and needs to be replaced
NOCOMM : A UPS is unavailable (can't be contacted for monitoring)
NOPARENT : The process that shuts down the system has died (shutdown impossible)

NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC
NOTIFYFLAG FSD SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC
NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC
NOTIFYFLAG NOPARENT SYSLOG+WALL+EXEC

MONITOR nomeups at localhost 1 andreanut password123 master

------------------------------------------

/etc/nut/nut.conf

MODE=netserver

------------------------------------

/etc/nut/upsd.conf

LISTEN 0.0.0.0 3493

----------------------------------

I installed Apache:

apache2 nut-cgi

Enabled the CGI module:

a2enmod cgi

---------------------------------

/etc/nut/hosts.conf
MONITOR nomeups at localhost "UPS APC COMPUTER"

------------------------------------

sudo systemctl restart apache2

I installed msmtp for email sending:

sudo apt install msmtp
sudo nano /etc/msmtprc

defaults
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log
account gmail
host smtp.gmail.com
port 587
from youremail at gmail.com
user youremail at gmail.com
password yourAppPassword
account default : gmail

---------------------------------

sudo nano /etc/nut/notifycmd.sh
#!/bin/bash
EMAIL='email'
echo -e "Subject: $HOSTNAME ALERT: $NOTIFYTYPE\n\nUPS: $UPSNAME\r\nAlert type: $NOTIFYTYPE\n\n$UPSNAME: $*" | msmtp $EMAIL

------------------------------

sudo chown :nut /etc/nut/notifycmd.sh
sudo chmod 774 /etc/nut/notifycmd.sh
sudo systemctl restart nut-server.service
sudo systemctl restart nut-driver.service

Failed to restart nut-driver.service: Unit nut-driver.service not found.

sudo systemctl restart nut-monitor.service

-------------------------------

Now, if I go to the link:
http://xxx.xxx.xxx.xxx/cgi-bin/nut/upsstats.cgi
it works and is recognized, but notifications do not arrive, and even if I try to restart the driver, it still fails.

Please please help me! ThanksAndrea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20250211/b7ffe355/attachment-0001.htm>


More information about the Nut-upsuser mailing list