Re: [Nut-upsuser] bcmxcp_usb can not communicate with Eaton Powerware 5110

2012-07-15 Thread Kjell Claesson
söndagen den 15 juli 2012 16.59.56 skrev  Greg Vickers:

Hi Greg,

> On 13/07/12 22:24, Charles Lepple wrote:
> > On Jul 13, 2012, at 12:41 AM, Greg Vickers wrote:
> >>0.238682get_answer: (128 bytes) => ab 01 79 01 02 50 00 50 01 00
> >>0e 00 01 00 10 50 0.239445 4f 57 45 52 57 41 52 45 20 55 50 53 20
> >>20 20 5c 00 00 00 00 00 00 00 00 00 0.240107 00 00 00 00 00 00 00
> >>00 00 00 00 00 00 00 00 00 00 00 51 51 00 00 00 00 51 0.240351 00
> >>00 00 00 00 00 00 f0 00 f0 00 00 00 f0 00 00 00 00 00 00 00 00 f0 00
> >>00 0.240558 00 00 00 00 00 00 51 00 00 51 00 00 00 00 00 00 00 00
> >>00 f0 00 00 00 00 00 0.241334 00 00 00 00 00 00 00 f0 18 3b ab 01
> >>0.241969get_answer: block_number = 1
> >>0.242121get_answer: sequence number (1) is ok
> >>0.242254get_answer: checksum is ok
> >>0.242891get_answer: block_number = 1
> >>0.243072Communications with UPS lost: get_answer: not the right
> >>sequence received 0!!!> 
> > Well, that's odd.

Yep that's odd. If it would be the last sequence the sequence-number should
read 82.
 The sequence is numbered in ascending order and on the last sequence the msb
is set to 1. (1010 = 82 Hex) 

> > 
> > I'm not an expert on this driver, but a quick read of that portion of the
> > code implies that this shouldn't happen.
> > 
> > The last line says the received sequence number is 0. I think the sequence
> > number is the 4th byte (my_buf[3]), which is 1 in the hex dump you
> > posted:
8<-snip

Yep Charles is right. The problem with the 5110 is that it was one of the 
first that was equipped with usb. This implementation is not following the
usb criteria. That is why there is difference between this and later ups'es.

Look at:
http://trac.networkupstools.org/projects/nut/browser/trunk/drivers/bcmxcp_usb.c#L49

And the difference in line 59 for the phonitextec interface that the 5110 use.

I have backed off a bit from the development, and I don't have any early 
Powerware to test the driver.

But I know that Arnaud made some changes around the problem with the 5110.

Regards
Kjell Claesson



___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] bcmxcp_usb can not communicate with Eaton Powerware 5110

2012-07-15 Thread Greg Vickers

On 13/07/12 22:24, Charles Lepple wrote:

On Jul 13, 2012, at 12:41 AM, Greg Vickers wrote:


   0.238682get_answer: (128 bytes) => ab 01 79 01 02 50 00 50 01 00 0e 00 
01 00 10 50
   0.239445 4f 57 45 52 57 41 52 45 20 55 50 53 20 20 20 5c 00 00 00 00 00 
00 00 00 00
   0.240107 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 51 00 
00 00 00 51
   0.240351 00 00 00 00 00 00 00 f0 00 f0 00 00 00 f0 00 00 00 00 00 00 00 
00 f0 00 00
   0.240558 00 00 00 00 00 00 51 00 00 51 00 00 00 00 00 00 00 00 00 f0 00 
00 00 00 00
   0.241334 00 00 00 00 00 00 00 f0 18 3b ab 01
   0.241969get_answer: block_number = 1
   0.242121get_answer: sequence number (1) is ok
   0.242254get_answer: checksum is ok
   0.242891get_answer: block_number = 1
   0.243072Communications with UPS lost: get_answer: not the right sequence 
received 0!!!

Well, that's odd.

I'm not an expert on this driver, but a quick read of that portion of the code 
implies that this shouldn't happen.

The last line says the received sequence number is 0. I think the sequence 
number is the 4th byte (my_buf[3]), which is 1 in the hex dump you posted:

http://trac.networkupstools.org/projects/nut/browser/trunk/drivers/bcmxcp_usb.c#L236

I was going to take a look at the source package to see if any extra patches 
were included, but it looks like there's a newer version of Debian for the 
Raspberry Pi (based on wheezy instead of squeeze), and it includes a newer 
build of NUT.

It doesn't look like much has changed in the NUT source tree between 2.4.3 and 
2.6.4, but there's a significant chance that Debian wheezy was built with a 
newer compiler. Can you give that a try? If not, I'd recommend rebuilding NUT 
from source, so that we can patch in a few more debug statements.

Ah, thanks!  I've installed nut from wheezy:
$ dpkg -l nut*
+++-=-=-==
ii  nut   2.6.4-1   network UPS 
tools - metapackage
ii  nut-cgi   2.4.3-1.1squeeze1 network UPS 
tools - web interface
ii  nut-client2.6.4-1   network UPS 
tools - clients
ii  nut-server2.6.4-1   network UPS 
tools - core system


But when calling the driver to communicate with the UPS, the result is 
the same.  What is the next step for debugging this driver?


Thanks,
Greg

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser