ECOmode-auto-addon2-todo#2956
Conversation
…p.auto" Signed-off-by: DaRK AnGeL <28630321+masterwishx@users.noreply.github.com>
masterwishx
left a comment
There was a problem hiding this comment.
@jimklimov i made the new pr for aecomode auto ,we need to confirm what best name for commands :
if you think auto not good , maybe :
experimental.bypass.ecomode.start
experimental.bypass.ecomode.stop
|
Yes, if they are one-time commands that take effect when issued (and not a toggle for UPS to auto-change modes later based on environmental circumstances and this choice of strategy, like e.g. trim/boost happens automatically to compensate for input voltage outside low/high thresholds), then |
…l.ecomode.start[stop].auto` Signed-off-by: DaRK AnGeL <28630321+masterwishx@users.noreply.github.com>
|
@ZivertX can you please test this pr : This will run bypass + ecomode on/off by one command: Please check (by ups screen or so) that bypass was enabled before ECO mode when on , also when off, bypass was disabled before exit from ecomode. Also Please include debug Logs. |
Built your version (ECOmode-auto-addon2-todo)
experimental.bypass.ecomode.start.log
|
Thanks will try to fix it |
@jimklimov should it be 2.8.3 ? |
why not in 2.8.3 ? |
Lines 2167 to 2170 in 06d1032 We still have error when sending function in last setting of cmd instead of NULL? can |
|
Regarding "2.8.2" - these strings from
No, it should require that you pass an argument (e.g. as Here it finds "1" but then for some reason fails to use it. Can't say more ATM, am on phone in a bus... |
I will try to dig it out, but if you will have time to help here will be cool, not shure how it should work as we don't have any command with function in last parametr instead of Null. :( |
|
Digging a bit :) For reference, definitions of mapping table elements (as of latest commit in this PR branch) are:
For INSTCMD we are interested in such They may have a default Lines 2166 to 2169 in 06d1032 They may also refer to a further table The lookup fault in your log: ...seems to come from code path at Lines 914 to 931 in 06d1032 ...and specifically it fails in hu_find_valinfo() at the last quoted line. That method looks into an info_lkp_t *hid2info (treated as a single element if (hid2info->fun != NULL), or a lookup array while info_lkp->nut_value != NULL otherwise... for apparently static lookups for) as seen at Lines 2636 to 2663 in 06d1032 So apparently all other command cases which used some mapping function worked with a trivial mapping table of one or two
In your case, the Lines 1216 to 1222 in 06d1032 ...defines two fun entries (apparently only the first would get used) but not nuf.
With current code structure, which apparently ignores Thanks for making me dig into this - now I think this problem seems to impact your other tables with
...and probably older mappings too, or did I misunderstand something when reading the methods above? CC @arnaudquette-eaton - please help us out here (and help fix Eaton support as relevant) :)
Some summary thoughts:
Finally note that these functions seem designed to convert the arguments from one type to another, not so much to perform a series of active operations on the device (as we want in this PR, to chain several changes of HW/FW state in practice). There may be several correct-ish solutions to wedge this desire into existing framework:
|
Yep i checked this but seems i forgot a little how its working :)
Thanks will look into it
Strange those functions working fine from the tests that we had with @ZivertX confirmed by for bypass and ecomode ( for both upsrw and cmd (with NULL)) : Lines 1016 to 1022 in 06d1032 Lines 1140 to 1145 in 06d1032 But will check again with your info :)
Wow i need more time to check it :) |
|
Disregard netbsd agent CI faults, the worker had an environmental issue. |
drivers/mge-hid.c
Outdated
| if (!strcmp(bypass_switch_off_str, "disabled")) { | ||
| setvar("input.bypass.switch.off", "off"); | ||
| } else { | ||
| upsdebugx(1, "Bypass switch off state is: %s , must be disabled before switching off", bypass_switch_off_str); |
There was a problem hiding this comment.
Might be good to prefix all these upsdebugx with %s: and __func__ so we can see more easily which functions get called and do what during the testing and also later when in production.
There was a problem hiding this comment.
upsdebugx(1, "%s: Bypass switch off state is: %s , must be disabled before switching off", __func__, bypass_switch_off_str); its ok ?
There was a problem hiding this comment.
Yes that's how I usually do it so it shows which function emits the message.
There was a problem hiding this comment.
Yes that's how I usually do it so it shows which function emits the message.
Yep i also did it but for some of upsdebugx in functions but forgot from back then about it and how stuff was working :(
There was a problem hiding this comment.
Yes that's how I usually do it so it shows which function emits the message.
Maybe you can check about current issue we have here if you have time ?
…__ for easy debug later Signed-off-by: DaRK AnGeL <28630321+masterwishx@users.noreply.github.com>
|
❌ Build nut 2.8.3.3195-master failed (commit b7d6731626 by @masterwishx) |
…alue [networkupstools#2956] We want it evaluated on every quick-update loop, so that the correct buzzwords are always set (if device serves the feature). Also quick-update the bypass voltage and frequency, so we know relevant clues (keep semi-static settings as they were though). Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…hat value==1 [networkupstools#2956] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…put if we remain in ECO/non-ECO mode [networkupstools#2956] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…n ups_status_set() [networkupstools#2956] Avoid extra work and occasional log messages that: str_add_unique_token: skip token 'vendor:default:ECO': was already set Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
Prepared some more commits based on previous post's findings, see uploaded above. |
Yep sorry I meaned the cycle |
I think it's when waiting one value but got other.. Will check again in next test? Please let me know when it's done for test. Another question all worked fine befor, so you think it worth all new changes? |
…g for "value==1" [networkupstools#2956] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Well, that latest iteration of fixes (quick poll, better/quieter logging) is all I planned to do for now, so can test with it as well.
You tell me, as the author :) From what I saw, in most of those small mapping tables, either the logic (in added methods) was not called at all, or not all mapping values supposed to be supported were in fact handled. If it worked well then, maybe the complex methods are not needed and simple mappings (number <=> string) would suffice? For example, when handling "input.eco.switchable" -- in BTW we have a similarly written |
If will have time today will check it if no then tomorrow.
For real test on my unit was tests of (switch to/from bypass/ecomode), but after that my unit stuck in ecomode was unable to test for real only by logs (they all avaliable in previous prs), only after that I added to check bypass range/ecomode range.
No, I added this method (check range) to be exactly as in documentation of 9E/9SX that ups when switched to ecomode (needs to check when in bypass if can be switched by thresholds). Same for bypass.
input.bypass.switch.on=on input.bypass.switch.off=off So if user switch bypass on/off by buttons HU_FLAG_SEMI_STATIC should be updated as I remember from tests or better to change it? I added |
Yes I think will be better to be quick updated, maybe when input power/freq by range from the wall will be changed for example... Then ups will change bypass mode. HU_FLAG_SEMI_STATIC can't do that? (don't remember) |
|
✅ Build nut 2.8.3.3379-master completed (commit c3c2568a21 by @jimklimov) |
|
✅ Build nut 2.8.3.3382-master completed (commit b0a0bb59e3 by @jimklimov) |
Signed-off-by: DaRK AnGeL <28630321+masterwishx@users.noreply.github.com>
|
Tested : LGTM , waiting your approval:) |
|
Just for info: So I think my 9E have some issues in firmware (cuted/partial from 9sx firmware about ecomode) Also when asked time ago for Eaton support, they said only in snmp ecomode can work on 9E. But they don't knew that I can add support for nut for 9E with usb :) So hopefully some time will find how to solve it... Maybe will check by ecomode range (if can be switched back to online when changed) Maybe needs to be fixed in libusb like was for ups name etc... |
BTW, CCing @arnaudquette-eaton : can you please check if the issue is known/addressed internally? Whether this was intended to be supported or not, having devices in the field that can in fact be somewhat bricked by accepting some command sequence is anyhow a bug to fix, right? |
|
@masterwishx : thanks for the new test and log :) The method seems quieter now, confirming that it remains in ECO mode every 2 seconds: ...with no re-publication of buzz mode on the bus after the initial posting (with two tokens) back when the driver was first initialized: The INSTCMD and SETVAR events (just log excerpts, no analysis); it may have been just 15 minutes, but quite busy ones :) |
It's looks OK I think, just tested with cmd/variables If needs more time to log next time let me know... |
|
@masterwishx @ZivertX : the PR looks OK to me code-wise (and by reasonable not-noisy behavior); but you are judges if it is actually good functionally regarding ECO/bypass/ESS/normal reporting and enablement :) |
@arnaudquette-eaton as we know that you retired from your child(nut), your help in adding rest unknown variables and bypass/ecomode was invaluable. If you will find time to answer at least once/twice in one year will be great to continue help with Eaton driver in situations where no one else can contribute and help with it. :) |
To me also looks good:
Unfortunately @ZivertX seems don't have time now Also will try to ask in Unraid plugin forum someone to test who has 9sx. (ESS = only two enterprise ups units has it, not sure they use NUT :)) Any way can be merged for now I think. |
Not sure we will get the answer here but for the future info better that pr will be open until then or no matter if merged? Have opened isuue just in case: |
…tic" chars at level 7 [networkupstools#2956] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>


Signed-off-by: DaRK AnGeL 28630321+masterwishx@users.noreply.github.com
To continue work for #2949 :
To make automatic ECO Mode commands:
that run Bypass On then ECO Mode Enable and back instead of users are run two separate commands or variables :
or