[Nut-upsdev] Re: [Nut-upsuser] Ablerex 625L USB version
Alexander I. Gordeev
lasaine at lvk.cs.msu.su
Thu Feb 1 00:16:08 CET 2007
On Wed, 31 Jan 2007 09:37:22 +0300, Peter Selinger <selinger at mathstat.dal.ca> wrote:
> I think at this time it is best if you experiment yourself. I don't
> have any megatec-over-USB device, and I only have the vaguest idea of
> this protocol. Essentially, all I know is that it gets the data in a
> similar way to the get_descriptor program that you hacked. Which
> individual requests may succeed or fail, or why, is beyond my
> knowledge. I am hoping that some of the people who are hacking this
> protocol (you, Andrey, Alex) will turn into developers and that one
> day we will have a fairly robust driver that is able to handle this
> class of devices (and compensate for their various idiosyncracies).
>
> -- Peter
Thank you. I'd like to contribute.
Soon I'll have time to continue. This weekend, I think.
I've had some problems last time:
1. If I start the driver first time, it works mostly ok.
But if I stop it and start again it only returns errors, like this:
admin at router:/tmp/harddisk/share/pub/system/development/nut-svn/drivers> ./megatec_usb -DDD -u admin auto
Network UPS Tools 2.1.0 - Megatec protocol driver 1.5 [megatec_usb]
Carlos Rodrigues (c) 2003-2007
debug level is '3'
Checking device (0000/0000) (003/001)
- VendorID: 0000
- ProductID: 0000
- Manufacturer: Linux 2.4.20 ehci_hcd
- Product: PCI device 1106:3104
- Serial Number: 01:03.2
- Bus: 003
Trying to match device
Device does not match - skipping
Checking device (04FC/0C15) (003/002)
- VendorID: 04fc
- ProductID: 0c15
- Manufacturer: Sunplus Technology Inc.
- Product: USB to Serial-ATA bridge
- Serial Number: SAMSUNG SPS09QJ1NL805434
- Bus: 003
Trying to match device
Device does not match - skipping
Checking device (0000/0000) (002/001)
- VendorID: 0000
- ProductID: 0000
- Manufacturer: unknown
- Product: USB UHCI Root Hub
- Serial Number: 120
- Bus: 002
Trying to match device
Device does not match - skipping
Checking device (0000/0000) (001/001)
- VendorID: 0000
- ProductID: 0000
- Manufacturer: unknown
- Product: USB UHCI Root Hub
- Serial Number: 100
- Bus: 001
Trying to match device
Device does not match - skipping
Checking device (0001/0000) (001/002)
- VendorID: 0001
- ProductID: 0000
- Manufacturer: unknown
- Product: unknown
- Serial Number: unknown
- Bus: 001
Trying to match device
Device matches
HID descriptor, method 1: (9 bytes) => 09 21 00 01 00 01 22 70 02
HID descriptor, method 2: (9 bytes) => 09 21 00 01 00 01 22 70 02
HID descriptor retrieved (Reportlen = 624)
Report descriptor retrieved (Reportlen = 624)
Found HID device
Starting UPS detection process...
Attempting to detect the UPS...
Sending "Q1" command...
"Q1" command successful.
Attempting to detect the UPS...
Sending "Q1" command...
"Q1" command successful.
Attempting to detect the UPS...
Sending "Q1" command...
"Q1" command successful.
Attempting to detect the UPS...
Sending "Q1" command...
"Q1" command successful.
Attempting to detect the UPS...
Sending "Q1" command...
"Q1" command successful.
0 out of 5 detection attempts failed (minimum failures: 2).
Asking for UPS information ("I" command)...
UPS information: KRAULER UP-M500VA VER3.00
Megatec protocol UPS detected [KRAULER UP-M500VA VER3.00].
Asking for UPS power ratings ("F" command)...
UPS power ratings: 225.0 004 11.50 50.0
Asking for UPS status ("Q1" command)...
UPS status: 229.0 165.0 229.0 000 50.2 13.6 00.0 00001000
Unsupported battery voltage (11.5V).
This UPS has an unsupported combination of battery voltage/number of batteries.
Done setting up the UPS.
Asking for UPS status ("Q1" command)...
UPS status: 226.0 165.0 226.0 000 50.0 13.6 00.0 00001000
dstate_init: sock /tmp/harddisk/share/pub/system/development/newbuild3/var/state/ups/megatec_usb-auto open on fd 5
Asking for UPS status ("Q1" command)...
UPS status: 229.0 165.0 229.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 226.0 165.0 226.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 226.0 165.0 226.0 000 50.2 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 226.0 165.0 226.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 229.0 165.0 229.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 226.0 165.0 226.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 229.0 165.0 229.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 223.0 165.0 223.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 231.0 165.0 231.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 229.0 165.0 229.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 8229.0 165.0 229.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS doesn't return any information about its status.
Asking for UPS status ("Q1" command)...
UPS status: 231.0 165.0 231.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 226.0 165.0 226.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 229.0 165.0 229.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 226.0 165.0 226.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 226.0 165.0 226.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 226.0 165.0 226.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS doesn't return any information about its status.
Asking for UPS status ("Q1" command)...
UPS status: 8226.0 165.0 226.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 229.0 165.0 229.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 229.0 165.0 229.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS doesn't return any information about its status.
Asking for UPS status ("Q1" command)...
UPS status: 229.0 165.0 229.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS status: 229.0 165.0 229.0 000 50.0 13.6 00.0 00001000
Asking for UPS status ("Q1" command)...
UPS doesn't return any information about its status.
Asking for UPS status ("Q1" command)...
UPS status: 226.0 165.0 226.0 000 49.8 13.6 00.0 00001000
Signal 2: exiting
admin at router:/tmp/harddisk/share/pub/system/development/nut-svn/drivers> ./megatec_usb -DDD -u admin auto
Network UPS Tools 2.1.0 - Megatec protocol driver 1.5 [megatec_usb]
Carlos Rodrigues (c) 2003-2007
debug level is '3'
Checking device (0000/0000) (003/001)
- VendorID: 0000
- ProductID: 0000
- Manufacturer: Linux 2.4.20 ehci_hcd
- Product: PCI device 1106:3104
- Serial Number: 01:03.2
- Bus: 003
Trying to match device
Device does not match - skipping
Checking device (04FC/0C15) (003/002)
- VendorID: 04fc
- ProductID: 0c15
- Manufacturer: Sunplus Technology Inc.
- Product: USB to Serial-ATA bridge
- Serial Number: SAMSUNG SPS09QJ1NL805434
- Bus: 003
Trying to match device
Device does not match - skipping
Checking device (0000/0000) (002/001)
- VendorID: 0000
- ProductID: 0000
- Manufacturer: unknown
- Product: USB UHCI Root Hub
- Serial Number: 120
- Bus: 002
Trying to match device
Device does not match - skipping
Checking device (0000/0000) (001/001)
- VendorID: 0000
- ProductID: 0000
- Manufacturer: unknown
- Product: USB UHCI Root Hub
- Serial Number: 100
- Bus: 001
Trying to match device
Device does not match - skipping
Checking device (0001/0000) (001/002)
- VendorID: 0001
- ProductID: 0000
- Manufacturer: unknown
- Product: unknown
- Serial Number: unknown
- Bus: 001
Trying to match device
Device matches
HID descriptor, method 1: (9 bytes) => 09 21 00 01 00 01 22 70 02
HID descriptor, method 2: (9 bytes) => 09 21 00 01 00 01 22 70 02
HID descriptor retrieved (Reportlen = 624)
Unable to get Report descriptor (-88): Invalid or incomplete multibyte or wide character
No appropriate HID device found
2. As you see in the output 2 other prolems exist:
Asking for UPS status ("Q1" command)...
UPS status: 229.0 165.0 229.0 000 50.2 13.6 00.0 00001000
Unsupported battery voltage (11.5V).
This UPS has an unsupported combination of battery voltage/number of batteries.
Is this ok?
and
Asking for UPS status ("Q1" command)...
UPS doesn't return any information about its status.
This means UPS sent "UPS NO ACK". If I have upsd running it would print
that "data is stale". I think, although this situation is quite
normal for my UPS, it's not the normal behaviour for a driver, am I right?
There are 2 ways, I guess: to repeat the previous successful response
and to ask UPS once more without a delay. Which is prefered?
--
Alexander
More information about the Nut-upsdev
mailing list