No battery charge percentage on belkin usb avr

Bug #215389 reported by David Erosa
2
Affects Status Importance Assigned to Milestone
nut (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: nut

After updating to last nut package (2.2.1-2.1ubuntu6), the megatec_usb driver seems to be working, except for the charge percentage:

$ /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%
...

Related branches

Revision history for this message
Chuck Short (zulcss) wrote :

Hi David,

Can you add the following to your /etc/apt/sources.list and try the ones in my PPA.

deb http://ppa.launchpad.net/zulcss/ubuntu hardy main
deb-src http://ppa.launchpad.net/zulcss/ubuntu hardy main

Thanks
chuck

Changed in nut:
status: New → In Progress
Revision history for this message
Arnaud Quette (aquette) wrote : Re: [Bug 215389] [NEW] No battery charge percentage on belkin usb avr
Download full text (4.8 KiB)

2008/4/10, David Erosa <email address hidden>:
> Public bug reported:
>
> Binary package hint: nut
>
> After updating to last nut package (2.2.1-2.1ubuntu6), the megatec_usb
> driver seems to be working, except for the charge percentage:
>
> $ /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 pend...

Read more...

Revision history for this message
Carlos Rodrigues (carlos-efr) wrote : Re: [Nut-upsuser] [Bug 215389] [NEW] No battery charge percentage on belkin usb avr

On Fri, Apr 11, 2008 at 8:02 PM, Arnaud Quette <email address hidden> wrote:
> 2008/4/10, David Erosa <email address hidden>:
> > After updating to last nut package (2.2.1-2.1ubuntu6), the megatec_usb
> > driver seems to be working, except for the charge percentage:
[...]
> > F => FAILED [short read]
> > F detail: (0 bytes) =>
> > Cannot calculate charge percentage for this UPS. <-****************
[...]
> > So I tried the svn version (as today, revision 143) and the result is:
> > F => OK [#230.0 002 12.00 50.0]
> > 12.0V battery, interval [9.7V, 13.7V]. <-----****************
> > Done setting up the UPS.

The first snippet shows that the driver couldn't get the ratings from
the UPS, and without those values there's no way to calculate the
charge percentage. There have been some improvements in reliability
while talking to the UPS, so maybe that's why the newer version works.

You can always use the battvolts option though, like Arnaud said. And
it looks like you need to use it because the calculated percentage
doesn't look correct (assuming the UPS is fully charged). The thing
is, for a given nominal battery voltage, different models from
different vendors behave differently, and there is no way to tell them
apart to ajust the calculation.

--
Carlos Rodrigues

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

@Chuck: I'll try them on monday since I am not at home for the weekend.
@Arnaud: It wasn't, I was suffering the bug 209001 issue. Hardy version was not working until nut_2.2.1-2.1ubuntu6, so I was using Gutsy version.
@Carlos: I'll check the "battvolts" option with the SVN version. Thanks.

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

Chuck, I tried your repo and installed nut version 2.2.1-2.1ubuntu7~ppa3 and everything seems to be working right:

$ /lib/nut/megatec_usb -DD -a SAI
...
Checking device (0665/5161) (001/004)
- VendorID: 0665
- ProductID: 5161
- Manufacturer: Cypress Semiconductor
- Product: USB to Serial
- Serial Number: unknown
- Bus: 001
Trying to match device
Device matches
Starting UPS detection process...
Asking for UPS status [Q1]...
Q1 => OK [(226.9 226.9 226.9 043 50.1 13.6 25.0 00001001]
Asking for UPS status [Q1]...
Q1 => OK [(226.9 226.9 226.9 043 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.4 225.4 225.4 042 50.1 13.6 25.0 00001001]
Asking for UPS status [Q1]...
Q1 => OK [(225.4 225.0 225.4 042 50.1 13.6 25.0 00001001]
0 out of 5 detection attempts failed (minimum failures: 2).
Asking for UPS information [I]...
I => FAILED [short read]
Megatec protocol UPS detected.
Cancelling any pending shutdown or battery test.
Asking for UPS power ratings [F]...
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]...
Q1 => OK [(225.4 225.4 225.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]...
Q1 => OK [(225.4 225.4 225.4 042 50.1 13.6 25.0 00001001]
Calculated battery charge: 97.5%
...

As for the battvolts option, I don't really know the right values for "The battery voltage interval". I think I can live with that 97.5% :)

Revision history for this message
Chuck Short (zulcss) wrote :

Thanks,

The update for nut should be uploaded to the archive soon. Thanks again for testing.

chuck

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nut - 2.2.1-2.1ubuntu7

---------------
nut (2.2.1-2.1ubuntu7) hardy; urgency=low

  * debian/patches/01_fix_megatec_regression.dpatch
    - Fix more megatec_usb driver regressions. (LP: #215389)

 -- Chuck Short <email address hidden> Mon, 14 Apr 2008 14:25:48 -0400

Changed in nut:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.