Skip to content
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 #2637

Open
wants to merge 92 commits into
base: master
Choose a base branch
from

Conversation

masterwishx
Copy link
Contributor

@masterwishx masterwishx commented Sep 23, 2024

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:

Variables: 

battery.charger.status: discharging
device.usb.version: 01.29
input.eco.switchable: normal
outlet.1.designator: AC OUTPUT
outlet.1.protect.status: protected
input.transfer.forced: enabled
input.eco.switchable: ECO
input.bypass.switch.on: off
etc ...

R/W variables:

input.eco.switchable
input.bypass.switch.on
etc ..

Commands: 

ecomode.disable - Take the UPS out of High Efficiency (aka ECO) mode
ecomode.enable - Put UPS in High Efficiency (aka ECO) mode
essmode.disable - Take the UPS out of Energy Saver System (aka ESS) mode
essmode.enable - Put UPS in Energy Saver System (aka ESS) mode
bypass.start - Put the UPS in bypass mode
bypass.stop - Take the UPS out of bypass mode

@masterwishx masterwishx changed the title first trying to add values Ffirst trying to add values Sep 23, 2024
@masterwishx masterwishx changed the title Ffirst trying to add values First try to add values for #2636 Sep 23, 2024
/* { "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 */
Copy link
Contributor

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 )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented


{ "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 */
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented

@@ -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 },
Copy link
Contributor

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

Copy link
Contributor Author

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?

@@ -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 },
Copy link
Contributor

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

Copy link
Contributor Author

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 }, ?

Copy link
Contributor Author

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 },

Copy link
Contributor

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 }
};

/* 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 */
Copy link
Contributor

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 ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

