[SOLVED] UPS and power management

Questions about hardware,drivers and peripherals
Forum rules
Before you post please read how to get help
nraygun
Level 1
Level 1
Posts: 8
Joined: Fri May 26, 2017 8:36 am

[SOLVED] UPS and power management

Postby nraygun » Tue Sep 12, 2017 11:19 pm

I have a Cyberpower UPS connected via USB and I've tried using their software but it doesn't seem to work properly.
It shuts down the system on loss of power, but then the whole UPS reboots afterwards. Strange.

Anyway, I just want the system to shutdown when it goes on UPS power for a few minutes. I don't see many options in Power Management in Preferences. The only option available is in "Extra Options" with an entry that says "When the battery is critically low" and the option is a single "Do nothing". There is no setting to determine what "critically low" is. I tried using dconf, but the settings there don't seem to affect what I see in Power Management.

There is a "Batteries" area, but it only shows the UPS and the percent charged.

Seems like something is missing in Power Management.

Any suggestions? Linux Mint 18.2 (upgraded from 18.1)
Last edited by nraygun on Wed Sep 13, 2017 9:54 pm, edited 2 times in total.

User avatar
phd21
Level 13
Level 13
Posts: 4910
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: UPS and power management

Postby phd21 » Wed Sep 13, 2017 1:51 am

Hi "nraygun",

It would help to know more about your system setup. If you run "inxi -Fxzd" and "lsusb" from the console terminal prompt, highlight the results, copy and paste them back here, that should provide enough information.


What specific model of Cyberpower UPS do you have and how is it connected to your system? Is it new or older? If new model, did you connect the battery and did you fully charge it before using it? If older model, then the battery may need replacing. Did you install their software from their disc, or their website or from within the Mint Repositories (Software Manager or Synaptic Package Manager (SPM))? Sounds too me like you might not have one of their software settings enabled or correctly applied. Can you provide any screenshots?


Hope this helps ...
Phd21: Mint KDE 17.3 & 18.2, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,3gb Ram,160gb hdd, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

nraygun
Level 1
Level 1
Posts: 8
Joined: Fri May 26, 2017 8:36 am

Re: UPS and power management

Postby nraygun » Wed Sep 13, 2017 9:30 am

Thanks for taking a look!

It's a new Cyberpower 1000AVR LCD connected via USB. I'm using their PowerPanel Linux software that I downloaded from their website (.deb file). It's fully charged. I have their support engaged. I configured the UPS with this command per their support:

Code: Select all

sudo pwrstat -pwrfail -delay 0 -active on -cmd /etc/pwrstatd-powerfail.sh -duration 1 -shutdown on

If I run the above command, then unplug the UPS, the system shuts down. But then the UPS goes into a countdown for 10 minutes, and counts down the last minute in seconds. It displays a "d" when in this mode. After this elapses, it goes into another mode for 10 seconds while displaying a "U". The UPS then reboots. When it does all this countdown business, I plug the unit back into he AC and boot up the PC. When the timers on the UPS elapse, my PC looses power.

Here is the other info you requested. It's my son's old Lenovo system that I moved into a new case with a new graphics card. Runs pretty well.

Screen shots in attached files. I don't see any options to shutdown the machine when on battery in the Power Management panel.

Code: Select all

$ inxi -Fxzd
System:    Host: m-lenovo Kernel: 4.4.0-93-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.4.6 (Gtk 3.18.9-1ubuntu3.3)
           Distro: Linux Mint 18.2 Sonya
Machine:   System: LENOVO product: Lenovo H330 v: Lenovo
           Mobo: LENOVO model: N/A Bios: LENOVO v: DLKT22AUS date: 05/23/2011
CPU:       Dual core Intel Core i3-2120 (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 13170
           clock speeds: max: 3300 MHz 1: 2266 MHz 2: 1960 MHz 3: 1835 MHz
           4: 2199 MHz
Graphics:  Card: NVIDIA Device 1c81 bus-ID: 01:00.0
           Display Server: X.Org 1.18.4 drivers: nvidia (unloaded: fbdev,vesa,nouveau)
           Resolution: 1680x1050@59.95hz, 1440x900@59.89hz
           GLX Renderer: GeForce GTX 1050/PCIe/SSE2
           GLX Version: 4.5.0 NVIDIA 375.66 Direct Rendering: Yes
Audio:     Card-1 NVIDIA Device 0fb9 driver: snd_hda_intel bus-ID: 01:00.1
           Card-2 Intel 6 Series/C200 Series Family High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Sound: Advanced Linux Sound Architecture v: k4.4.0-93-generic
Network:   Card-1: Intel 82579V Gigabit Network Connection
           driver: e1000e v: 3.2.6-k port: f040 bus-ID: 00:19.0
           IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
           Card-2: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express)
           driver: ath9k bus-ID: 03:00.0
           IF: wlp3s0 state: down mac: <filter>
Drives:    HDD Total Size: 1500.3GB (6.4% used)
           ID-1: /dev/sda model: ST31500341AS size: 1500.3GB
           Optical: /dev/sr0 model: Optiarc DVD RW AD-7250H
           rev: 1.D2 dev-links: cdrom,cdrw,dvd,dvdrw
           Features: speed: 40x multisession: yes
           audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r,dvd-ram state: running
Partition: ID-1: / size: 1.4T used: 82G (7%) fs: ext4 dev: /dev/sda1
           ID-2: swap-1 size: 8.57GB used: 0.00GB (0%) fs: swap dev: /dev/sda5
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 39.0C mobo: N/A gpu: 0.0:32C
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 221 Uptime: 10:39 Memory: 2487.7/7966.3MB
           Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35

Code: Select all

$ lsusb
Bus 002 Device 003: ID 04f2:0976 Chicony Electronics Co., Ltd
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

User avatar
phd21
Level 13
Level 13
Posts: 4910
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: UPS and power management

Postby phd21 » Wed Sep 13, 2017 9:49 pm

Hi "nraygun",

You are welcome.

Sorry for not getting back sooner, still cleaning up after hurricane Irma...

Where is the screenshot or output of the CyberPower software command below? You can copy and paste text output back here. Is there a desktop application in your menu for this, or is it only from the console terminal command prompt? I do not have a functioning UPS at the moment, and the one I have is APC using different software, so I cannot actually test this for you...

Code: Select all

pwrstat -status



Troubleshooting CyberPower PowerPanel issues in Linux, July 25, 2017
https://major.io/2017/07/25/troubleshooting-cyberpower-powerpanel-issues-in-linux/

YouTube Video - CyberPower PowerPanel: Control Your UPS from Linux!
https://www.youtube.com/watch?v=K0nZ4-8z5WQ


ArchLinux on CyberPower UPS and more
https://wiki.archlinux.org/index.php/CyberPower_UPS


Hope this helps ...
Phd21: Mint KDE 17.3 & 18.2, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,3gb Ram,160gb hdd, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

nraygun
Level 1
Level 1
Posts: 8
Joined: Fri May 26, 2017 8:36 am

Re: UPS and power management

Postby nraygun » Wed Sep 13, 2017 9:52 pm

Hey there! I think I got it.
I uninstalled CyberPower's "powerpanel" software and then just edited UPower.conf in /etc/UPower and I got what I need.
Shortly after the AC is lost, my machine shuts down. Perfecto!
Would be nice if these parameters were exposed in the Power Management area of System Settings.
Oh well, close enough.


Return to “Hardware Support”