Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
$ sudo apt-get install nut

Setup

Configure ups.conf

Code Block
$ vi /etc/nut/ups.conf

...

Add the following config

Code Block
[homeupsqnapups]
  driver = usbhid-ups
    port = auto
    desc = "Back-UPS ES 750"


Update Credentials

Code Block
$ sudo vi /etc/nut/upsd.users


Code Block
[admin]
  password = 123456
  actions = SET
  instcmds = ALL

[upsmon]
  password = 123456
  upsmon master



Update Nut.Conf

Code Block
$ sudo vi /etc/nut/nut.conf 

...

Set Mode=netserver

Code Block
MODE=netserver


Setup upsmon.conf

Code Block
$ vi /etc/nut/upsmon.conf


Add the following line

Code Block
MONITOR qnapups@localhost 1 upsmon 123456 master



Verify Hardware Config

Code Block
$ sudo upsdrvctl start 


Restart the Service

Code Block
$ sudo service nut-server restart


Get Status

Code Block
$ sudo service nut-server status

● nut-server.service - Network UPS Tools - power devices information server
   Loaded: loaded (/lib/systemd/system/nut-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2021-08-24 20:28:53 EDT; 7s ago
  Process: 12995 ExecStart=/sbin/upsd (code=exited, status=0/SUCCESS)
 Main PID: 12996 (upsd)
    Tasks: 1 (limit: 877)
   CGroup: /system.slice/nut-server.service
           └─12996 /lib/nut/upsd

Aug 24 20:28:53 pihole systemd[1]: Starting Network UPS Tools - power devices information server...
Aug 24 20:28:53 pihole upsd[12995]: fopen /var/run/nut/upsd.pid: No such file or directory
Aug 24 20:28:53 pihole upsd[12995]: listening on 127.0.0.1 port 3493
Aug 24 20:28:53 pihole upsd[12995]: listening on ::1 port 3493
Aug 24 20:28:53 pihole upsd[12995]: listening on 127.0.0.1 port 3493
Aug 24 20:28:53 pihole upsd[12995]: Connected to UPS [homeups]: usbhid-ups-homeups
Aug 24 20:28:53 pihole upsd[12995]: listening on ::1 port 3493
Aug 24 20:28:53 pihole upsd[12995]: Connected to UPS [homeups]: usbhid-ups-homeups
Aug 24 20:28:53 pihole systemd[1]: Started Network UPS Tools - power devices information server.
Aug 24 20:28:53 pihole upsd[12996]: Startup successful


Query the UPS

Code Block
$ upsc homeups@localhostqnapups@localhost



Test 

Code Block




Client Setup

Installation

Install nut-client

...

Code Block
$ upsc qnapups@192.168.1.60



References

ReferenceURL
Raspberry Pi Home Server v2: Network UPS Toolshttps://melgrubb.com/2016/12/11/rphs-v2-ups/