NUT : Onduleur UPS MGE Ellipse

Bonsoir,

J’ai un onduleur MGE UPS SYSTEMS Ellipse 600 MAX ; Pas un Eaton

Il dispose d’une prise RJ45 femelle (COM)

Modifié, il fonctionne sur batterie de voiture 50 Ah

Grâce à : http://www.hacker-maker.com/2013/11/cable-rj45-usb-pour-onduleur-mge.html

J’ai réussi à concevoir le câble :

rem@n40l:~$ lsusb -s 004:006 
Bus 004 Device 006: ID 0463:ffff MGE UPS Systems UPS

Ce système NUT (Network UPS Tools) m’est totalement nouveau ; Je ne sais pas à quoi m’attendre.

Pourrai-je avoir une jauge de batterie comme sur un portable ?

Le but est que le micro-serveur auquel il est relié s’éteigne correctement en cas de manque prolongé d’électricité.

J’ai trouvé deux liens :

http://blognote32.net/procedures/eatonmge-ellipse-monitoring-avec-nut-sous-ubuntu.html

et, plus complexe en apparence :

https://srackham.wordpress.com/2013/02/27/configuring-nut-for-the-eaton-3s-ups-on-ubuntu-linux/

Il s’agit d’un matériel assez ancien qui doit être piloté et je n’ai que « driver = usbhid-ups » comme information pour le pilote.

Est-ce le bon pilote ?

Avez-vous des conseils ?

Merci

Jette un coup d’œil sur la page du wiki … isalo.org/wiki.debian-fr/Co … r_avec_NUT
Tu devrais y trouver ton bonheur :023

1 J'aime

Merci beaucoup Mimoza !

C’est presque incroyable, je pense avoir réussi avec le pilote usbhid-ups :

root@n40l:~# upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.2
Network UPS Tools - Generic HID driver 0.38 (2.7.2)
USB communication driver 0.32
Using subdriver: MGE HID 1.33[/code]
[code]root@n40l:~# /bin/upsc MGE600@localhost
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 30
battery.runtime: 1175
battery.type: PbAc
battery.voltage.high: 13.5
battery.voltage.low: 11.8
device.mfr: MGE UPS SYSTEMS
device.model: Ellipse 600
device.serial: AP8G49073
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.7.2
driver.version.data: MGE HID 1.33
driver.version.internal: 0.38
input.transfer.high: 264
input.transfer.low: 184
outlet.1.desc: PowerShare Outlet 1
outlet.1.id: 2
outlet.1.status: on
outlet.1.switchable: no
outlet.desc: Main Outlet
outlet.id: 1
outlet.switchable: no
output.frequency.nominal: 50
output.voltage: 230.0
output.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 4
ups.mfr: MGE UPS SYSTEMS
ups.model: Ellipse 600
ups.power.nominal: 600
ups.productid: ffff
ups.serial: AP8G49073
ups.status: OL CHRG
ups.timer.shutdown: -1
ups.timer.start: -10
ups.vendorid: 0463
root@n40l:/home/rem# tail -f /var/log/daemon.log | grep upssched
Sep 16 09:49:32 n40l upssched[1693]: Timer daemon started
Sep 16 09:49:32 n40l upssched[1693]: New timer: onbatt1 (13 seconds)
Sep 16 09:49:32 n40l upssched[1693]: New timer: onbattwarn (30 seconds)
Sep 16 09:49:45 n40l upssched[1693]: Event: onbatt1
Sep 16 09:50:02 n40l upssched[1693]: Event: onbattwarn
Sep 16 09:50:12 n40l upssched[1693]: Timer queue empty, exiting

Il me reste un petit souci, je ne peux pas activer (enable) le service ups-monitor ; Je suis obligé de le démarrer à la main :

root@n40l:~# systemctl enable ups-monitor
Synchronizing state for ups-monitor.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d ups-monitor defaults
insserv: script ups-monitor is a symlink to another script, skipped!
Executing /usr/sbin/update-rc.d ups-monitor enable
update-rc.d: error: no runlevel symlinks to modify, aborting!