/* 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 },
Copy link
Contributor

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.

Copy link
Contributor Author

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 <[email protected]>
@arnaudquette-eaton
Copy link
Contributor

arnaudquette-eaton commented Sep 24, 2024

Ref: #2495

2nding @jimklimov comment to base of master, and include my base PR in yours

Copy link
Contributor Author

@masterwishx masterwishx left a 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

@jimklimov jimklimov marked this pull request as draft September 24, 2024 11:33
@jimklimov
Copy link
Member

jimklimov commented Sep 24, 2024

Found that "Editing" a PR now allows to change the target branch, so this instance is now the main one of the flock.

@jimklimov jimklimov mentioned this pull request Sep 24, 2024
@jimklimov jimklimov changed the base branch from work/2495-eaton-usb-ids to master September 24, 2024 11:38
@jimklimov jimklimov marked this pull request as ready for review September 24, 2024 11:38
@jimklimov jimklimov changed the title First try to add values for #2636 EATON HID: add missing usages and paths Sep 24, 2024
@jimklimov jimklimov added enhancement Eaton USB Incorrect or missing readings On some devices driver-reported values are systemically off (e.g. x10, x0.1, const+Value, etc.) impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) ECO mode labels Sep 24, 2024
@jimklimov jimklimov added this to the 2.8.4 milestone Sep 24, 2024
@masterwishx
Copy link
Contributor Author

@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 }
};

Copy link
Contributor Author

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

@@ -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[] = {
Copy link
Contributor Author

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

@masterwishx
Copy link
Contributor Author

@jimklimov what is error about ?

upsrw -u admin -p adminpass -s input.bypass.switch.off=bypassOff -w Eaton9E2000i
Unexpected response from upsd: ERR TOO-LONG

@masterwishx
Copy link
Contributor Author

@jimklimov what is error about ?

upsrw -u admin -p adminpass -s input.bypass.switch.off=bypassOff -w Eaton9E2000i
Unexpected response from upsd: ERR TOO-LONG

becouse changed ecomode to ecoModeOn so can throw same error

Signed-off-by: DaRK AnGeL <[email protected]>
@masterwishx
Copy link
Contributor Author

FWIW, on my Eaton Ellipse ECO 650 I see few changes in upsc dumps:

 driver.parameter.vendor: EATON
 driver.parameter.vendorid: 0463
 driver.state: quiet
-driver.version: 2.8.2.1064-1064-g501bbdc62
+driver.version: 2.8.2.1085.57-1142-gf76af4d71
 driver.version.data: MGE HID 1.49
 driver.version.internal: 0.57
 driver.version.usb: libusb-1.0.24 (API: 0x1000108)
 input.transfer.high: 264
 input.transfer.low: 161
 outlet.1.desc: PowerShare Outlet 1
+outlet.1.ecocontrol: The outlet is ECO controlled
 outlet.1.id: 2
 outlet.1.status: on
 outlet.1.switchable: yes
 outlet.2.desc: PowerShare Outlet 2
+outlet.2.ecocontrol: The outlet is not ECO controlled
 outlet.2.id: 3
 outlet.2.status: on
 outlet.2.switchable: yes

Did not try any active commands or settings, a server is fed off this UPS now.

It seems your ups is not online ups, there for you can't see new values for ECO and bypass. As ECO mode take voltage from input bypass to output without invertor that using when online. The ECO control on your ups is something different like economic maybe that cut off power from outlet for energy saving

ECO Control = With an efficient electrical design and the EcoControl function
(USB models), which automatically disables peripherals when
the master device is turned off . from Eaton docs
( the master outlet used to automatically power off the slave outlets. )

@masterwishx
Copy link
Contributor Author

@jimklimov please check if can be merged

drivers/mge-hid.c Outdated Show resolved Hide resolved
drivers/mge-hid.c Outdated Show resolved Hide resolved
@@ -45,6 +45,7 @@ static struct {
{ "BOOST", "VOLTAGE BOOST", 1 },
{ "CAL", "CALIBRATION", 1 },
{ "BYPASS", "BYPASS", 2 },
{ "ECO", "ECO", 2 },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity 2 seems a bit excessive here (putting ECO in the same category as LB) - Severity 1 instead?

@arnaudquette-eaton
Copy link
Contributor

@arnaudquette-eaton @jimklimov

as we added UPS.BatterySystem.Charger.Status here it seems we have other values from UPS.BatterySystem.Charger.Mode by #2637 (comment)

that i have in 9E model , so needs to add other values and fix ABM table for .Status , maybe in other pr ?

@arnaudquette-eaton any info for: UPS.BatterySystem.Charger.ChargerType, Type: Feature, ReportID: 0x26, Offset: 0, Size: 8, Value: 5?

Charger type
0 - None
1 - Extended (CLA)
2 - Large extension
3 - Extra large extension (XL)
4 - ABM
5 - Constant Charge (CC)

UPS.BatterySystem.Charger.ChargerID, Type: Feature, ReportID: 0x20, Offset: 16, Size: 8, Value: 1?

Item of charger collection, ID of charger
Only one charger, always 1

@masterwishx
Copy link
Contributor Author

masterwishx commented Oct 16, 2024

@arnaudquette-eaton

Something on:
Path: UPS.PowerConverter.Input.[2].Switchable, Type: Feature, ReportID: 0x2d, Offset: 0, Size: 8, Value: 1
should be bypass switch ability ?

@masterwishx
Copy link
Contributor Author

@jimklimov Maybe we can merge this pr as it's ready for ECO, if other will take more time maybe to finish?

@masterwishx masterwishx reopened this Oct 17, 2024
@jimklimov jimklimov modified the milestones: 2.8.4, 2.8.3 Oct 20, 2024
…'work/2495'

NOTE: ECO entries in code and docs go before the ALARM entries.

Signed-off-by: Jim Klimov <[email protected]>
@jimklimov
Copy link
Member

Bumped #2637 and #2660 against recent master changes (ALARM support landed into same spots almost everywhere).
NOTE: #2637 is still a strict subset of #2660.

So CI will spend some time re-checking them all...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DDL Eaton ECO mode enhancement impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) Incorrect or missing readings On some devices driver-reported values are systemically off (e.g. x10, x0.1, const+Value, etc.) USB
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

How to Set ECO/HE mode in Eaton 9E model
5 participants