Add optional EcoFlow CDC telemetry to usbhid-ups - #3569
Conversation
Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
|
A ZIP file with standard source tarball and another tarball with pre-built docs for commit 73bbd12 is temporarily available: NUT-tarballs-PR-3569.zip. |
|
❌ Build nut 2.8.5.5051-master failed (commit 637bf29682 by @) |
|
❌ Build nut 2.8.5.5051-master failed (commit 637bf29682 by @) |
Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
|
❌ Build nut 2.8.5.5052-master failed (commit 55d99ae42f by @) |
Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
|
❌ Build nut 2.8.5.5053-master failed (commit bb35bca927 by @) |
|
✅ Build nut 2.8.5.5054-master completed (commit 6506ebb503 by @)
|
|
✅ Build nut 2.8.5.5054-master completed (commit 6506ebb503 by @) |
jimklimov
left a comment
There was a problem hiding this comment.
Quite solid, thanks. Commented on a couple of stylistic nits, but neither is something that requires an immediate code change - more as hints for future contributions.
jimklimov
left a comment
There was a problem hiding this comment.
Ah, my earlier review missed an aspect that does need a change: bump driver versions (usbhid-ups.c itself, and the *-hid.c subdrivers, due to structure format change), at least if nothing else bumped them since v2.8.5 release.
I wonder also if ecoflow-cdc{,-protocol}.{c,h} might stand as a driver code base on its own merit, or is strictly meant to be part of usbhid-ups? Maybe introducing a structured naming for the new aux tweaks should be useful (e.g. we have ecoflow-hid for usbhid-ups, so AUX tweaks could be ecoflow-hid-aux-something - WDYT?)
|
Thanks for the review. I’ve updated the branch to bump I retained |
Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
eb4e00f to
55bf78d
Compare
|
✅ Build nut 2.8.5.5057-master completed (commit d83200915e by @)
|
|
✅ Build nut 2.8.5.5058-master completed (commit adc52e30d2 by @)
|
Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
|
✅ Build nut 2.8.5.5060-master completed (commit 5971854a5d by @)
|
networkupstools#3569] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
networkupstools#3569] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
Collected complaints from multi-platform CI:
|
|
Addressed the multi-platform compiler failures reported above. The decoder now parses the IEEE-754 binary32 wire representation directly instead of using the platform’s native float representation and isfinite(). This removes the illumos implicit declaration, FreeBSD pre-C11 _Generic expansion, and Ubuntu Trusty unreachable-code failures. I also replaced the constant absolute-value branch with separate signed and absolute loaders, and added regression coverage for signed finite values, NaN, and positive and negative infinity. Local validation completed with strict GCC and Clang C99 builds, the relevant pre-C11 and unreachable-code warnings enabled, ASan/UBSan, USB and serial driver builds, and make distcheck. |
Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
b71925f to
73bbd12
Compare
|
✅ Build nut 2.8.5.5070-master completed (commit efe8bafd2f by @)
|
|
✅ Build nut 2.8.5.5071-master completed (commit 46512d29c8 by @)
|
Summary
ecoflow_cdc_port.experimental.ecoflow.*.Rationale
The EcoFlow RIVER 3 Plus HID interface provides the data needed for UPS monitoring and shutdown, but it does not provide live power and temperature telemetry. The same USB device exposes richer read-only data through a CDC ACM interface.
This change keeps HID authoritative and enriches the same NUT device instead of creating a second partial UPS. CDC support is opt-in. A missing or failed CDC connection reconnects independently and never marks the HID data stale.
The protocol framing and field work builds on the public r3pcomms project and was independently verified against a RIVER 3 Plus.
Related to #2735.
Safety
ecoflow_cdc_portis configured.Testing
make -j2 check: 7 passed, 0 failed.usbhid-upsbuild with serial support enabled.usbhid-upsbuild with serial support disabled.reconnect.tryingwhile HID remained responsive and continued reporting status, charge and runtime.Contributor note
I used an AI coding assistant during implementation. I reviewed the resulting changes and validated them with the tests and hardware checks listed above.
The commit includes the required DCO sign-off.