Je vais placer le démarrage (start) dans /etc/rc.local pour le moment.

Il reste à peut-être à ajuster des seuils aussi.

pour info, j’ai dû donner l’appartenance au groupe nut pour le périphérique usb concerné, comme évoqué dans un des deux liens.
édition : la référence numérique du périphérique usb (/dev/bus/usb/*/*) n’étant pas fixe - contrairement à un port série, j’ai placé l’utilisateur nut dans le groupe root

Je suis super content ! :wink:

:049

J’ai voulu tester une coupure de courant à l’onduleur et je vois qu’il y a des problèmes, des commandes non reconnues par upssched-cmd

root@n40l:~# tail -f /var/log/syslog
Sep 16 10:45:10 n40l upsmon[1840]: MGE600@localhost is on battery
Sep 16 10:45:10 n40l upssched[1904]: Timer daemon started
Sep 16 10:45:10 n40l upssched[1904]: New timer: onbatt1 (13 seconds)
Sep 16 10:45:10 n40l upssched[1904]: New timer: onbattwarn (30 seconds)
Sep 16 10:45:23 n40l upssched[1904]: Event: onbatt1
Sep 16 10:45:23 n40l upssched-cmd: Unrecognized command: onbatt1
Sep 16 10:45:40 n40l upssched[1904]: Event: onbattwarn
Sep 16 10:45:40 n40l upssched-cmd: Unrecognized command: onbattwarn
Sep 16 10:45:55 n40l upssched[1904]: Timer queue empty, exiting

Il est indiqué qu’un simple fichier vide éxecutable suffit pour /bin/upssched-cmd

root@n40l:~# ls -al /bin/upssched-cmd
-rwxr-xr-x 1 root root 0 sept. 16 11:02 /bin/upssched-cmd

Mon fichier /bin/upssched-cmd d’origine faisait 420 octets et était vide d’information, je viens de le réduire à zéro comme ci-dessus.

Dès que j’aurai retrouvé ma charge de batterie, je ferai à nouveau un test de coupure.

Édition :

J’ai bien fini par comprendre qu’il fallait un contenu pour /bin/upssched-cmd en correspondance avec les timers déclarés dans /etc/nut/upssched.conf :

# /etc/nut/upssched.conf
LOCKFN /var/lib/nut/upssched.lock
PIPEFN /var/lib/nut/upssched.pipe
CMDSCRIPT /bin/upssched-cmd
AT ONBATT * START-TIMER onbatt 5
AT ONLINE * CANCEL-TIMER onbatt
AT ONBATT * START-TIMER earlyshutdown 15
AT ONLINE * CANCEL-TIMER earlyshutdown
AT ONBATT * START-TIMER onbattwarn 30
AT ONLINE * CANCEL-TIMER onbattwarn
#! /bin/sh
#  /bin/upssched-cmd
#
# This script should be called by upssched via the CMDSCRIPT directive.
# 
# Here is a quick example to show how to handle a bunch of possible
# timer names with the help of the case structure.
#
# This script may be replaced with another program without harm.
#
# The first argument passed to your CMDSCRIPT is the name of the timer
# from your AT lines.

case $1 in
        upsgone)
                logger -t upssched-cmd "The UPS has been gone for a while"
                ;;
        onbatt)
                logger -t upssched-cmd "On battery"
                ;;
        earlyshutdown)
                logger -t upssched-cmd "Early Shutdown..."
                ;;
        onbattwarn)
                logger -t upssched-cmd "Shutting down using: upsmon -c fsd"
                upsmon -c fsd
                ;;
        *)
                logger -t upssched-cmd "Unrecognized command: $1"
                ;;
esac

Le test de coupure est effectué, l’arrêt est effectif après les timers : onbatt (5 secondes) + earlyshutdown (15 secondes) + onbattwarn (30 secondes) soit 50 secondes en tout.

Ce n’est qu’un petit 600VA (360 Watts) et j’ai un petit monde dessus.
Je ne m’attendais pas néanmoins à une baisse aussi rapide de l’indicateur battery.charge avec une 50 Ah neuve