Raspiblitz: APC UPS Configure thru UI & and auto-reinstall after PowerShutdown

Created on 6 Aug 2019  ·  4Comments  ·  Source: rootzoll/raspiblitz

Somehow after the APC UPS feature from #707 is making a emergency powershotdown after booting up the apcupsd service is "inactive" - blitz-ups.sh status giving a "n/a" and the complete ups feature needs to be reinstalled to get it working again with:

/home/admin/config.scripts/blitz-ups.sh off
/home/admin/config.scripts/blitz-ups.sh on apcusb

Thats OK for the experimental implementation within v1.3 but for the future this should be fixed automatically on bootup also letting the user know that a power emergency shutdown was happening (maybe call the XXshutdown script from apcupsd with an extra parameter).

Also make it possible for the future to activate/set the UPS by the shell GUI from main/settings menu.

hackathon

All 4 comments

I wonder if it would be possible to make this functionality more generic.

https://github.com/networkupstools/nut/

A lot of different UPS seems to be supported.

https://networkupstools.org/stable-hcl.html

@NilByte the NUT project a great find - I mark and an idea for v1.8 release. Also any experience report welcome of someone getting this running on the RaspiBlitz.

Sound great.

There is an article here referring to a Rasberry Pi package.

https://openschoolsolutions.org/shutdown-servers-case-power-failure%E2%80%8A-%E2%80%8Aups-nut-co/

sudo apt-get install nut-client nut-server usbutils

Also some installation and removal scripts that might inspire here:

https://www.raspberrypi.org/forums/viewtopic.php?t=240651#p1508882

I have Nut installed and most of it seems straight forward. I have some challenges on getting shutdown timed with the specific driver for my UPS but besides that I'm quite impressed by number of UPS supported and the documentation available.

admin@raspberrypi:~ $ lsusb
Bus 002 Device 002: ID 2109:0715 VIA Labs, Inc.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 04b4:5500 Cypress Semiconductor Corp. HID->COM RS232 Adapter
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
admin@raspberrypi:~ $ sudo systemctl status nut-server
● 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 Sat 2020-12-12 13:58:40 GMT; 1min 14s ago
  Process: 29609 ExecStart=/sbin/upsd (code=exited, status=0/SUCCESS)
 Main PID: 29610 (upsd)
    Tasks: 1 (limit: 4915)
   Memory: 464.0K
   CGroup: /system.slice/nut-server.service
           └─29610 /lib/nut/upsd

Dec 12 13:58:40 raspberrypi upsd[29609]: listening on 127.0.0.1 port 3493
Dec 12 13:58:40 raspberrypi upsd[29609]: listening on 192.168.1.105 port 3493
Dec 12 13:58:40 raspberrypi upsd[29609]: listening on 127.0.0.1 port 3493
Dec 12 13:58:40 raspberrypi upsd[29609]: Connected to UPS [UPS-1]: riello_usb-UPS-1
Dec 12 13:58:40 raspberrypi upsd[29609]: Connected to UPS [UPS-1]: riello_usb-UPS-1
Dec 12 13:58:40 raspberrypi upsd[29610]: Startup successful
Dec 12 13:58:40 raspberrypi systemd[1]: Started Network UPS Tools - power devices information server.
Dec 12 13:58:40 raspberrypi upsd[29610]: User [email protected] logged into UPS [UPS-1]
Dec 12 13:58:52 raspberrypi upsd[29610]: User [email protected] logged out from UPS [UPS-1]
Dec 12 13:58:52 raspberrypi upsd[29610]: User [email protected] logged into UPS [UPS-1]
admin@raspberrypi:~ $ upsc UPS-1
Init SSL without certificate database
battery.capacity: 7
battery.charge: 255
battery.runtime: 3932100
battery.voltage: 13.5
battery.voltage.nominal: 12
device.mfr: RPS S.p.a.
device.model: UNV1
device.serial:
device.type: ups
driver.name: riello_usb
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: no
driver.version: 2.7.4
driver.version.internal: 0.03
input.bypass.frequency: 409.50
input.bypass.voltage: 4095
input.frequency: 50.00
input.voltage: 227
output.frequency: 50.00
output.frequency.nominal: 50.0
output.L1.current: 0
output.L1.power: 0
output.L1.realpower: 0
output.L2.current: 0
output.L2.power: 0
output.L2.realpower: 0
output.L3.current: 0
output.L3.power: 0
output.L3.realpower: 0
output.power.percent: 0
output.voltage: 221
output.voltage.nominal: 230
ups.firmware: SWM038-01-02
ups.load: 0
ups.mfr: RPS S.p.a.
ups.model: UNV1
ups.power.nominal: 400
ups.productid: 5500
ups.realpower.nominal: 240
ups.serial:
ups.status: OL
ups.temperature: 255
ups.vendorid: 04b4
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kixunil picture Kixunil  ·  3Comments

rootzoll picture rootzoll  ·  4Comments

shawnyeager picture shawnyeager  ·  4Comments

pkclyoni picture pkclyoni  ·  3Comments

tiero picture tiero  ·  4Comments