<div dir="ltr">I came up it was configuration descriptor (not string descriptor) which is a bit different... by the way I'm not sure it explains the dimension mismatch.<div><br></div><div style>On the other side, string langid descriptor (line 0052) seems to be empty, is that possible?</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/1/13 Rob Power <span dir="ltr"><<a href="mailto:robpwr@gmail.com" target="_blank">robpwr@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Just another extra consideration, while trying to decypher the sniffed data:<div>looking here (<a href="http://www.beyondlogic.org/usbnutshell/usb5.shtml#StringDescriptors" target="_blank">http://www.beyondlogic.org/usbnutshell/usb5.shtml#StringDescriptors</a>) seems that usb descriptors starts with a byte expressing the length of the descriptor itself.</div>


<div>Trying to look at what I think is descriptor 0 (ex. capture line 43, "Get Descriptor (Cfg ind:0)" the content is:</div><div><br></div>09 02 22 00 01 01 00 A0 32 09 04 00 00 01 03 00 <br>00 00 09 21 00 01 00 01 22 70 02 07 05 81 03 08<br>


<div>00 0A</div><div><br></div><div>Starting with "09" while length is 33 if I'm not wrong... do I missed something?</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">

2013/1/13 Rob Power <span dir="ltr"><<a href="mailto:robpwr@gmail.com" target="_blank">robpwr@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi guys!<div>I finally had time to make those small checks: you were right Chris, the error comes from where you supposed: there's a usb protocol error when krauler_command tries to read usb strings.</div>



<div>I changed the code as follow to have some debug:</div><div><div><br></div><div><font size="1">line 252:</font></div><div><span style="font-size:x-small">                        if (langid_fix != -1) {</span><br>
</div><div><font size="1">                                /* Apply langid_fix value */</font></div><div><font size="1"><b>                                upsdebugx(3,"blazer_usb.c, line 254: about to launch usb_get_string (langid: %#x)",langid_fix);</b></font></div>



<div><font size="1">                                ret = usb_get_string(udev, command[i].index, langid_fix, buf, buflen);</font></div><div><font size="1">                        }</font></div><div><font size="1">                        else {</font></div>



<div><font size="1"><b>                                upsdebugx(3,"blazer_usb.c, line 257: about to launch usb_get_string (no langid fix)");</b></font></div><div><font size="1">                                ret = usb_get_string_simple(udev, command[i].index, buf, buflen);</font></div>



<div><font size="1">                        }</font></div><div><font size="1"><br></font></div><div><font size="1">                        if (ret <= 0) {</font></div><div><font size="1"><b>                                upsdebugx(3,"blazer_usb.c, line 260: ret <=0 error, ret: %d", ret);</b></font></div>



<div><font size="1">                                upsdebugx(3, "read: %s", ret ? usb_strerror() : "timeout");</font></div><div><font size="1">                                return ret;</font></div>


<div>
<font size="1">                        }</font></div><div><br></div><div>and I got the following output (complete log is attached, though it's there aren't other changes):</div><div><div><font size="1">   0.197176     Trying megatec protocol...</font></div>



<div><font size="1">   0.197284     send: Q1</font></div><div><font size="1">   0.197326     blazer_usb.c, line 254: about to launch usb_get_string (langid: 0x409)</font></div><div><font size="1">   0.201535     blazer_usb.c, line 260: ret <=0 error, ret: -71</font></div>



<div><font size="1">   0.201780     read: error sending control message: Protocol error</font></div><div><font size="1">   0.201903     blazer_status: short reply</font></div><div><font size="1">   0.201946     Status read 1 failed</font></div>



<div><font size="1">   0.201988     send: Q1</font></div><div><font size="1">   0.202126     blazer_usb.c, line 254: about to launch usb_get_string (langid: 0x409)</font></div><div><font size="1">   0.205532     blazer_usb.c, line 260: ret <=0 error, ret: -71</font></div>



<div><font size="1">   0.205769     read: error sending control message: Protocol error</font></div><div><font size="1">   0.205815     blazer_status: short reply</font></div><div><font size="1">   0.205938     Status read 2 failed</font></div>



<div><font size="1">   0.205982     send: Q1</font></div><div><font size="1">   0.206041     blazer_usb.c, line 254: about to launch usb_get_string (langid: 0x409)</font></div><div><font size="1">   0.209529     blazer_usb.c, line 260: ret <=0 error, ret: -71</font></div>



<div><font size="1">   0.209763     read: error sending control message: Protocol error</font></div><div><font size="1">   0.209809     blazer_status: short reply</font></div><div><font size="1">   0.209932     Status read 3 failed</font></div>



<div><font size="1"><br></font></div><div>The same happens while trying mustek protocol, and similar output came without specifing any langid_fix (ret value = 71, too).</div><div>So it's confirme: usb_get_string (and usb_get_string_simple), invoked by blazer_status in blazer.c, both ends with -71 return code, giving the "read: error sending control message: Protocol error" message..</div>



<div>After that, blazer_status returns the "blazer_status: short reply" error.</div><div><br></div><div>I tried to search for more specific info on -71 error code, but found no hints on the Internet; I just think it comes from here (<a href="http://www.libusb.org/browser/libusb/libusb/libusb.h#L1361" target="_blank">http://www.libusb.org/browser/libusb/libusb/libusb.h#L1361</a>) and it's an error code, but I can't understand what "71" value stands for  or where it comes from exactly.</div>



<div><br></div><div>Flavio, thanks a lot for the sniffing! I'm having a look right now, trying to understand something about the first data exchanges; I hope Chris (or someone else, too) could find out something more.</div>



</div></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/1/11 flavio <span dir="ltr"><<a href="mailto:gigafrav@gmail.com" target="_blank">gigafrav@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sorry for the late but I had some trouble finding and installing UPSilon software :) Now I managed to capture all the usb traffic. I started USBlyzer before starting the installation of software and stopped after a complete tour of the program.<br>




<br>I shared the ULZ and HTML file on google-docs :<br><br><a href="https://docs.google.com/file/d/0B-R2BvGl0W6DOWs4c3F5VndwMjg/edit" target="_blank">https://docs.google.com/file/d/0B-R2BvGl0W6DOWs4c3F5VndwMjg/edit</a><br>



<br><a href="https://docs.google.com/file/d/0B-R2BvGl0W6DSzNyNG9kdTVUdDg/edit" target="_blank">https://docs.google.com/file/d/0B-R2BvGl0W6DSzNyNG9kdTVUdDg/edit</a><br>
<br>Tell me if ther'is allo information you need, and not esitate to ask more sniffing ;) <br><div><div><br><div class="gmail_quote">2013/1/11 Charles Lepple <span dir="ltr"><<a href="mailto:clepple@gmail.com" target="_blank">clepple@gmail.com</a>></span><br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Jan 10, 2013, at 10:05 PM, Rob Power wrote:<br>
<br>
> (Small parenthesis: the information command response should start with # while it starts with P#; not relevant now but weird).<br>
<br>
</div>The "P" is really a length byte of 0x50 (but the device is returning far less than 80 bytes for that transfer).<br>
<span><font color="#888888"><br>
--<br>
Charles Lepple<br>
clepple@gmail<br>
<br>
<br>
<br>
</font></span></blockquote></div><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>