Skip to content

Commit da5e3ff

Browse files
authored
Merge pull request #3502 from bshor/goldenmate-06da-ffff
idowell-hid: add GoldenMate 1000VA/800W LiFePO4 (USB ID 06da:ffff)
2 parents d21c02c + 58e1791 commit da5e3ff

4 files changed

Lines changed: 46 additions & 3 deletions

File tree

NEWS.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ https://github.com/networkupstools/nut/milestone/13
111111
- `usbhid-ups` driver updates:
112112
* When reconnecting, report success more visibly (not only in debug), and
113113
do not reset driver state to "quiet" when it will loop trying. [PR #3423]
114+
* `idowell-hid` subdriver now also supports GoldenMate 1000VA/800W LiFePO4
115+
battery packs (`0x06da:0xffff`), which carry the same `-BMS-` firmware and
116+
HID descriptor as the existing `0x075d:0x0300` device. The shared
117+
Phoenixtec vendor ID (`0x06da`) is gated by device strings so the other
118+
devices on that ID still fall through to `liebert-hid` / `mge-hid`.
119+
[issue #3501, PR #3502]
114120

115121
- `snmp-ups` driver updates:
116122
* Extended the XPPC-MIB subdriver (enterprise 935) to expose

data/driver.list.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,8 @@
546546

547547
"Gemini" "ups" "1" "UPS625/UPS1000" "" "safenet"
548548

549-
"GoldenMate" "ups" "1" "UPS 1000VA Pro" "USB" "usbhid-ups"
549+
"GoldenMate" "ups" "2" "UPS 1000VA Pro (USB ID 075d:0300)" "USB" "usbhid-ups" # https://github.com/networkupstools/nut/issues/3015
550+
"GoldenMate" "ups" "2" "1000VA/800W LiFePO4 (USB ID 06da:ffff)" "USB" "usbhid-ups" # https://github.com/networkupstools/nut/issues/3501
550551

551552
"Grafenthal" "ups" "3" "PR-3000-HS" "SNMP/Web Minislot card (ref 149G0006)" "snmp-ups" # http://grafenthal.de/produkte/usv/online/pr-hs-serie/pr-3000-hs/?L=3et8
552553

docs/nut.dict

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
personal_ws-1.1 en 3781 utf-8
1+
personal_ws-1.1 en 3783 utf-8
22
AAC
33
AAS
44
ABI
@@ -99,6 +99,7 @@ BD
9999
BKnnnnM
100100
BKxxxM
101101
BMC
102+
BMS
102103
BNT
103104
BOH
104105
BP
@@ -2363,6 +2364,7 @@ idProduct
23632364
idVendor
23642365
ident
23652366
idleload
2367+
idowell
23662368
ie
23672369
ietf
23682370
ifdef

drivers/idowell-hid.c

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,29 @@
3030
#include "main.h" /* for getval() */
3131
#include "usb-common.h"
3232

33-
#define IDOWELL_HID_VERSION "iDowell HID 0.20"
33+
#define IDOWELL_HID_VERSION "iDowell HID 0.21"
3434
/* FIXME: experimental flag to be put in upsdrv_info */
35+
/* v0.21 GoldenMate LiFePO4 packs reuse the shared Phoenixtec VID (0x06da):
36+
* claim only those (by -BMS-/Smart-Battery firmware strings) and defer
37+
* everything else on that VID to liebert-hid / mge-hid */
3538
/* v0.20 Goldenmate also uses the same vendorID and productID so added additional HID2NUT lookup values */
3639

3740
/* iDowell, Goldenmate */
3841
#define IDOWELL_VENDORID 0x075d
3942

43+
/* Phoenixtec Power Co., Ltd; this VID is shared with liebert-hid (the default
44+
* sink for 0x06da) and mge-hid (AEG PROTECT NAS). GoldenMate 1000VA/800W
45+
* LiFePO4 packs reuse 0x06da:0xffff with the same iDowell-style -BMS- firmware
46+
* and HID descriptor as 0x075d:0x0300, so the table match is gated by device
47+
* strings in idowell_claim() to avoid hijacking the other 0x06da devices. */
48+
#define PHOENIXTEC_VENDORID 0x06da
49+
4050
/* USB IDs device table */
4151
static usb_device_id_t idowell_usb_device_table[] = {
4252
/* iDowell, Goldenmate */
4353
{ USB_DEVICE(IDOWELL_VENDORID, 0x0300), NULL },
54+
/* GoldenMate 1000VA/800W LiFePO4; claim gated by strings, see idowell_claim() */
55+
{ USB_DEVICE(PHOENIXTEC_VENDORID, 0xffff), NULL },
4456

4557
/* Terminating entry */
4658
{ 0, 0, NULL }
@@ -147,6 +159,23 @@ static const char *idowell_format_serial(HIDDevice_t *hd) {
147159
return hd->Serial;
148160
}
149161

162+
/* The Phoenixtec vendor ID (0x06da) is shared between several subdrivers:
163+
* liebert-hid is the default sink, mge-hid grabs AEG PROTECT NAS, and we want
164+
* only the GoldenMate LiFePO4 packs. They carry the same iDowell-style BMS
165+
* firmware as the 0x075d:0x0300 device, reporting manufacturer "-BMS-" and
166+
* product "Smart-Battery". Match on those strings so the other 0x06da devices
167+
* fall through to liebert-hid / mge-hid. */
168+
static int idowell_is_goldenmate(HIDDevice_t *hd)
169+
{
170+
if (hd->Vendor && strstr(hd->Vendor, "BMS")) {
171+
return 1;
172+
}
173+
if (hd->Product && strstr(hd->Product, "Smart-Battery")) {
174+
return 1;
175+
}
176+
return 0;
177+
}
178+
150179
/* this function allows the subdriver to "claim" a device: return 1 if
151180
* the device is supported by this subdriver, else 0. */
152181
static int idowell_claim(HIDDevice_t *hd)
@@ -164,6 +193,11 @@ static int idowell_claim(HIDDevice_t *hd)
164193
return 0;
165194

166195
case SUPPORTED:
196+
/* On the shared Phoenixtec VID, only claim GoldenMate; let
197+
* liebert-hid (default sink) and mge-hid (AEG) handle the rest. */
198+
if (hd->VendorID == PHOENIXTEC_VENDORID && !idowell_is_goldenmate(hd)) {
199+
return 0;
200+
}
167201
return 1;
168202

169203
case NOT_SUPPORTED:

0 commit comments

Comments
 (0)