-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
EATON HID: add missing usages and paths - ECO Mode #2637
Conversation
Signed-off-by: Arnaud Quette <arnaudquette@eaton.com>
Signed-off-by: Arnaud Quette <arnaudquette@eaton.com>
Signed-off-by: DaRK AnGeL <masterwishx@gmail.com>
drivers/mge-hid.c
Outdated
/* { "device.usb.version", ST_FLAG_STRING, 20, "UPS.System.USB.iVersion", NULL, NULL, HU_FLAG_STATIC, stringid_conversion },*/ | ||
|
||
{ "device.usb.version", ST_FLAG_STRING, 20, "UPS.System.USB.iVersion", NULL, NULL, HU_FLAG_STATIC, stringid_conversion }, /* FIXME */ | ||
{ "device.usb.mode", ST_FLAG_STRING, 20, "UPS.System.USB.Mode", NULL, NULL, HU_FLAG_STATIC, stringid_conversion }, /* FIXME */ |
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.
I don't think this one is useful, and not a string (1 to set in bootloader )
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.
commented
drivers/mge-hid.c
Outdated
|
||
{ "device.usb.version", ST_FLAG_STRING, 20, "UPS.System.USB.iVersion", NULL, NULL, HU_FLAG_STATIC, stringid_conversion }, /* FIXME */ | ||
{ "device.usb.mode", ST_FLAG_STRING, 20, "UPS.System.USB.Mode", NULL, NULL, HU_FLAG_STATIC, stringid_conversion }, /* FIXME */ | ||
{ "device.gateway.power.rate", ST_FLAG_STRING, 20, "UPS.System.Gateway.PowerRate", NULL, NULL, HU_FLAG_STATIC, stringid_conversion }, /* FIXME */ |
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.
ditto above, don't think it's useful, and not a string (level of power provided by the UPS to the network card
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.
commented
drivers/mge-hid.c
Outdated
@@ -1292,7 +1294,7 @@ static hid_info_t mge_hid2nut[] = | |||
/* Refer to Note 1 (This point will need more clarification!) | |||
{ "battery.charger.status", 0, 0, "UPS.BatterySystem.Charger.PresentStatus.Used", NULL, "%.0f", HU_FLAG_QUICK_POLL, eaton_abm_enabled_legacy_info }, */ | |||
/* This data is the actual ABM status information */ | |||
{ "battery.charger.status", 0, 0, "UPS.BatterySystem.Charger.Mode", NULL, "%.0f", HU_FLAG_QUICK_POLL, eaton_abm_status_info }, | |||
{ "battery.charger.status", 0, 0, "UPS.BatterySystem.Charger.Status", NULL, "%.0f", HU_FLAG_QUICK_POLL, eaton_abm_status_info }, |
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.
to be tested, may be avail on some units, not others. May need both Mode and Status
Unified charger info,bitmap with :
Status on bit 0-3:
0x0: Off
0x1: Charging
0x2: Floating
0x3: On, not charging
0x4: Discharging
0x5-0xF : Reserved
Mode on bit 4-6:
0: CC
1: ABM
2-7 : Reserved
Error on bit 7:
0: Good
1: In error
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.
Also ABM table commented needs to be changes?
drivers/mge-hid.c
Outdated
@@ -1482,8 +1484,9 @@ static hid_info_t mge_hid2nut[] = | |||
{ "outlet.1.id", 0, 0, "UPS.OutletSystem.Outlet.[2].OutletID", NULL, "%.0f", HU_FLAG_STATIC, NULL }, | |||
{ "outlet.1.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, "UPS.OutletSystem.Outlet.[2].OutletID", NULL, "PowerShare Outlet 1", HU_FLAG_ABSENT, NULL }, | |||
{ "outlet.1.switchable", 0, 0, "UPS.OutletSystem.Outlet.[2].PresentStatus.Switchable", NULL, "%s", HU_FLAG_STATIC, yes_no_info }, | |||
{ "outlet.1.status", 0, 0, "UPS.OutletSystem.Outlet.[2].PresentStatus.SwitchOn/Off", NULL, "%s", 0, on_off_info }, | |||
{ "outlet.1.status", 0, 0, "UPS.OutletSystem.Outlet.[1].Status", NULL, "%s", 0, on_off_info }, |
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.
ditto, may need both.... this one provides more than just on/off
Global status of the load segment :
0 : Not powered
1 : Not protected
2 : 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.
so to leave { "outlet.2.status", 0, 0, "UPS.OutletSystem.Outlet.[3].PresentStatus.SwitchOn/Off", NULL, "%s", 0, on_off_info }, ?
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.
0,1,2 thius mean = NULL, "%.2f", 0, NULL }, or NULL, "%.0f", HU_FLAG_STATIC, NULL },
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.
means a lookup function, something like:
static info_lkp_t eaton_enable_disable_info[] = {
{ 0, "not powered", NULL, NULL },
{ 1, "not protected", NULL, NULL },
{ 2, "protected", NULL, NULL },
{ 0, NULL, NULL, NULL }
};
drivers/mge-hid.c
Outdated
/* FIXME: should better use UPS.OutletSystem.Outlet.[1].Status? */ | ||
{ "outlet.1.idesignator", 0, 0, "UPS.OutletSystem.Outlet.[1].iDesignator", NULL, "%s", 0, on_off_info }, /* needs to check */ |
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.
stringid_conversion (thats an iValue, so indexed string), not on_off ;)
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.
changed
drivers/mge-hid.c
Outdated
/* 0: The outlet is not ECO controlled. / 1 : The outlet is ECO controlled. => Readonly! use some yes_no_info | ||
{ "outlet.1.ecocontrol", 0, 0, "UPS.OutletSystem.Outlet.[2].ECOControl", NULL, "%.2f", 0, NULL },*/ | ||
/* 0: The outlet is not ECO controlled. / 1 : The outlet is ECO controlled. => Readonly! use some yes_no_info */ | ||
{ "outlet.1.ecocontrol", 0, 0, "UPS.OutletSystem.Outlet.[2].ECOControl", NULL, "%.2f", 0, NULL }, |
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.
nut suitable name to be found!
need a lookup function, like on_off, but for:
0 : The outlet is not ECO controlled.
1 : The outlet is ECO controlled.
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.
added function
Signed-off-by: DaRK AnGeL <masterwishx@gmail.com>
Ref: #2495 2nding @jimklimov comment to base of master, and include my base PR in yours |
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.
to be tested, may be avail on some units, not others. May need both Mode and Status
Unified charger info,bitmap with :
Status on bit 0-3:
0x0: Off
0x1: Charging
0x2: Floating
0x3: On, not charging
0x4: Discharging
0x5-0xF : Reserved
Mode on bit 4-6:
0: CC
1: ABM
2-7 : Reserved
Error on bit 7:
0: Good
1: In error
So this is not right table? and needs to change as you wrote above?
- Charger ABM mode | Charging | Floating | Resting | Discharging | Disabled | Disabled
- UPS.BatterySystem.Charger.Mode | 1 | 3 | 4 | 2 | 6 | 6
Signed-off-by: DaRK AnGeL <28630321+masterwishx@users.noreply.github.com>
Signed-off-by: DaRK AnGeL <28630321+masterwishx@users.noreply.github.com>
Signed-off-by: DaRK AnGeL <28630321+masterwishx@users.noreply.github.com>
Found that "Editing" a PR now allows to change the target branch, so this instance is now the main one of the flock. |
@arnaudquette-eaton @jimklimov I made some changes from comments, please check when you have time |
@@ -689,6 +689,12 @@ static info_lkp_t pegasus_yes_no_info[] = { | |||
{ 0, NULL, NULL, NULL } | |||
}; | |||
|
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.
Added function like yes_no
drivers/mge-hid.c
Outdated
@@ -864,17 +870,25 @@ static info_lkp_t eaton_converter_online_info[] = { | |||
{ 0, NULL, NULL, NULL } | |||
}; | |||
|
|||
static info_lkp_t eaton_outlet_status_enable_disable_info[] = { |
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.
Added func for outlet_status
…'work/2495' NOTE: ECO entries in code and docs go before the ALARM entries. Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
✅ Build nut 2.8.2.2340-master completed (commit 6afacfd52a by @masterwishx) |
✅ Build nut 2.8.2.2349-master completed (commit cbece0107f by @jimklimov) |
…andard as around [networkupstools#2637] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…upstools#2637] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
This PR is not as contended as the follow-up in #2660 with deeper changes into existing driver logic, so it was a good idea to separate the two :) I intend to merge this one as soon as CI is satisfied with the recent revision. |
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ls#2637 (revised in later PR) Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…upstools#2637] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Confirm #2637 for ECO/bypass mode , #2660 added statuses for ABM , @jimklimov sorry again that not made a separate pr for ABM |
Adding HE/ECO mode, Bypass On/Off for Eaton USB UPS Online Models + Adding Missing usages and paths
Continue work for #2636
Fixes #2485
Ref #2495
Added: