-
-
Notifications
You must be signed in to change notification settings - Fork 381
ECOmode-auto-addon2-todo #2956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
ECOmode-auto-addon2-todo #2956
Conversation
…p.auto" Signed-off-by: DaRK AnGeL <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 <[email protected]>
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's how I usually do it so it shows which function emits the message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
❌ Build nut 2.8.3.3195-master failed (commit b7d6731626 by @masterwishx) |
Signed-off-by: DaRK AnGeL [email protected]
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