<html>
<body>
<font size=3>Alexamder,<br>
Here is a level 4 dump of the output I currently get. This
shows that apart from the first call which is to the comm_usb_recv
without calling the comm_usb_send first, most of it is working. The
functions I have not implemented end up doing what the original code did,
ie set_report, get_interrupt.<br><br>
Jon<br><br>
<br>
debug level is '4'<br>
comm_usb_open<br>
Checking device (0000/0000) (002/001)<br>
- VendorID: 0000<br>
- ProductID: 0000<br>
- Manufacturer: unknown<br>
- Product: unknown<br>
- Serial Number: unknown<br>
- Bus: 002<br>
Trying to match device<br>
comm_usb_match<br>
Device does not match - skipping<br>
Checking device (FFFF/0000) (001/002)<br>
- VendorID: ffff<br>
- ProductID: 0000<br>
- Manufacturer: UIS Ablerex<br>
- Product: Ablerex USB Interface 049e<br>
- Serial Number: unknown<br>
- Bus: 001<br>
Trying to match device<br>
comm_usb_match<br>
Device matches<br>
HID descriptor, method 1: (9 bytes) => 09 21 00 01 00 01 22 78 02<br>
i=0, extra[i]=09, extra[i+1]=21<br>
HID descriptor, method 2: (9 bytes) => 09 21 00 01 00 01 22 78 02<br>
HID descriptor retrieved (Reportlen = 632)<br>
Report descriptor retrieved (Reportlen = 632)<br>
Found HID device<br>
Network UPS Tools - Megatec protocol driver 1.5[usb] (2.1.0)<br>
Carlos Rodrigues
<img src="http://messenger.msn.com/MMM2004-08-11_11.52/Resource/emoticons/coffee.gif" width=19 height=19 alt="Coffee cup"> 2003-2007<br><br>
comm_usb_open: Flush buffers<br>
comm_usb_recv: Starting<br>
get_data_ablerex: Starting<br>
in libusb_get_interrupt, bufsize: 47<br>
libsub_get_interrupt: rc: -2<br>
get_data_ablerex: len: -2, error: 2, No such file or directory: buf:
<br>
get_data_ablerex: Leaving get_data_ablerex: len: 0<br>
comm_usb_recv: len: 0<br>
Starting UPS detection process...<br>
Attempting to detect the UPS...<br>
check_ups: Sending "Q1" command...<br>
comm_usb_send: Starting<br>
comm_usb_send: About to return<br>
set_data_ablerex: Starting<br>
set_data_ablerex: Doing Q1 stuff<br>
set_data_ablerex: rc: 46, report_buf: (248.0 140.0 248.0 011 50.0 27.0
25.0 00001000<br>
check_ups: getting receive stuff, ignchars: (#, ret: 46<br>
comm_usb_recv: Starting<br>
get_data_ablerex: Starting<br>
comm_usb_recv: len: 46<br>
got receive stuff: rc = 45, buffer: 248.0 140.0 248.0 011 50.0 27.0 25.0
00001000<br>
"Q1" command successful.<br>
Attempting to detect the UPS...<br>
check_ups: Sending "Q1" command...<br>
comm_usb_send: Starting<br>
comm_usb_send: About to return<br>
set_data_ablerex: Starting<br>
set_data_ablerex: Doing Q1 stuff<br>
set_data_ablerex: rc: 46, report_buf: (248.0 140.0 248.0 012 50.0 27.0
25.0 00001000<br>
check_ups: getting receive stuff, ignchars: (#, ret: 46<br>
comm_usb_recv: Starting<br>
get_data_ablerex: Starting<br>
comm_usb_recv: len: 46<br>
got receive stuff: rc = 45, buffer: 248.0 140.0 248.0 012 50.0 27.0 25.0
00001000<br>
"Q1" command successful.<br>
Attempting to detect the UPS...<br>
check_ups: Sending "Q1" command...<br>
comm_usb_send: Starting<br>
comm_usb_send: About to return<br>
set_data_ablerex: Starting<br>
set_data_ablerex: Doing Q1 stuff<br>
set_data_ablerex: rc: 46, report_buf: (248.0 140.0 248.0 012 50.0 27.0
25.0 00001000<br>
check_ups: getting receive stuff, ignchars: (#, ret: 46<br>
comm_usb_recv: Starting<br>
get_data_ablerex: Starting<br>
comm_usb_recv: len: 46<br>
got receive stuff: rc = 45, buffer: 248.0 140.0 248.0 012 50.0 27.0 25.0
00001000<br>
"Q1" command successful.<br>
Attempting to detect the UPS...<br>
check_ups: Sending "Q1" command...<br>
comm_usb_send: Starting<br>
comm_usb_send: About to return<br>
set_data_ablerex: Starting<br>
set_data_ablerex: Doing Q1 stuff<br>
set_data_ablerex: rc: 46, report_buf: (248.0 140.0 248.0 012 50.0 27.0
25.0 00001000<br>
check_ups: getting receive stuff, ignchars: (#, ret: 46<br>
comm_usb_recv: Starting<br>
get_data_ablerex: Starting<br>
comm_usb_recv: len: 46<br>
got receive stuff: rc = 45, buffer: 248.0 140.0 248.0 012 50.0 27.0 25.0
00001000<br>
"Q1" command successful.<br>
Attempting to detect the UPS...<br>
check_ups: Sending "Q1" command...<br>
comm_usb_send: Starting<br>
comm_usb_send: About to return<br>
set_data_ablerex: Starting<br>
set_data_ablerex: Doing Q1 stuff<br>
set_data_ablerex: rc: 46, report_buf: (248.0 140.0 248.0 012 50.0 27.0
25.0 00001000<br>
check_ups: getting receive stuff, ignchars: (#, ret: 46<br>
comm_usb_recv: Starting<br>
get_data_ablerex: Starting<br>
comm_usb_recv: len: 46<br>
got receive stuff: rc = 45, buffer: 248.0 140.0 248.0 012 50.0 27.0 25.0
00001000<br>
"Q1" command successful.<br>
0 out of 5 detection attempts failed (minimum failures: 2).<br>
Asking for UPS information ("I" command)...<br>
comm_usb_send: Starting<br>
comm_usb_send: About to return<br>
set_data_ablerex: Starting<br>
set_data_ablerex: Doing I stuff<br>
set_data_ablerex: rc: 37, report_buf: UIS AblerexAblerex USB Interface
049e<br>
get_ups_info: getting receive stuff, ignchars: (#<br>
comm_usb_recv: Starting<br>
get_data_ablerex: Starting<br>
comm_usb_recv: len: 37<br>
UPS information: UIS AblerexAblerex USB Interface 049e<br>
Megatec protocol UPS detected [UIS AblerexAble ex USB Int rface
049e].<br>
Asking for UPS power ratings ("F" command)...<br>
comm_usb_send: Starting<br>
comm_usb_send: About to return<br>
set_data_ablerex: Starting<br>
set_data_ablerex: Doing F stuff<br>
set_data_ablerex: rc: 22, report_buf: #240.0 0.0 024.0 50.0<br>
get_firmware_values: getting receive stuff, ignchars: (#<br>
comm_usb_recv: Starting<br>
get_data_ablerex: Starting<br>
comm_usb_recv: len: 22<br>
UPS power ratings: 240.0 0.0 024.0 50.0<br>
Asking for UPS status ("Q1" command)...<br>
comm_usb_send: Starting<br>
comm_usb_send: About to return<br>
set_data_ablerex: Starting<br>
set_data_ablerex: Doing Q1 stuff<br>
set_data_ablerex: rc: 46, report_buf: (248.0 140.0 248.0 012 50.0 27.0
25.0 00001000<br>
run_query: getting receive stuff, ignchars: (#<br>
comm_usb_recv: Starting<br>
get_data_ablerex: Starting<br>
comm_usb_recv: len: 46<br>
UPS status: 248.0 140.0 248.0 012 50.0 27.0 25.0 00001000<br>
24.0V battery, interval [19.4V, 27.4V].<br>
comm_usb_send: Starting<br>
comm_usb_send: About to return<br>
set_data_ablerex: Starting<br>
set_data_ablerex: Doing C stuff<br>
set_data_ablerex: rc: 10, report_buf: UPS No Ack<br>
Done setting up the UPS.<br>
Asking for UPS status ("Q1" command)...<br>
comm_usb_send: Starting<br>
comm_usb_send: About to return<br>
set_data_ablerex: Starting<br>
set_data_ablerex: Doing Q1 stuff<br>
set_data_ablerex: rc: 46, report_buf: (248.0 140.0 248.0 012 50.0 27.0
25.0 00001000<br>
run_query: getting receive stuff, ignchars: (#<br>
comm_usb_recv: Starting<br>
get_data_ablerex: Starting<br>
comm_usb_recv: len: 46<br>
UPS status: 248.0 140.0 248.0 012 50.0 27.0 25.0 00001000<br>
Charge: 95.0%<br>
dstate_init: sock /var/state/ups/eclipse open on fd 5<br>
Asking for UPS status ("Q1" command)...<br>
comm_usb_send: Starting<br>
comm_usb_send: About to return<br>
set_data_ablerex: Starting<br>
set_data_ablerex: Doing Q1 stuff<br>
set_data_ablerex: rc: 46, report_buf: (248.0 140.0 248.0 012 50.0 27.0
25.0 00001000<br>
run_query: getting receive stuff, ignchars: (#<br>
comm_usb_recv: Starting<br>
get_data_ablerex: Starting<br>
comm_usb_recv: len: 46<br>
UPS status: 248.0 140.0 248.0 012 50.0 27.0 25.0 00001000<br>
Charge: 95.0%<br>
Signal 2: exiting<br>
comm_usb_close<br><br>
<br><br>
At 11:48 1/02/2007, Alexander I. Gordeev wrote:<br>
<blockquote type=cite class=cite cite="">On Thu, 01 Feb 2007 03:26
<img src="http://messenger.msn.com/MMM2004-08-11_11.52/Resource/emoticons/omg_smile.gif" width=19 height=19 alt="Smiley says O">9
+0300, Jon Gough <jon.gough@eclipsesystems.com.au> wrote:<br><br>
> Alexander,<br>
> I have tried your technique on my system and
I am now getting<br>
> partial success. I can issue the Q1 and F commands and get the<br>
> required response back. The I command gives me stuff, but it is
too<br>
> short, so I am not sure what I should have here.<br>
><br><br>
Could you, please, post your full output? It'd very interesting for<br>
me.<br>
The "I" request corresponds to the sctring descriptor #12 of my
own<br>
UPS. So the driver returns this descriptor.<br>
Your descriptor #12 seems to be incomplete. As I understood from<br>
one of your previous posts full information is spread.<br><br>
> Now. Do you know how to issue commands to
get the UPS to do<br>
> something, ie battery test ?<br>
><br><br>
Yes, I know. I dumped USB communication between UPS and the Windows<br>
driver. This dump is still not full. I only know that when you<br>
press "Test" button WIndows program retrieves string descriptor
#4.<br>
It gets "UPS NO ACK" but there is also a side effect - UPS
starts<br>
self-test.<br>
Other commands are performed in a similar way.<br>
I'll get the full dump soon.<br><br>
This feature is not yet implemented. Only informational requests<br>
work.<br><br>
-- <br>
Alexander</font></blockquote>
<BR><BR>
<TABLE width=400><HR>
<P style="FONT: 9pt/11pt verdana"><a href="http://www.avast.com">avast! Antivirus</a>: Outbound message clean.
<P style="FONT: 8pt/11pt verdana">Virus Database (VPS): 000709-1, 31/01/2007<BR>Tested on: 1/02/2007 2:03:27 PM<BR><FONT color=gray>avast! is copyright (c) 2000-2007 ALWIL Software.</FONT></P>
<TBODY></TBODY></TABLE>
<BR>
</body>
<br>
</html>