Repository navigation
add support for EcoFlow River 3 Plus - #2837
Conversation
Basic status works (charging, discharging, online, onbattery, ...). Charge level works. Discharge level from app shows correctly. Any sort of control does not seem to work for load or beeper/light. See code comments for details. Signed-off-by: Yevgeniy Kuksenko <2882631+ykuksenko@users.noreply.github.com>
|
Thanks! I wonder about merging the two PRs, yours and #2740 (they luckily deliver same-named files) - gotta check if that one has any unique mapping content (at least detailed comments pop out, and a generated hwdb file). In particular, that would lead to both of you scoring a contribution for the effort done :) WDYT? |
I've merged in the hwdb file from @ykuksenko's branch. I'm unsure exactly how to handle their comments in drivers/ecoflow-hid.c, so I left those out. It also seems to me that at least some of the variables there do not match with what gen-usbhid-subdriver.sh gave me, which I assume is due to changes in EcoFlow's firmware since December '24. |
networkupstools#2735, PRs networkupstools#2740, networkupstools#2837] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… added [issue networkupstools#2735, PRs networkupstools#2740, networkupstools#2837] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…dd (C) of contributors [issue networkupstools#2735, PRs networkupstools#2740, networkupstools#2837] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… "#if WITH_UNMAPPED_DATA_POINTS" [networkupstools#2837] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ksenko variant [networkupstools#2837] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…etworkupstools#2740, networkupstools#2837] * import back comments about findings in PR networkupstools#2740, * apply reasonable number precision and HU_FLAG* where two codebases differed, * clean up "unmapped.*" entries that are actually exposed as standard or experimental data points, or in some cases drop the "experimental.*" ones (it is easy to build code with settings which would show the same values as "unmapped.*") Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
Thanks, I've reviewed the rest - hopefully reasonably de-duplicated some, picked the better flags for others... @greyltc @ykuksenko : testing of this resulting PR branch would be very welcome, to make sure conversion methods in mapping tables are listed correctly, at least... |
|
fde62e5 means now that if the build is done with 988910f merges in a bunch of variables and notes that only apply to an an obsolete firmware from last December.
Many of the comments look like they're documenting struggles with buggy firmware that has been superseded or are commented out duplicated code. 988910f needs to be reverted imop. |
|
Thanks. Not sure I have an opinion here, just... some thoughts:
|
|
@dorner365 : thanks for the test and suggestions. One thing that looks concerning to me here, are you sure the conversion is actually the correct thing to do? What is the capacity and workload on the UPS, is one-and-two-thirds of a day of runtime really more correct than ~40 minutes? I don't know your setup, a 10kVA UPS feeding a Raspberry Pi and a WiFi router for it might fit the bill, but realistic workloads are usually in tens of minutes of protection - just enough to slide over short outages, or switch to a GenSet or other sources, or safely shut down... |
|
@jimklimov, please take a look at the screenshots and consider the following:
In any case, would it be "more correct" showing ~40 minutes runtime while ONLINE (because it's typically expected) than showing what the batery.runtime value returns? |
If you mean hard-coded, then no - the time is something shutdown scripts, admin planning, etc. can depend on, and in turn the time depends on the UPS model, its battery size (and battery age), and the workload. So there's no "one size fits all" case here. If a value can be "guesstimated" - derived from others reasonably reliably, and/or user-provided calibration info (like |
|
I rest my case :) |
…nversion_lkp Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ve differently in various tested devices [networkupstools#2837] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>




Here's a pull request to address #2735 (MAINTAINER NOTE: initially an alternative to PR #2740, now assimilated that work - so became a successor to that draft PR)
I know there's another PR out there to address this same issue, but I felt like going through the process myself just for fun/learning.
I've only been able to test it on my River 3 Plus (with the latest firmware V1.32.76.52), but I think the changes here might work as is for some of EcoFlow's other new battery banks with UPS support like their Delta 3 Plus.
The hardware feature set seems pretty anemic at this point (or at least gen-usbhid-subdriver.sh didn't find that many variables), but I think I've got pretty much everything the hardware currently supports working here. I've done my best to remap the nut variable names as close to the spec and to what other drivers do as I could. The ones I couldn't find a good mapping for, I put as
experimental.so what you see in the attached nut monitor screenshot below is everything that gen-usbhid-subdriver.sh came up with.General points
Described the changes in the PR submission or a separate issue, e.g.
known published or discovered protocols, applicable hardware (expected
compatible and actually tested/developed against), limitations, etc.
There may be multiple commits in the PR, aligned and commented with
a functional change. Notably, coding style changes better belong in a
separate PR, but certainly in a dedicated commit to simplify reviews
of "real" changes in the other commits. Similarly for typo fixes in
comments or text documents.
Please star NUT on GitHub, this helps with sponsorships! ;)
Frequent "underwater rocks" for driver addition/update PRs
Revised existing driver families and added a sub-driver if applicable
(
nutdrv_qx,usbhid-ups...) or added a brand new driver in the othercase.
Did not extend obsoleted drivers with new hardware support features
(notably
blazerand other single-device family drivers for Qx protocols,except the new
nutdrv_qxwhich should cover them all).For updated existing device drivers, bumped the
DRIVER_VERSIONmacroor its equivalent.
For USB devices (HID or not), revised that the driver uses unique
VID/PID combinations, or raised discussions when this is not the case
(several vendors do use same interface chips for unrelated protocols).
For new USB devices, built and committed the changes for the
scripts/upower/95-upower-hid.hwdbfileProposed NUT data mapping is aligned with existing
docs/nut-names.txtfile. If the device exposes useful data points not listed in the file, the
experimental.*namespace can be used as documented there, and discussionshould be raised on the NUT Developers mailing list to standardize the new
concept.
Updated
data/driver.list.inif applicable (new tested device info)Frequent "underwater rocks" for general C code PRs
structure layout and alignment in memory, endianness (layout of bytes and
bits in memory for multi-byte numeric types), or use of generic
intwherelanguage or libraries dictate the use of
size_t(orssize_tsometimes).Progress and errors are handled with
upsdebugx(),upslogx(),fatalx()and related methods, not with directprintf()orexit().Similarly, NUT helpers are used for error-checked memory allocation and
string operations (except where customized error handling is needed,
such as unlocking device ports, etc.)
Coding style (including whitespace for indentations) follows precedent
in the code of the file, and examples/guide in
docs/developers.txtfile.For newly added files, the
Makefile.amrecipes were updated and themake distchecktarget passes.General documentation updates
Updated
docs/acknowledgements.txt(for vendor-backed device support)Added or updated manual page information in
docs/man/*.txtfilesand corresponding recipe lists in
docs/man/Makefile.amfor new pagesPassed
make spellcheck, updated spell-checking dictionary in thedocs/nut.dictfile if needed (did not remove any words -- themakerule printout in case of changes suggests how to maintain it).
Additional work may be needed after posting this PR
Propose a PR for NUT DDL with detailed device data dumps from tests
against real hardware (the more models, the better).
Address NUT CI farm build failures for the PR: testing on numerous
platforms and toolkits can expose issues not seen on just one system.
the changed codebase.