Nut no longer functions with belkin usb avr

Bug #209001 reported by Andrew
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
nut (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: nut

I had nut 2.2.0-2 installed and just upgraded from gutsy to hardy beta and it installed 2.2.1-2.1ubuntu4

I get the following output:
sudo /lib/nut/megatec_usb -u root -a belkin -DDDDD
Network UPS Tools 2.2.1- - Megatec protocol driver 1.5.9 [megatec_usb]
Carlos Rodrigues (c) 2003-2007

Serial-over-USB transport layer for Megatec protocol driver [megatec_usb]
Andrey Lelikov (c) 2006, Alexander Gordeev (c) 2006-2007, Jon Gough (c) 2007

Checking device (0665/5161) (001/002)
- 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 => FAILED [timeout]
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
5 out of 5 detection attempts failed (minimum failures: 2).
Megatec protocol UPS not detected.

Here is my ups.conf:
[belkin]
  driver = megatec_usb
  port = auto
  lowbatt = 30
  mfr = Belkin
  model = F6C550-AVR

Looking on google, this seems to be a regression of the megatec-usb driver in 2.2.1-2.1ubuntu4.

I will try to find an old deb for 2.2.0-2 until this can be fixed as it simply will not work with 2.2.1-2.1ubuntu4

Thank you!

Related branches

Revision history for this message
Andrew (andrew-rw-robinson) wrote :

Note that this is the xubuntu hardy amd64 distro version

Revision history for this message
Andrew (andrew-rw-robinson) wrote :

Confirmation:

I just downloaded the old version from:
https://launchpad.net/ubuntu/hardy/amd64/nut/2.2.0-2build1

File:
http://launchpadlibrarian.net/10872334/nut_2.2.0-2build1_amd64.deb

And the UPS is functioning again. This is a serious regression for Belkin owners, hopefully this can be fixed before Hardy is official. If not, any chance at rolling this back in hardy?

Thanks again,
Andrew

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

Confirmed for me too.

After downgrading to the 2.2.0 version using Andrew's link's package muy UPS works again. I'm using Hardy 64 up to date.

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

Can you attach the output of lsusb -v?

Thanks
chuck

Chuck Short (zulcss)
Changed in nut:
status: New → Incomplete
Revision history for this message
Andrew (andrew-rw-robinson) wrote :
Revision history for this message
Chuck Short (zulcss) wrote :

Hi, Can you provid a dmesg as well?

Thanks
chuck

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

Can you try use the usbhid-ups driver?

Thanks
chuck

Chuck Short (zulcss)
Changed in nut:
importance: Undecided → Low
Revision history for this message
Andrew (andrew-rw-robinson) wrote :

usbhid-ups does not support my belkin ups. I tried it anyway to humor you, but no luck:
sudo /lib/nut/usbhid-ups -DDD -a belkin
Network UPS Tools: 0.29 USB communication driver - core 0.32 (2.2.1-)

debug level is '3'
upsdrv_initups...
Checking device (0000/0000) (002/001)
- VendorID: 0000
- ProductID: 0000
- Manufacturer: unknown
- Product: unknown
- Serial Number: unknown
- Bus: 002
Trying to match device
Device does not match - skipping
Checking device (0665/5161) (001/002)
- VendorID: 0665
- ProductID: 5161
- Manufacturer: Cypress Semiconductor
- Product: USB to Serial
- Serial Number: unknown
- Bus: 001
Trying to match device
Device does not match - skipping
Checking device (0000/0000) (001/001)
- VendorID: 0000
- ProductID: 0000
- Manufacturer: unknown
- Product: unknown
- Serial Number: unknown
- Bus: 001
Trying to match device
Device does not match - skipping
No appropriate HID device found
No matching HID UPS found

Revision history for this message
Andrew (andrew-rw-robinson) wrote :
Revision history for this message
Arnaud Quette (aquette) wrote : Re: [Bug 209001] [NEW] Nut no longer functions with belkin usb avr

Carlos,

is this bug a known regression of 2.2.1 vs 2.2.0?
I can't find much in the ChangeLog.

https://bugs.launchpad.net/bugs/209001

thanks,
-- Arnaud

Revision history for this message
Arnaud Quette (aquette) wrote : Re: [Nut-upsuser] [Bug 209001] [NEW] Nut no longer functions with belkin usb avr

thanks for this update Arjen.

so there are chances that this has been backported in Testing /
2.2.2-pre1 (released today).

Can you (the bug reporters) grab this, call configure as per the
packaging/debian/rules, make and test from the build dir?

-- Arnaud

Revision history for this message
Andrew (andrew-rw-robinson) wrote :

No, 2.2.2-pre1 does not work.

Perhaps I screwed up, but here are the steps I took:
downloaded an extracted the source package
cd nut-2.2.2-pre1
ln -s packaging/debian ./
dpkg-buildpackage -rfakeroot -b

This fails, but after the code built, so I then attempted:
sudo ./packaging/debian/nut/lib/nut/megatec_usb -DDD -a belkin

Output:
Checking device (0665/5161) (001/002)
- VendorID: 0665
- ProductID: 5161
- Manufacturer: Cypress Semiconductor
- Product: USB to Serial
- Serial Number: unknown
- Bus: 001
Trying to match device
Device matches
failed to claim USB device, trying 2 more time(s)...
detaching kernel driver from USB device...
trying again to claim USB device...
Starting UPS detection process...
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
Asking for UPS status [Q1]...
Q1 => FAILED [timeout]
5 out of 5 detection attempts failed (minimum failures: 2).
Megatec protocol UPS not detected.

I am still running the old nut, so I am not sure if it picked up any libraries from that or not, but it doesn't look like the new version helps. Has this bug been reported upstream?

Revision history for this message
Arnaud Quette (aquette) wrote :

2008/4/3, Arjen de Korte <email address hidden>:
> > so there are chances that this has been backported in Testing /
> > 2.2.2-pre1 (released today).
>
>
> No, it hasn't been backported as far as I can see, so this is something
> that needs to be done for nut-2.2.2-pre2. Since we have active maintainers
> for this driver, I didn't do this myself.
>
>
> > Can you (the bug reporters) grab this, call configure as per the
> > packaging/debian/rules, make and test from the build dir?
>
>
> That probably won't help (yet).

right, this has just been confirmed.

@Carlos, Andrey, Alexander, Jon: can one of you take care of
backporting this to Testing for -pre2?

thanks,
Arnaud
--
Linux / Unix Expert R&D - MGE Office Protection Systems - http://www.mgeops.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
Free Software Developer - http://arnaud.quette.free.fr/

Revision history for this message
Carlos Rodrigues (carlos-efr) wrote :

On Thu, Apr 3, 2008 at 8:11 AM, Arnaud Quette <email address hidden> wrote:
> @Carlos, Andrey, Alexander, Jon: can one of you take care of
> backporting this to Testing for -pre2?

With all the stuff happening with usbhid-ups and with a lack of free
time I was actually waiting for some indication that a -pre release
was impending before backporting the latest changes from the trunk.
I'll try getting this done over the weekend for megatec.c though.

--
Carlos Rodrigues

Revision history for this message
Arnaud Quette (aquette) wrote :

Hi Carlos,

2008/4/3, Carlos Rodrigues <email address hidden>:
> On Thu, Apr 3, 2008 at 8:11 AM, Arnaud Quette <email address hidden> wrote:
> > @Carlos, Andrey, Alexander, Jon: can one of you take care of
> > backporting this to Testing for -pre2?
>
>
> With all the stuff happening with usbhid-ups and with a lack of free
> time I was actually waiting for some indication that a -pre release
> was impending before backporting the latest changes from the trunk.
> I'll try getting this done over the weekend for megatec.c though.

thanks for jumping on this ;-)
@Ubuntu guys: though it would be better to have an FFE and include
2.2.2 in HH, you might prefer to grab only Carlos' patch to apply to
2.2.1.
If so, monitor Trac: http://boxster.ghz.cc/projects/nut/timeline

