meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:sw:nut:eaton_ellipse_650 [2024/12/16 21:31] – created niziaklinux:sw:nut:eaton_ellipse_650 [2024/12/17 09:23] (current) niziak
Line 8: Line 8:
 </code> </code>
  
 +<code bash>
 +apt install nut-server nut-cgi
 +</code>
 +
 +[[https://networkupstools.org/docs/man/usbhid-ups.html|USBHID-UPS(8)]]:
 +> SUPPORTED HARDWARE
 +>
 +> usbhid-ups brings USB/HID UPS monitoring to NUT on all platforms supporting USB through libusb. It should detect any UPS that uses the HID Power Device Class, but the amount of data will vary depending on the manufacturer and model.
 +>
 +> At the present time, usbhid-ups supports:
 +>    the newer Eaton USB models,
 +>    all MGE USB models,
 +
 +===== port= is ignored =====
 +
 +> This could be a device filesystem path like ''/dev/usb/hiddev0'' but current use of libusb API precludes knowing and matching by such identifiers. They may also be inherently unreliable (dependent on re-plugging and enumeration order). At this time the actual value is ignored, but syntactically some port configuration must still be there.
 +
 +===== unpriv. LXC with Proxmox =====
 +
 +Bind USB BUS 1. Cannot bind single device because device number is floating.
 +Allow to access only UPS character device ''189:5''
 +
 +==== on PVE host ====
 +
 +<file ini /etc/pve/lxc/312.conf>
 +lxc.cgroup2.devices.allow: c 189:5 rwm # MGE UPS Systems UPS
 +lxc.mount.entry: /dev/bus/usb/001 dev/bus/usb/001 none bind,optional,create=dir,mode=664 # USB BUS 1
 +</file>
 +
 +<file ini /etc/udev/rules.d/71-nut.rules>
 +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0463", ATTRS{idProduct}=="ffff", MODE="0664", OWNER="100000", GROUP="111003"
 +</file>
 +
 +<code bash>
 +udevadm control --reload-rules && udevadm trigger --attr-match=subsystem=usb
 +</code>
 +
 +Verify if permission are changed:
 +<code bash>
 +# ls -l /dev/bus/usb/001
 +total 0
 +crw-rw-r-- 1 root   root   189,  0 Dec 17 08:03 001
 +crw-rw-r-- 1 root   root   189,  2 Dec 17 08:04 003
 +crw-rw-r-- 1 root   root   189,  3 Dec 17 08:03 004
 +crw-rw-r-- 1 100000 111003 189, 10 Dec 17 08:03 011
 +</code>
 +
 +==== ON NUT's LXC ====
 +
 +Inside LXC NUT container:
 +
 +<code bash>
 +groupadd -g 11003 lxc_usb_nut_shares
 +usermod -aG lxc_usb_nut_shares root
 +</code>
 +
 +
 +To prevent error:
 +
 +> libusb1: Could not open any HID devices: insufficient permissions on everything
 +
 +give NUT access to USB device:
 +
 +<code bash>
 +usermod -aG lxc_usb_nut_shares nut
 +</code>
 +
 +NOTE: ''/lib/nut/usbhid-ups'' drivers switches to gid ''nut (112)'' and uid ''nut (103)'' after start.
 +
 +
 +===== usbhid-ups =====
 +
 +Test:
 +<code bash>
 +# nut-scanner 
 +
 +Scanning USB bus.
 +No start IP, skipping NUT bus (old connect method)
 +[nutdev1]
 + driver = "usbhid-ups"
 + port = "auto"
 + vendorid = "0463"
 + productid = "FFFF"
 + product = "Ellipse PRO"
 + serial = "G123456789"
 + vendor = "EATON"
 + bus = "001"
 +</code>
 +
 +
 +<file init /etc/nut/ups.conf>
 +maxretry = 3
 +
 +[eaton]
 +    desc = "Eaton Ellipse ECO 650 VA"
 +    driver = "usbhid-ups"
 +    port = "auto"
 +    vendorid = "0463"
 +    productid = "FFFF"
 +    product = "Ellipse PRO"
 +    serial = "G123456789"
 +    vendor = "EATON"
 +    bus = "001"
 +</file>
 +
 +<file ini /etc/nut/nut.conf>
 +MODE=netserver
 +
 +</file>
 +
 +<file ini /etc/nut/upsd.conf>
 +LISTEN * 3494
 +</file>
 +
 +[[https://man.archlinux.org/man/upsd.users.5|upsd.users.5]]
 +
 +<file ini /etc/nut/upsd.users>
 +[admin]
 +password = hardpass
 +actions = SET
 +actions = FSD
 +instcmds = ALL
 +
 +[upsmon]
 +password = hardpass
 +upsmon primary
 +
 +[ha]
 +password = hardpass
 +</file>
 +
 +<file ini /etc/nut/upsmon.conf>
 +MONITOR eaton@localhost 1 upsmon hardpass primary
 +</file>
 +
 +<code bash>
 +systemctl restart nut-server
 +</code>
 +
 +<code bash>
 +# upsc eaton
 +Init SSL without certificate database
 +battery.charge: 100
 +battery.charge.low: 20
 +battery.runtime: 2840
 +battery.type: PbAc
 +...
 +</code>