Repository navigation
Conversation
upsdrv_initups() parsed the "iout_calib" option into iout_calib, but upsdrv_initinfo() -- which main.c runs afterwards -- then assigned the value of register 0xF3 over it unconditionally. Whenever the UPS answered that read, which is always, the documented option had no effect at all. Remember whether the option was given and keep the register value out of the way in that case, logging what the register reported so the difference stays visible with -D. This matters on rebadged units. A "One Up Nitro 2000" reports the Easy 2000 TI model id and stores 70 in register 0xF3 where 140 is correct, so output.current and ups.load come out exactly twice the real value -- the implied output VA exceeded the input power measured at the wall. With the override working, output.current agrees with the load's measured consumption across a three-point load sweep (idle, ~305 W and ~555 W of DC load: 2.02x, 1.96x and 2.12x correction, i.e. a constant factor of two rather than a non-linearity). Also document the precedence and how to calibrate against a clamp meter in the man page. Signed-off-by: juslex <66561713+juslex@users.noreply.github.com>
|
A ZIP file with standard source tarball and another tarball with pre-built docs for commit 841b2fe is temporarily available: NUT-tarballs-PR-3795.zip. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: juslex <66561713+juslex@users.noreply.github.com>
|
✅ Build nut 2.8.5.5890-master completed (commit 452f92751b by @jimklimov)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
upsdrv_initups()parses theiout_caliboption intoiout_calib, butupsdrv_initinfo(), whichmain.cruns afterwards, then assigned the value of register0xF3over it unconditionally. Since the UPS always answers that read, the documented option had no effect at all.This change remembers whether the option was given and, in that case, only logs the register value (at
-D) instead of overwriting the configured one. Without the option, behaviour is unchanged.Why it matters
Rebadged units. A "One Up Nitro 2000", whose firmware reports the Easy 2000 TI model id, stores
70in register0xF3where140is correct, sooutput.currentandups.loadcame out exactly twice the real value; the implied output VA even exceeded the input power measured at the wall. With the override working,output.currentmatches the load's measured consumption across a three-point load sweep (idle, ~305 W and ~555 W of DC load: 2.02x, 1.96x and 2.12x correction, i.e. a constant factor of two, not a non-linearity).This has been running on that unit in production since early August.
The man page now documents the precedence and how to calibrate against a clamp meter or a known load.
Note on #3716
#3716 (battery runtime model) inserts its
rt_enabledblock right above the0xF3read inupsdrv_initinfo(), so whichever lands second needs a trivial textual rebase: keep both blocks, with this change'siout_calib_overridecheck after the runtime block. There is no semantic overlap, but the runtime model derives its load fromoutput.current, so on units like the one above this fix is what makes the runtime estimate meaningful. Happy to rebase after #3716 is merged.🤖 Generated with Claude Code