Hello to all list members, I'm trying to make my UPS work with nut-2.2.2 (using Debian Testing, but compiled from source code) for a week ago, with not success. It's a Unitek Alpha 1000Ps, and I supossed it would work with megatec_usb driver, as other Unitek models. It has an USB interface, and when I plug it into my system I've got this message: chopito:/home/jordi# dmesg | tail -n4 input: WayTech Development(S) WayTech USB-RS232 Interface (V1.0) Baud rate 2400bps as /class/input/input4 input: USB HID v1.00 Gamepad [WayTech Development(S) WayTech USB-RS232 Interface (V1.0) Baud rate 2400bps] on usb-0000:00:1d.1-2 So, apparently, it has an USB-HID interface. Output from lsusb: chopito:/home/jordi# lsusb Bus 005 Device 001: ID 0000:0000 Bus 002 Device 004: ID 0665:5161 Bus 002 Device 001: ID 0000:0000 Bus 004 Device 001: ID 0000:0000 Bus 003 Device 001: ID 0000:0000 Bus 001 Device 001: ID 0000:0000 chopito:/home/jordi# lsusb -vvv -d 0665:5161 Bus 002 Device 004: ID 0665:5161 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x0665 idProduct 0x5161 bcdDevice 0.01 iManufacturer 1 WayTech Development(S) iProduct 2 WayTech USB-RS232 Interface (V1.0) Baud rate 2400bps iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 34 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 3 bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Devices bInterfaceSubClass 0 No Subclass bInterfaceProtocol 0 None iInterface 4 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.00 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 35 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0008 1x 8 bytes bInterval 10 Device Status: 0x0000 (Bus Powered) When I try to make it work with megatec_usb, I get the following output: chopito:/usr/local/ups# bin/megatec_usb -DDDDD -a unitek -u root -x vendorid=0665 -x productid=5161 Network UPS Tools 2.2.2 - Megatec protocol driver 1.5.14 [megatec_usb] Carlos Rodrigues (c) 2003-2008 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 '5' Checking device (0000/0000) (005/001) - VendorID: 0000 - ProductID: 0000 - Manufacturer: Linux 2.6.22-2-686 ehci_hcd - Product: EHCI Host Controller - Serial Number: 0000:00:1d.7 - Bus: 005 Trying to match device Device does not match - skipping Checking device (0665/5161) (002/005) - VendorID: 0665 - ProductID: 5161 - Manufacturer: WayTech Development(S) - Product: WayTech USB-RS232 Interface (V1.0) Baud rate 2400bps - Serial Number: unknown - Bus: 002 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) => get_data_agiler: raw dump: (8 bytes) => 30 30 31 30 30 30 0d 00 Q1 => FAILED [short read] Q1 detail: (6 bytes) => 30 30 31 30 30 30 Asking for UPS status [Q1]... get_data_agiler: raw dump: (0 bytes) => get_data_agiler: raw dump: (8 bytes) => 30 30 31 30 30 30 0d 00 Q1 => FAILED [short read] Q1 detail: (6 bytes) => 30 30 31 30 30 30 Asking for UPS status [Q1]... get_data_agiler: raw dump: (0 bytes) => get_data_agiler: raw dump: (8 bytes) => 30 30 31 30 30 30 0d 00 Q1 => FAILED [short read] Q1 detail: (6 bytes) => 30 30 31 30 30 30 Asking for UPS status [Q1]... get_data_agiler: raw dump: (0 bytes) => get_data_agiler: raw dump: (8 bytes) => 30 30 31 30 30 30 0d 00 Q1 => FAILED [short read] Q1 detail: (6 bytes) => 30 30 31 30 30 30 Asking for UPS status [Q1]... get_data_agiler: raw dump: (0 bytes) => get_data_agiler: raw dump: (8 bytes) => 30 30 31 30 30 30 0d 00 Q1 => FAILED [short read] Q1 detail: (6 bytes) => 30 30 31 30 30 30 5 out of 5 detection attempts failed (minimum failures: 2). Megatec protocol UPS not detected. Trying with usbhid-ups: chopito:/usr/local/ups# bin/usbhid-ups -DDDDD -a unitek -u root -x vendorid=0665 -x productid=5161 -x explore Network UPS Tools: 0.29 USB communication driver - core 0.33 (2.2.2) ... Checking device (0665/5161) (002/005) - VendorID: 0665 - ProductID: 5161 - Manufacturer: WayTech Development(S) - Product: WayTech USB-RS232 Interface (V1.0) Baud rate 2400bps - Serial Number: unknown - Bus: 002 Trying to match device Device matches HID descriptor, method 1: (9 bytes) => 09 21 00 01 00 01 22 23 00 i=0, extra[i]=09, extra[i+1]=21 HID descriptor, method 2: (9 bytes) => 09 21 00 01 00 01 22 23 00 HID descriptor length 35 Report Descriptor size = 35 Report Descriptor: (35 bytes) => 05 01 09 05 a1 01 05 09 19 01 29 40 15 00 25 01 75 01 95 40 81 02 05 08 19 01 29 40 75 01 95 40 91 02 c0 Failed to parse report descriptor!: Inappropriate ioctl for device Caller doesn't like this device ... So, can I try a different driver? Could be this UPS supported by NUT? I can give strace information too, but I don't want to make my mail longer! Sorry, but I'm a bit desperate... I have searched the web and didn't found any information about this UPS. Thanks in advance for any help...
Citeren Jordi Moreno <jmoreno at cim.es>:> Asking for UPS status [Q1]... > get_data_agiler: raw dump: (0 bytes) => > get_data_agiler: raw dump: (8 bytes) => 30 30 31 30 30 30 0d 00 > Q1 => FAILED [short read] > Q1 detail: (6 bytes) => 30 30 31 30 30 30[...]> Megatec protocol UPS not detected.This UPS isn't speaking the Megatec protocol. It doesn't look like anything familiar to me either.> Trying with usbhid-ups:It most certainly isn't a HID Power Device Class UPS, looking at the length of the report descriptor, so this won't work either. [...]> So, can I try a different driver? Could be this UPS supported by NUT? I > can give strace information too, but I don't want to make my mail > longer!Strace is a waste of effort here. We're not debugging a timing problem here, we just don't what protocol the UPS uses. If you have (bundled) software available for Windows, you might use usbsnoop to try and see if you can find out how to communicate with this device. Until then, there is nothing we can do for you.> Sorry, but I'm a bit desperate... I have searched the web and > didn't found any information about this UPS.You could also reverse this. If you really need your UPS to be supported in NUT, buy something that is listed as 'supported' instead. If you're looking to quickly resolve this, this might be the best advice we can give you. Currently, you're lacking both the protocol information and a driver to use it. Getting this supported may take a while. Best regards, Arjen -- Please keep list traffic on the list
Citeren Jordi Moreno <jmoreno at cim.es>:> Couldn't test SVN version. After downloading, autoreconf --install gives > me the following output: > > # autoreconf --install > aclocal: macro `NUT_OS_FUNCTIONS' required but not defined > aclocal: configure.in: 65: macro `AM_PROG_CC_C_O' not found in library > autoreconf: aclocal failed with exit status: 1You probably don't have all the autoconf tools needed installed. I don't know how to fix this though.> Maybe I'm missing something... However, I've tried last testing version > (2.4.0-pre2), because it seems to include the same version of > blazer_usb.c, blazer.c and blazer.h (checked with diff).Indeed. That's a good alternative to running the SVN version, although it is a bit more difficult to get to any changes that I may need to commit to this driver based on your input.> At first, it seems to detect the UPS properly: > > # bin/blazer_usb -a unitek -u root -x vendorid=0665 -x productid=5161 > > Network UPS Tools - Megatec/Q1 protocol USB driver 0.02 (2.4.0-pre2) > Supported UPS detected with megatec protocol > Vendor information read in 1 triesGood. Note that specifying vendorid and productid is useless without also specifying the subdriver that needs to be used. Since the driver already knows them, it is not needed to list these.> But if I try to send a shutdown command: > > # bin/blazer_usb -a unitek -u root -x vendorid=0665 -x productid=5161 -k > Network UPS Tools - Megatec/Q1 protocol USB driver 0.02 (2.4.0-pre2) > Initiating UPS shutdown > instcmd: command [shutdown.return] failed > instcmd: command [shutdown.return] failed > instcmd: command [shutdown.return] failedThat could be due to an unsupported ondelay and/or offdelay value. Try if different values help here. It could also be that your UPS responds with an unsupported return value. You may wish to run the driver as follows to debug this bin/blazer_usb -DDD -a unitek -x ondelay=3 -x offdelay=60 -k This will make the driver run the shutdown command only with enough debugging info to see what is happening.> And giving more debug information: > > # bin/blazer_usb -a unitek -u root -x vendorid=0665 -x productid=5161 > -DDDDD > Network UPS Tools - Megatec/Q1 protocol USB driver 0.02 (2.4.0-pre2) > debug level is '5' > ... > Checking device (0665/5161) (003/003) > - VendorID: 0665 > - ProductID: 5161 > - Manufacturer: WayTech Development(S) > - Product: WayTech USB-RS232 Interface (V1.0) > Baud rate 2400bps > - Serial Number: unknown > - Bus: 003 > Trying to match device > Device matches > Trying megatec protocol... > send: Q1 > read: (218.0 216.0 187.0 000 49.9 13.6 24.0 00001000 > send_to_all: SETINFO input.voltage "218.0" > send_to_all: SETINFO input.voltage.fault "216.0" > send_to_all: SETINFO output.voltage "187.0" > send_to_all: SETINFO ups.load "0" > send_to_all: SETINFO input.frequency "49.9" > send_to_all: SETINFO battery.voltage "13.60" > send_to_all: SETINFO ups.temperature "24.0" > send_to_all: SETINFO beeper.status "disabled" > send_to_all: SETINFO ups.type "offline / line interactive" > send_to_all: SETINFO ups.status "OL" > Status read in 1 triesLooks good.> Supported UPS detected with megatec protocol > send: F > read: #230.0 000 012.0 50.0 > send_to_all: SETINFO input.voltage.nominal "230" > send_to_all: SETINFO input.current.nominal "0.0" > send_to_all: SETINFO battery.packs "1" > send_to_all: SETINFO battery.voltage.nominal "12.0" > send_to_all: SETINFO input.frequency.nominal "50" > Ratings read in 1 triesSame here.> send: I > read: #UNITEK POWER SCU8UPEG V8.0 > send_to_all: SETINFO ups.mfg "UNITEK" > send_to_all: SETINFO ups.model "POWER" > send_to_all: SETINFO ups.firmware "SCU8UPEG" > Vendor information read in 1 triesI was already slightly worried about this. Your UPS has spaces in the manufacturer name, which is unexpected. It looks like I need to change this, to use fixed length values. [...]> And it seems to stand forever sending those Q1 commands...That's correct, that's what you get in debugging mode.> Well, it seems we've advanced somehow... at least I can read some values > from the UPS now. But I really need the shutdown command to work... > > By the way, trying to execute upsd: > > # /usr/local/ups/sbin/upsd > Network UPS Tools upsd 2.4.0-pre2 > listening on 127.0.0.1 port 3493 > Can't connect to UPS [unitek] (blazer_usb-unitek): No such file or directoryYou need to use 'upsdrvctl' to start the driver. Best regards, Arjen -- Please keep list traffic on the list