Arnaud
--
Linux / Unix Expert R&D - MGE Office Protection Systems - http://www.mgeops.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
Free Software Developer - http://arnaud.quette.free.fr/

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

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

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

  * debian/patches/01_fix_megatec_regression.dpatch
    - Readded support for various USB devices. (LP: #209001)

 -- Chuck Short <email address hidden> Mon, 07 Apr 2008 08:46:46 -0400

Changed in nut:
status: Incomplete → Fix Released
Revision history for this message
Andrew (andrew-rw-robinson) wrote :

Please re-open this bug.

I downloaded 2.2.1-2.1ubuntu5 from here:
http://launchpadlibrarian.net/13167950/nut_2.2.1-2.1ubuntu5_amd64.deb

Installed it and ran the daemon and the problem is still present.
2.2.0-2build1 is still the latest driver that is working

Revision history for this message
Andrew (andrew-rw-robinson) wrote :

Changing status as the 2.2.1-2.1ubuntu5 does not fix the issue

Changed in nut:
status: Fix Released → Confirmed
Revision history for this message
Arnaud Quette (aquette) wrote : Re: [Bug 209001] Re: Nut no longer functions with belkin usb avr

2008/4/8, Andrew <email address hidden>:
> Please re-open this bug.
>
> I downloaded 2.2.1-2.1ubuntu5 from here:
> http://launchpadlibrarian.net/13167950/nut_2.2.1-2.1ubuntu5_amd64.deb
>
$ > Installed it and ran the daemon and the problem is still present.
> 2.2.0-2build1 is still the latest driver that is working

@Andrew and David (maybe others):
do you have a chance to retrieve the latest svn Testing branch and
compile it (as per my previous instructions in the thread)? There is
no need to install nor to make a deb.
compiling and running the driver, in debug mode, from the build dir is
sufficient to validate the fix upstream...

so:
$ svn co svn://svn.debian.org/nut/branches/Testing
$ configure--prefix=/ \
            --sysconfdir=/etc/nut \
            --mandir=/usr/share/man \
            --libdir=/usr/lib \
            --includedir=/usr/include \
            --without-ssl \
            --with-hal \
            --with-cgi \
            --with-lib \
            --disable-shared \
            --with-statepath=/var/run/nut \
            --with-altpidpath=/var/run/nut \
            --with-drvpath=/lib/nut \
            --with-cgipath=/usr/lib/cgi-bin/nut \
            --with-htmlpath=/var/www/nut \
            --with-pidpath=/var/run/nut \
            --datadir=/usr/share/nut \
            --with-user=nut --with-group=nut
$ make
$ drivers/megatec_usb -DDDDD -a belkin
and report back if the device is seen or not.

-- Arnaud

Revision history for this message
Andrew (andrew-rw-robinson) wrote :

Sure, glad to help from my end. Will give it a shot in a few hours or
so when I have a chance

Andrew

On 4/8/08, Arnaud Quette <email address hidden> wrote:
> 2008/4/8, Andrew <email address hidden>:
> > Please re-open this bug.
> >
> > I downloaded 2.2.1-2.1ubuntu5 from here:
> > http://launchpadlibrarian.net/13167950/nut_2.2.1-2.1ubuntu5_amd64.deb
> >
> $ > Installed it and ran the daemon and the problem is still present.
> > 2.2.0-2build1 is still the latest driver that is working
>
> @Andrew and David (maybe others):
> do you have a chance to retrieve the latest svn Testing branch and
> compile it (as per my previous instructions in the thread)? There is
> no need to install nor to make a deb.
> compiling and running the driver, in debug mode, from the build dir is
> sufficient to validate the fix upstream...
>
> so:
> $ svn co svn://svn.debian.org/nut/branches/Testing
> $ configure--prefix=/ \
> --sysconfdir=/etc/nut \
> --mandir=/usr/share/man \
> --libdir=/usr/lib \
> --includedir=/usr/include \
> --without-ssl \
> --with-hal \
> --with-cgi \
> --with-lib \
> --disable-shared \
> --with-statepath=/var/run/nut \
> --with-altpidpath=/var/run/nut \
> --with-drvpath=/lib/nut \
> --with-cgipath=/usr/lib/cgi-bin/nut \
> --with-htmlpath=/var/www/nut \
> --with-pidpath=/var/run/nut \
> --datadir=/usr/share/nut \
> --with-user=nut --with-group=nut
> $ make
> $ drivers/megatec_usb -DDDDD -a belkin
> and report back if the device is seen or not.
>
> -- Arnaud
>
> --
> Nut no longer functions with belkin usb avr
> https://bugs.launchpad.net/bugs/209001
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Andrew (andrew-rw-robinson) wrote :

There is no "configure" executable file provided with nut. So I tried autoconf:

autoconf
configure.in:12: error: possibly undefined macro: AM_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.in:16: error: possibly undefined macro: AM_MAINTAINER_MODE
configure.in:63: error: possibly undefined macro: AM_PROG_CC_C_O
configure.in:69: error: possibly undefined macro: AC_PROG_LIBTOOL
configure.in:256: error: possibly undefined macro: AM_CONDITIONAL
configure.in:312: error: possibly undefined macro: AC_DISABLE_STATIC

Not looking good, but I tried "./configure ..." with your argument anyways and got:
...
checking whether time.h and sys/time.h may both be included... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
./configure: line 5460: syntax error near unexpected token `include/nut_stdint.h'
./configure: line 5460: `AX_CREATE_STDINT_H(include/nut_stdint.h)'

Revision history for this message
Arnaud Quette (aquette) wrote :

2008/4/8, Andrew:
> There is no "configure" executable file provided with nut. So I tried
> autoconf:
> ...

right, I forgot to add that, but you need to call autoreconf not
simply autoconf (note the "re")
the problem you're facing might be due to an oldish autoconf/automake set.
which version are you using (both ac, am and ubuntu)?

-- Arnaud

Revision history for this message
Andrew (andrew-rw-robinson) wrote :

autoreconf is part of the deprecated autoconf2.13 package is it not?

I currently have installed associated with autoconf:
autoconf 2.61-4
autotools-dev 20070725.1
pkg-config 0.22-1
m4 1.4.10-1
automake 1:1.10.1-2
automake1.4 1:1.4-p6-12 (dependency of glade and php5-dev)

Revision history for this message
Andrew (andrew-rw-robinson) wrote :

Sorry, looks like autoconf ships autoreconf as well, trying now...

Revision history for this message
Andrew (andrew-rw-robinson) wrote :

Looks like SVN is functional for my UPS:

Serial-over-USB transport layer for Megatec protocol driver [megatec_usb]
Andrey Lelikov (c) 2006, Alexander Gordeev (c) 2006-2007, Jon Gough (c) 2007

debug level is '3'
Checking device (0665/5161) (002/002)
- VendorID: 0665
- ProductID: 5161
- Manufacturer: Cypress Semiconductor
- Product: USB to Serial
- Serial Number: unknown
- Bus: 002
Trying to match device
Device matches
failed to claim USB device, trying 2 more time(s)...
detaching kernel driver from USB device...
trying again to claim USB device...
Starting UPS detection process...
Asking for UPS status [Q1]...
Q1 => OK [(126.9 126.9 126.9 025 60.2 13.8 N/.A 00001001]
Asking for UPS status [Q1]...
Q1 => OK [(126.9 127.2 126.9 021 60.2 13.8 N/.A 00001001]
Asking for UPS status [Q1]...
Q1 => OK [(126.6 126.6 126.6 021 60.2 13.8 N/.A 00001001]
Asking for UPS status [Q1]...
Q1 => OK [(126.9 126.9 126.9 021 60.2 13.8 N/.A 00001001]
Asking for UPS status [Q1]...
Q1 => OK [(127.2 126.9 127.2 021 60.2 13.8 N/.A 00001001]
0 out of 5 detection attempts failed (minimum failures: 2).
Cancelling any pending shutdown or battery test.
Asking for UPS information [I]...
I => FAILED [short read]
I detail: (0 bytes) =>
Megatec protocol UPS detected.

Revision history for this message
Arnaud Quette (aquette) wrote :

thanks for your testing and feedback Andrew.

@Chuck: it seems that you have not taken the right patch(s).
@Alex: can you please point to Chuck the right ones?
possibly using Charles' Trac (http://boxster.ghz.cc/projects/nut/timeline)

-- Arnaud

Revision history for this message
Arnaud Quette (aquette) wrote :

2008/4/10, Alexander I. Gordeev <email address hidden>:
> On Thu, 10 Apr 2008 15:19:09 +0400, Arnaud Quette <email address hidden> wrote:
>
> > thanks for your testing and feedback Andrew.
> >
> > @Chuck: it seems that you have not taken the right patch(s).
> > @Alex: can you please point to Chuck the right ones?
> > possibly using Charles' Trac (http://boxster.ghz.cc/projects/nut/timeline)
> >
> > -- Arnaud
> >
>
>
> The right changes are in revisions 1420-1422 and 1424-1426.
> I've attached the cumulative patch.

thanks a lot for your quick action Alex.
@Chuck: up to you now...

-- Arnaud

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

Im in the middle of backporting the patch.

Thanks
chuck

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

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

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

  * debian/patches/01_fix_megatec_regression.dpatch
   - Updated patch thanks to Alexander I. Gordeev <lasaine -at-
     lvk.cs.msu.su>. (LP: #209001)

 -- Chuck Short <email address hidden> Thu, 10 Apr 2008 09:33:53 -0400

Changed in nut:
status: Confirmed → Fix Released
Revision history for this message
Arnaud Quette (aquette) wrote :

2008/4/10, Launchpad Bug Tracker <email address hidden>:
> This bug was fixed in the package nut - 2.2.1-2.1ubuntu6
> ...

it's your turn Andrew ;-)

-- /me

Revision history for this message
Andrew (andrew-rw-robinson) wrote :
Revision history for this message
David Erosa (erosa) wrote :
Download full text (3.9 KiB)

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) =>
ge...

Read more...

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

I guess I'd better open a new bug for this, right?

Revision history for this message
Andrew (andrew-rw-robinson) wrote :

Also I see that in the new version my syslog is filling up with these
kernel messages (4 every minute):
usb 2-1: usbfs: process 6437 (megatec_usb) did not claim interface 0 before use

It looks like I am having the problem of it not getting battery
percentage either, I guess I spoke too soon on it working.

Revision history for this message
Nick Barcet (nijaba) wrote :

David Erosa wrote:
> I guess I'd better open a new bug for this, right?

Sound like a good idea, indeed. Thanks a lot.

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.