[Nut-upsdev] Energenie UPS support (patch)

Xeewaj Q. xeewaj at gmail.com
Fri Jul 30 10:46:16 BST 2021


Hello.
I recently got an Energenie EG-UPS-034 (https://energenie.com/item.aspx?id=8088).
I tried to get it working with NUT, but got the same (unresolved) issue as described here: https://alioth-lists.debian.net/pipermail/nut-upsuser/2017-March/010555.html - UPS returns the same values every time.
Bundled GUI software (UPSmart) worked fine. The only difference is buflen (511 for NUT and 102 for UPSmart). I tried setting it explicitly in nutdrv_qx.c, and it worked (the same solution for hunnox exists in the same file).
So, I made a patch for Energenie UPS support. It adds the keyword "energenie_fix". Fields novendor, norating, langid_fix are required for this model; override.battery.packs is optional.
Sample ups.conf entry:

[EG034]
    driver = "nutdrv_qx"
    subdriver = "krauler"
    protocol = "megatec"
    port = "auto"
    vendorid = "0001"
    productid = "0000"
    product = "MEC0003"
    bus = "003"
    override.battery.packs = "1"
    langid_fix = "0x409"
    novendor = "enabled"
    norating = "enabled"
    energenie_fix = "enabled"

The patch is attached. I'd like some feedback - is it the most elegant way to fix this problem? Maybe it's wiser to add an option "buflen_override" which takes a numerical value?
Cheers.

-- 
xeewaj at gmail.com <xeewaj at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nutdrv_qx.c.patch
Type: application/octet-stream
Size: 1321 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/nut-upsdev/attachments/20210730/de5afc6c/attachment.obj>


More information about the Nut-upsdev mailing list