Citeren vk <v...@union-metall.ru>:

gate# /usr/local/libexec/nut/blazer_usb -DDDD -a IPPON
Network UPS Tools - Megatec/Q1 protocol USB driver 0.03 (2.4.1)
debug level is '4'
Checking device (0665/5161) (/dev/usb1//dev/ugen0)
- VendorID: 0665
- ProductID: 5161
- Manufacturer: Cypress Semiconductor
- Product: USB to Serial
- Serial Number: unknown
- Bus: /dev/usb1
Trying to match device
Device matches
Trying megatec protocol...
send: Q1
read: timeout
blazer_status: short reply
Status read 1 failed
send: Q1
read: timeout
blazer_status: short reply
Status read 2 failed
send: Q1
read: timeout
blazer_status: short reply
Status read 3 failed
Trying mustek protocol...
send: QS
read: timeout
blazer_status: short reply
Status read 1 failed
send: QS
read: timeout
blazer_status: short reply
Status read 2 failed
send: error sending control message: Input/output error
blazer_status: short reply
Status read 3 failed
Trying megatec/old protocol...
Checking device (0665/5161) (/dev/usb1//dev/ugen0)
- VendorID: 0665
- ProductID: 5161
- Manufacturer: Cypress Semiconductor
- Product: USB to Serial
- Serial Number: unknown
- Bus: /dev/usb1
Trying to match device
Device matches
send: D
read: timeout
blazer_status: short reply
Status read 1 failed
send: D
read: timeout
blazer_status: short reply
Status read 2 failed
send: D
read: timeout
blazer_status: short reply
Status read 3 failed
No supported UPS detected

Support for libusb is 'experimental' at best in FreeBSD and depending on the version you're using, 'unusable'. You may try if adding a small delay between sending a command and reading back the reply helps (YMMV):

--- trunk/drivers/blazer_usb.c  (revision 1861)
+++ trunk/drivers/blazer_usb.c  (working copy)
@@ -72,6 +72,7 @@
        upsdebugx(3, "send: %.*s", (int)strcspn(tmp, "\r"), tmp);

        memset(buf, 0, buflen);
+       usleep(300000);

        for (i = 0; (i <= buflen-8) && (strchr(buf, '\r') == NULL); i += ret) {

If your UPS also has a serial port available, it is probably more reliable to use a USB to serial converter (that is supported by the kernel) than attempting to run a user space program that attempts to handle USB through libusb.

Best regards, Arjen
--
Please keep list traffic on the list



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

Reply via email to