User Tools

Site Tools


doc:appunti:hardware:ups_apc

This is an old revision of the document!


Using APC UPS on Debian GNU/Linux

I used two different UPS units to provide power to a Dell PowerEdge T110 (with two 4 Tb hard disks), a DSL router and an 8 ports switch. The equipments drawn about 62 W. The first UPS is an APC Smart-UPS 750 USB purchased in 2006, the second one is a APC Back-UPS CS 500 purchased in 2022.

The APC Back-UPS CS 500 should be able to supply power for about 30 minutes; doing battery calibration with the apctest tool, it took about 10 minutes to drop from 100% battery charge to 70%.

APC Smart-UPS 750 USB

L'apparato ha dimensioni 14 x 36 x 16 cm (larghezza, profondità, altezza) ed è equipaggato con due batterie sostituibili dall'utente di dimensioni 151 x 65 x 97.5 mm, attacchi Faston F2 (6.35 mm) ed una capacità di 12 v 7.0 Ah*. It is used to protect a Dell PowerEdge T110 (with two 4 Tb hard disks), a DSL router and an 8 ports switch. The equipments drawn about 62 W. Installare il pacchetto apcupsd. Per visualizzare convenientemente lo stato dell'UPS si può usare l'interfaccia web fornita dal pacchetto apcupsd-cgi oppure l'interfaccia gtk di gapcmon. Il kernel dovrebbe riconoscere il device appena collegato il cavo USB: <file> usb 1-2: new low speed USB device using uhci_hcd and address 3 usb 1-2: configuration #1 chosen from 1 choice usbcore: registered new interface driver hiddev hiddev96: USB HID v1.10 Device [American Power Conversion Smart-UPS 750 FW:651.13.I USB FW:7.3] on usb-0000:00:1d.0-2 usbcore: registered new interface driver usbhid drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver </file> Il device dovrebbe essere /dev/usb/hiddev0 (con un kernel 2.6). Per debug controllare <code> cat /proc/bus/usb/devices ls -l /sys/bus/usb/drivers/ ls -la /dev/usb/hiddev0 </code> Se si è installato il pacchetto apcupsd-cgi si può puntare il browser su http://localhost/cgi-bin/apcupsd/multimon.cgi. ===== Configurazione di apcupsd ===== Editare opportunamente il file /etc/apcupsd/apcupsd.conf, si specifica il tipo di cavo, il protocollo e si chiede di fare l'autodetect del device: <file> UPSCABLE usb UPSTYPE usb DEVICE </file> Per i vecchi sistemi basati sugli initscript sysv bisogna editare anche il file /etc/default/apcupsd, mettendo: <file> ISCONFIGURED=yes </file> Gli altri parametri importanti sono le soglie a cui iniziare lo shutdown in caso di mancanza di tensione di rete. Si indica quando iniziare lo spengimento in termini di percentuale di carica residua della batteria o di autonomia in minuti (delle due condizioni, quella che si verifica prima): <file> BATTERYLEVEL 10 MINUTES 8 </file> ===== Monitoraggio ====== Se si ha il server web attivo si può puntare il browser su http://localhost/cgi-bin/apcupsd/multimon.cgi. Altrimenti si esegue il programma gapcmon. ===== apcaccess e apctest ====== Con apcaccess è possibile interrogare da riga di comando lo stato dell'UPS, anche remoto: <code> apcaccess status apcaccess status host:3552 </code> Il programma apctest consente di dialogare con l'UPS e permette di eseguire numerose operazioni, molto utile è impostare la data di installazione delle batterie: <file> 1) Test kill UPS power 2) Perform self-test 3) Read last self-test result 4) Change battery date 5) View battery date 6) View manufacturing date 7) Set alarm behavior 8) Set sensitivity 9) Set low transfer voltage 10) Set high transfer voltage 11) Quit </file> ^ New battery date MM/DD/YYYY ^ | 08/31/2006 | | 11/15/2008 | | 09/15/2010 | | 09/15/2012 | | 01/30/2016 | | 10/23/2018 | | 05/29/2021 | | 10/20/2022 | ====== APC Back-UPS CS 500 ======= The UPS system was configured on a Debian 11 Bullseye, it is equipped with a single user-replaceable battery sized 151 x 65 x 97.5 mm, terminals are Faston F2 type (6.35 mm), the battery is rated 12 volt 7.0 Ah, Install the apcupsd Debian package. Once connected to the USB port, the GNU/Linux kernel 5.15 will log the following (through dmesg): <code> usb 1-6: new low-speed USB device number 14 using xhci_hcd usb 1-6: New USB device found, idVendor=051d, idProduct=0002, bcdDevice= 0.06 usb 1-6: New USB device strings: Mfr=3, Product=1, SerialNumber=2 usb 1-6: Product: Back-UPS CS 500 FW:808.q14 .I USB FW:q14 usb 1-6: Manufacturer: American Power Conversion usb 1-6: SerialNumber: 4B2214P31216 hid-generic 0003:051D:0002.0005: hiddev1,hidraw4: USB HID v1.10 Device [American Power Conversion Back-UPS CS 500 FW:808.q14 .I USB FW:q14 ] on usb-0000:00:15.0-6/input0 </code> When the service apcupsd.service is running it is possibile to execute the apcaccess tool: <code> apcaccess status </code> the output will show the following: <code> APC : 001,045,1048 DATE : 2022-10-26 21:12:53 +0200 HOSTNAME : ithaca VERSION : 3.14.14 (31 May 2016) debian UPSNAME : ithaca CABLE : USB Cable DRIVER : USB UPS Driver UPSMODE : Stand Alone STARTTIME: 2022-10-26 21:12:51 +0200 MODEL : Back-UPS CS 500 STATUS : ONLINE LINEV : 228.0 Volts LOADPCT : 0.0 Percent BCHARGE : 89.0 Percent TIMELEFT : 188.3 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds OUTPUTV : 230.0 Volts SENSE : Medium DWAKE : 0 Seconds DSHUTD : 180 Seconds LOTRANS : 180.0 Volts HITRANS : 266.0 Volts RETPCT : 0.0 Percent ITEMP : 29.2 C ALARMDEL : 30 Seconds BATTV : 13.5 Volts LINEFREQ : 50.0 Hz LASTXFER : No transfers since turnon NUMXFERS : 0 TONBATT : 0 Seconds CUMONBATT: 0 Seconds XOFFBATT : N/A SELFTEST : NO STESTI : None STATFLAG : 0x05000008 MANDATE : 2022-04-10 SERIALNO : 4B2214P31216 BATTDATE : 2022-04-10 NOMOUTV : 230 Volts NOMINV : 230 Volts NOMBATTV : 12.0 Volts NOMPOWER : 300 Watts FIRMWARE : 808.q14 .I USB FW:q END APC : 2022-10-26 21:12:54 +0200 </code> When the service is stopped, it is possible to configure the UPS using the command apctest: <code> systemctl stop apcupsd.service apctest </code> <code> Checking configuration … sharenet.type = Network & ShareUPS Disabled cable.type = USB Cable mode.type = USB UPS Driver Setting up the port … Doing prep_device() … You are using a USB cable type, so I'm entering USB test mode Hello, this is the apcupsd Cable Test program. This part of apctest is for testing USB UPSes. Getting UPS capabilities…SUCCESS Please select the function you want to perform. 1) Test kill UPS power 2) Perform self-test 3) Read last self-test result 4) View/Change battery date 5) View manufacturing date 6) View/Change alarm behavior 7) View/Change sensitivity 8) View/Change low transfer voltage 9) View/Change high transfer voltage 10) Perform battery calibration 11) Test alarm 12) View/Change self-test interval Q) Quit Select function number: </code> The two most important functions are the #10 battery calibration and the #12 self-test interval. Battery calibration must be initiated with a fully charged battery and the normal load (it should be above 10%); it will end when battery drops below about 25%. Unfortunately it seems that the Back-UPS CS 500 model does not support the periodic self-test, chosing option #12 results always in self-test interval: None. ^ New battery date (MM/DD/YYYY) | | 04/10/2022 | ====== Voltaggio batterie ======= L'UPS ospita due batterie di dimensioni 15.1 x 6.5 x 9.5 cm (larghezza, profondità, altezza terminali esclusi), i terminali faston sono di tipo F2 cioè da 6.35 mm (0.25 pollici). In questo formati si trovano batterie di capacità da 7.2, 8.4 oppure 9 Ah. Le batterie in questo UPS sono di tipo VRLA (valve regulated lead–acid), realizzate normalmente con tecnologia gel oppure AGM (absorbent glass mat). La tensione di queste batterie rispetto al livello di carica è riportata nella tabella a fianco. Generalmente la corrente in standy-by (float voltage, cioè la tensione a cui viene mantenuta in carica la batteria senza produzione di gas nell'elettrolita) e la corrente di ricarica (boost voltage, la tensione a cui viene ricaricata la batteria dopo che è stata scaricata) deve essere la seguente: ^ Float voltage | 13.50 - 13.80 V | ^ Boost voltage for cyclic use | 14.40 - 15.00 V |

doc/appunti/hardware/ups_apc.1666891059.txt.gz · Last modified: 2022/10/27 19:17 by niccolo