Re: [Nut-upsuser] Status OB (on battery) when polling a Liebert PSA

2011-02-11 Thread Pier Paolo Glave
 I'm ready now to go on with NUT configuration: I think I'm able now to
 have a controlled PC shutdown.
 I'll let you know how it goes.

 That's also something I would be interested in.


Hi Arjen and all,

I succeeded in having a controlled shutdown, when the UPS went in
low-battery status.
I'm happy with the result.

However, I've just realized that I had also done another change in the
drivers' source code: I changed the belkin-hid.c and liebert-hid.c
drivers, in order to select the liebert driver, instead of the belkin
one, when my vendor ID was found.
Without this change, I'm not able to correctly see the online/on
battery status (I always see on battery), even with the suggested
change in libhid.c.

In detail, my change is the following:

--- belkin-hid.c.orig   2011-02-04 11:09:00.0 +0100
+++ belkin-hid.c2011-02-04 11:12:01.0 +0100
@@ -34,7 +34,7 @@
#define BELKIN_VENDORID0x050d

/* Liebert */
-#define LIEBERT_VENDORID   0x10af
+//#define LIEBERT_VENDORID 0x10af

/* USB IDs device table */
static usb_device_id_t belkin_usb_device_table[] = {
@@ -58,7 +58,7 @@
{ USB_DEVICE(BELKIN_VENDORID, 0x1100), NULL },

/* Liebert PowerSure PSA UPS */
-   { USB_DEVICE(LIEBERT_VENDORID, 0x0001), NULL },
+   //{ USB_DEVICE(LIEBERT_VENDORID, 0x0001), NULL },

/* Terminating entry */
{ -1, -1, NULL }
@@ -449,7 +449,7 @@
}
possibly_supported(Belkin, hd);
return 0;
-
+#if 0
case LIEBERT_VENDORID:
/* by default, reject, unless the productid
option is given */
if (getval(productid)) {
@@ -457,6 +457,7 @@
}
possibly_supported(Liebert, hd);
return 0;
+#endif
}


--- liebert-hid.c.orig  2011-02-04 11:09:11.0 +0100
+++ liebert-hid.c   2011-02-04 11:10:25.0 +0100
@@ -30,12 +30,15 @@
/* FIXME: experimental flag to be put in upsdrv_info */

/* Liebert */
-#define LIEBERT_VENDORID 0x06da
+//#define LIEBERT_VENDORID 0x06da
+#define LIEBERT_VENDORID   0x10af

/* USB IDs device table */
static usb_device_id_t liebert_usb_device_table[] = {
/* various models */
-   { USB_DEVICE(LIEBERT_VENDORID, 0x), NULL },
+   //{ USB_DEVICE(LIEBERT_VENDORID, 0x), NULL },
+   /* Liebert PowerSure PSA UPS */
+   { USB_DEVICE(LIEBERT_VENDORID, 0x0001), NULL },

/* Terminating entry */
{ -1, -1, NULL }


Best regards,
Pier

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


Re: [Nut-upsuser] hardware compatibility list

2011-02-11 Thread Arjen de Korte

Citeren Ernest Sales ersa...@gmail.com:

N.B.: the blazer_usb driver recognized the device, but logs showed  
connection loss about every minute, so I didn't do further

trying.


This is a known problem in nut-2.4.3 and should be solved in  
nut-2.6.0. We have also dropped the megatec and megatec_usb drivers,  
so it is probably a good idea to check out the newer release. If that  
version doesn't work for you, let us know.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


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


Re: [Nut-upsuser] nut unable to communicate with new APC SMX100 over USB

2011-02-11 Thread Arjen de Korte

Citeren Brian Daniels bitm...@pobox.com:

upshid-ups is unable to communicate with the UPS, giving 'Protocol  
error'.  I've also tried the snapshot and 2.7 svn release with the  
same results.  Debug output is below, any ideas appreciated.


Could you try if the attached patch makes any difference? We've seen  
other reports from people having trouble communicating with their  
UPSes. It is also in the development version, so if it is more  
convenient to run that, this should be fine.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)
--- drivers/libhid.c	2011-01-15 21:03:53.149154167 +0100
+++ drivers/libhid.c	2011-02-11 10:10:02.529935413 +0100
@@ -141,7 +141,6 @@
 {
 	int	id = pData-ReportID;
 	int	r;
-	unsigned char	buf[SMALLBUF];
 
 	if (rbuf-ts[id] + age  time(NULL)) {
 		/* buffered report is still good; nothing to do */
@@ -149,17 +148,14 @@
 		return 0;
 	}
 
-	r = comm_driver-get_report(udev, id, buf, sizeof(buf));
+	r = comm_driver-get_report(udev, id, rbuf-data[id], rbuf-len[id]);
 	if (r = 0) {
 		return -1;
 	}
 
-	/* broken report descriptors are common, so store whatever we can */
-	memcpy(rbuf-data[id], buf, (r  rbuf-len[id]) ? r : rbuf-len[id]);
-
 	if (rbuf-len[id] != r) {
 		upsdebugx(2, %s: expected %d bytes, but got %d instead, __func__, rbuf-len[id], r);
-		upsdebug_hex(3, Report[err], buf, r);
+		upsdebug_hex(3, Report[err], rbuf-data[id], r);
 	} else {
 		upsdebug_hex(3, Report[get], rbuf-data[id], rbuf-len[id]);
 	}
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser