Comment 32 for bug 209001

Revision history for this message
David Erosa (erosa) wrote :

Sorry I took so long to check the bug...

The new package seems to be almost working, but the driver says it can't calculate the battery %:
$ /lib/nut/megatec_usb -DDDDD -a SAI
...
Checking device (0665/5161) (001/007)
- VendorID: 0665
- ProductID: 5161
- Manufacturer: Cypress Semiconductor
- Product: USB to Serial
- Serial Number: unknown
- Bus: 001
Trying to match device
Device matches
get_data_agiler: raw dump: (0 bytes) =>
get_data_agiler: raw dump: (0 bytes) =>
Starting UPS detection process...
Asking for UPS status [Q1]...
Q1 => OK [(225.4 225.4 225.4 042 50.1 13.6 25.0 00001001]
Asking for UPS status [Q1]...
Q1 => OK [(225.4 225.4 225.4 042 50.1 13.6 25.0 00001001]
Asking for UPS status [Q1]...
Q1 => OK [(225.0 225.0 225.0 042 50.1 13.6 25.0 00001001]
Asking for UPS status [Q1]...
Q1 => OK [(225.4 225.0 225.0 043 50.1 13.6 25.0 00001001]
Asking for UPS status [Q1]...
Q1 => OK [(225.4 225.4 225.4 043 50.1 13.6 25.0 00001001]
0 out of 5 detection attempts failed (minimum failures: 2).
Asking for UPS information [I]...
get_data_agiler: raw dump: (0 bytes) =>
I => FAILED [short read]
I detail: (0 bytes) =>
Megatec protocol UPS detected.
Cancelling any pending shutdown or battery test.
Asking for UPS power ratings [F]...
get_data_agiler: raw dump: (0 bytes) =>
F => FAILED [short read]
F detail: (0 bytes) =>
Cannot calculate charge percentage for this UPS. <-****************
Done setting up the UPS.
Asking for UPS status [Q1]...
Q1 => OK [(225.4 225.4 225.4 042 50.1 13.6 25.0 00001001]
dstate_init: sock /var/run/nut/megatec_usb-SAI open on fd 5
Asking for UPS status [Q1]...
Q1 => OK [(225.4 225.4 225.4 042 50.1 13.6 25.0 00001001]
Asking for UPS status [Q1]...
Q1 => OK [(225.4 225.4 225.0 042 50.1 13.6 25.0 00001001]
...

So I tried the svn version (as today, revision 143) and the result is:
$ drivers/megatec_usb -DDDDD -a SAI
...
Checking device (0665/5161) (001/007)
- VendorID: 0665
- ProductID: 5161
- Manufacturer: Cypress Semiconductor
- Product: USB to Serial
- Serial Number: unknown
- Bus: 001
Trying to match device
Device matches
get_data_agiler: raw dump: (0 bytes) =>
Starting UPS detection process...
Asking for UPS status [Q1]...
get_data_agiler: raw dump: (0 bytes) =>
Q1 => OK [(226.9 226.9 226.9 044 50.1 13.6 25.0 00001001]
Asking for UPS status [Q1]...
get_data_agiler: raw dump: (0 bytes) =>
Q1 => OK [(226.9 226.9 226.9 044 50.1 13.6 25.0 00001001]
Asking for UPS status [Q1]...
get_data_agiler: raw dump: (0 bytes) =>
Q1 => OK [(226.9 227.4 226.9 043 50.1 13.6 25.0 00001001]
Asking for UPS status [Q1]...
get_data_agiler: raw dump: (0 bytes) =>
Q1 => OK [(227.4 227.4 227.4 042 50.1 13.6 25.0 00001001]
Asking for UPS status [Q1]...
get_data_agiler: raw dump: (0 bytes) =>
Q1 => OK [(227.4 227.4 226.9 044 50.1 13.6 25.0 00001001]
0 out of 5 detection attempts failed (minimum failures: 2).
Cancelling any pending shutdown or battery test.
Asking for UPS information [I]...
get_data_agiler: raw dump: (0 bytes) =>
get_data_agiler: raw dump: (0 bytes) =>
I => FAILED [short read]
I detail: (0 bytes) =>
Megatec protocol UPS detected.
Parameter [ignoreoff]: [false]
Asking for UPS power ratings [F]...
get_data_agiler: raw dump: (0 bytes) =>
get_data_agiler: raw dump: (24 bytes) => 23 32 33 30 2e 30 20 30 30 32 20
 31 32 2e 30 30 20 35 30 2e 30 0d 30 30
F => OK [#230.0 002 12.00 50.0]
12.0V battery, interval [9.7V, 13.7V]. <-----****************
Done setting up the UPS.
Asking for UPS status [Q1]...
get_data_agiler: raw dump: (0 bytes) =>
Q1 => OK [(227.4 227.4 227.4 043 50.1 13.6 25.0 00001001]
Calculated battery charge: 97.5% <-----****************
dstate_init: sock /var/run/nut/megatec_usb-SAI open on fd 5
Asking for UPS status [Q1]...
get_data_agiler: raw dump: (0 bytes) =>
Q1 => OK [(227.4 226.9 227.4 042 50.1 13.6 25.0 00001001]
Calculated battery charge: 97.5%
Asking for UPS status [Q1]...
get_data_agiler: raw dump: (0 bytes) =>
Q1 => OK [(227.4 226.9 226.9 044 50.1 13.6 25.0 00001001]
Calculated battery charge: 97.5%
...