Versions Compared

Key

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

Table of Contents

Master Setup

Connect UPS using USP cable


Installation

Code Block
$ sudo apt-get install nut


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


Add the following config

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


Update Nut.Conf

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


Set Mode=netserver

Code Block
MODE=netserver


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@localhost



Client Setup

Installation

Install nut-client

Code Block
$ sudo apt-get install nut-client


Configure

Update nut-config

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

...

  • upsname = qnapups
  • user = admin
  • password = 123456


Restart Nut Client

Restart nut client:

Code Block
$ systemctl restart nut-client


Get Status of Nut Client

Get Status:

Code Block
$ systemctl status nut-client

...

Code Block
● nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller
     Loaded: loaded (/lib/systemd/system/nut-monitor.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-08-24 12:39:49 EDT; 2s ago
    Process: 162230 ExecStart=/sbin/upsmon (code=exited, status=0/SUCCESS)
   Main PID: 162234 (upsmon)
      Tasks: 2 (limit: 19043)
     Memory: 1.1M
     CGroup: /system.slice/nut-monitor.service
             ├─162231 /lib/nut/upsmon
             └─162234 /lib/nut/upsmon

Aug 24 12:39:49 deepthought systemd[1]: Starting Network UPS Tools - power device monitor and shutdown controller...
Aug 24 12:39:49 deepthought upsmon[162230]: fopen /run/nut/upsmon.pid: No such file or directory
Aug 24 12:39:49 deepthought upsmon[162230]: UPS: qnapups@192.168.1.60 (slave) (power value 1)
Aug 24 12:39:49 deepthought upsmon[162230]: Using power down flag file /etc/killpower
Aug 24 12:39:49 deepthought systemd[1]: nut-monitor.service: Can't open PID file /run/nut/upsmon.pid (yet?) after start: Operation not permi>
Aug 24 12:39:49 deepthought upsmon[162231]: Startup successful
Aug 24 12:39:49 deepthought systemd[1]: nut-monitor.service: Supervising process 162234 which is not our child. We'll most likely not notice>
Aug 24 12:39:49 deepthought systemd[1]: Started Network UPS Tools - power device monitor and shutdown controller.


Check connection 

Check Connection:

Code Block
$ upsc qnapups@192.168.1.60

...