1. Flash & Boot your Pi
- Flash Raspberry Pi OS Lite (64-bit recommended) to an SD-card.
- Enable SSH (create empty
sshfile in/boot). - Power up,
ssh pi@<local-ip>and update:sudo apt update && sudo apt full-upgrade -y
2. Plug-in & Identify the UPS
Connect the UPS via USB and run:
lsusb
Look for a line likeBus 001 Device 00X: ID 051d:0002 American Power Conversion …
Note the VendorID (051d) & ProductID (0002).
3. Install NUT on the Pi
sudo apt install nut nut-server nut-client
4. Configure the UPS driver
Edit /etc/nut/ups.conf:
sudo nano /etc/nut/ups.conf
Paste (adjust IDs if different):
[myups]
driver = usbhid-ups
port = auto
desc = "APC Back-UPS 950VA"
vendorid = 051d
productid = 0002
Save (Ctrl+O, Enter, Ctrl+X).
5. Create NUT users
Edit /etc/nut/upsd.users:
sudo nano /etc/nut/upsd.users
[admin]
password = secret
actions = SET
instcmds = ALL
6. Tell NUT to act as a server
Edit /etc/nut/nut.conf:
sudo nano /etc/nut/nut.conf
Change:
MODE=netserver
7. Allow LAN clients
Edit /etc/nut/upsd.conf:
sudo nano /etc/nut/upsd.conf
Add:
LISTEN 0.0.0.0 3493
8. Start services
sudo systemctl restart nut-driver@myups
sudo systemctl restart nut-server
sudo systemctl enable nut-server
9. Firewall (optional)
Open port 3493:
sudo ufw allow 3493/tcp
10. Quick smoke-test from Pi itself
upsc myups@localhost
You should see a long list of UPS variables.
11. Install Windows client
- Download WinNUT-Client from
https://github.com/gawindx/WinNUT-Client/releases
(choose the.exeinstaller). - Run the installer → reboot if needed.
12. Configure WinNUT
- Launch WinNUT-Client.
- Connection tab:
- Host:
<ip-of-your-pi> - Port:
3493 - Username:
admin - Password:
secret - UPS Name:
myups
- Host:
- Shutdown tab → set battery %, runtime, etc.
- Click Save & Connect; status should turn green.
13. Pull-the-plug test
- Unplug the UPS from mains (keep USB cable).
- Within seconds WinNUT should show On Battery.
- After your configured thresholds, Windows will gracefully shut down.
14. (Optional) Pretty web dashboard on the Pi
sudo apt install apache2 nut-cgi
sudo nano /etc/nut/hosts.conf
Add:
MONITOR myups@localhost "APC on Pi"
Restart Apache:
sudo systemctl restart apache2
Visit http://<pi-ip>/cgi-bin/nut/upsstats.cgi
15. Done!
Your Pi is now the NUT master and Windows the client.
One-line Service Restart
sudo systemctl restart nut-driver@myups && sudo systemctl restart nut-server
Leave a Reply