<div dir="ltr"><div><div>@Flavio: It would be great! About the software, I used usblyzer: it has 30 day full working trial on windows and you can export as html or other formats.</div><div>It should have an option (menu "Capture->Capture hot-plugged") to start sniffing when you connect a device; this may be useful to dump initial usb connection as Chris was suggesting.</div>

<div>Otherwise you may run a windows virtual machine on Linux host and use wireshark (<a href="http://webcache.googleusercontent.com/search?q=cache:wAiv8nIyAsUJ:wiki.wireshark.org/CaptureSetup/USB+&cd=1&hl=it&ct=clnk" target="_blank">http://webcache.googleusercontent.com/search?q=cache:wAiv8nIyAsUJ:wiki.wireshark.org/CaptureSetup/USB+&cd=1&hl=it&ct=clnk</a> ) from linux host to capture, but may be a bit more complicated to set up.</div>

</div><div><br></div><div style>@Chris and everyone:</div><div>I forgot to report, I'm on Ubuntu Server 12.04 LTS, i386, kernel:  3.2.0-35-generic-pae<br></div><div><br></div><div><div><font size="1">$ uname -a</font></div>


<div><font size="1">Linux server_name 3.2.0-35-generic-pae #55-Ubuntu SMP Wed Dec 5 18:04:39 UTC 2012 i686 i686 i386 GNU/Linux</font></div><div><font size="1"><br></font></div><div>Attached is debug output without langid_fix: exactly the same output.</div>


<div>I tried before and output seemed the same, to be sure I didn't missed anything I double-checked and there aren't significative changes.</div><div><br></div><div>About the code, I had almost understood part of the process (string request usage) but I was not understanding what the first 2 bytes were.</div>

<div style><br></div><div style>But I'm still trying to figure out how UPSilon2000 works:</div><div style><br></div><div style>in Q capture, ignoring string 3 (Q1) commands, we have (tell me if I'm wrong)</div><div style>

<br></div><div style><font size="1">Status: beep = 1 (capture n. 0005-0002)</font></div><div style><font size="1">Asking for string 13 --> output: <span style="color:rgb(0,0,0)">..#.2.3.0...0. .</span><span style="color:rgb(0,0,0)">0.0.2. .1.2...0.</span><span style="color:rgb(0,0,0)">0. .5.0...0... (Unknown command)</span></font></div>

<div style><font size="1"><span style="color:rgb(0,0,0)">Status: beep = 1 (capture n. </span>0013-0010)</font></div><div style><font size="1"><span style="color:rgb(0,0,0)">Asking for string 7 --> output: </span><span style="color:rgb(0,0,0)"> ..U.P.S. .N.o. .</span><span style="color:rgb(0,0,0)">A.C.K. (should be Q command)</span></font></div>

<div style><font size="1"><span style="color:rgb(0,0,0)">Asking for string 12 --> output: </span><span style="color:rgb(0,0,0)">P.#. . ..... (Unknown command)</span></font></div><div style><span style="color:rgb(0,0,0)"><font size="1">Status: beep = 0 (capture n. 0024-0023)</font></span></div>

<div style><span style="color:rgb(0,0,0)"><font size="1">...</font></span></div><div style><font size="1"><span style="color:rgb(0,0,0)">Status: beep = 0 (capture n. 0024-0023)</span><span style="color:rgb(0,0,0)"><br></span></font></div>

<div style><font size="1"><span style="color:rgb(0,0,0)">Asking for string 7 --> output: </span><span style="color:rgb(0,0,0)"> ..U.P.S. .N.o. .</span><span style="color:rgb(0,0,0)">A.C.K. (should be Q command)</span><span style="color:rgb(0,0,0)"><br>

</span></font></div><div style><span style="color:rgb(0,0,0)"><font size="1">Status: beep = 1 (capture n. 0040-0039)</font></span></div><div style><span style="color:rgb(0,0,0)"><br></span></div><div style><span style="color:rgb(0,0,0)"><br>

</span></div><div style><span style="color:rgb(0,0,0)">in TL command we have</span></div><div style><br></div><div style><div><font size="1">Status: test = 0 (capture n. 0016-0015)</font></div><div><font size="1">Asking for string 13 --> output: <span style="color:rgb(0,0,0)">..#.2.3.0...0. .</span><span style="color:rgb(0,0,0)">0.0.2. .1.2...0.</span><span style="color:rgb(0,0,0)">0. .5.0...0... (Unknown command)</span></font></div>

<div><font size="1"><span style="color:rgb(0,0,0)">Asking for string 5 --> output: </span><span style="color:rgb(0,0,0)"> ..U.P.S. .N.o. .</span><span style="color:rgb(0,0,0)">A.C.K. (should be TL command)</span></font></div>

<div><font size="1"><span style="color:rgb(0,0,0)">Status: test = 1 (capture n. 0028-0027)</span><br></font></div><div><span style="color:rgb(0,0,0)"><font size="1">....</font></span></div><div style><font size="1"><span style="color:rgb(0,0,0)">Asking for string 12 --> output: </span><span style="color:rgb(0,0,0)">P.#. . ..... (unknown command)</span></font></div>

<div style><font size="1"><span style="color:rgb(0,0,0)">Status: test = 1 (capture n. 0028-0027)</span><span style="color:rgb(0,0,0)"><br></span></font></div><div style><span style="color:rgb(0,0,0)"><font size="1">.....</font></span></div>

<div style><span style="color:rgb(0,0,0)">and in CT</span></div><div><span style="color:rgb(0,0,0)"><font size="1">...</font></span></div><div style><span style="color:rgb(0,0,0)"><font size="1">Again string 13 (with no status change)</font></span></div>

<div style><font size="1"><span style="color:rgb(0,0,0)">Asking for string 11 --> output: </span><span style="color:rgb(0,0,0)"> ..U.P.S. .N.o. .</span><span style="color:rgb(0,0,0)">A.C.K. (should be CT command)</span><span style="color:rgb(0,0,0)"><br>

</span></font></div><div style><span style="color:rgb(0,0,0)"><font size="1">Status: test = 0</font></span></div><div style><span style="color:rgb(0,0,0)"><font size="1">again string 12</font></span></div><div style><span style="color:rgb(0,0,0)"><br>

</span></div><div style><font color="#000000">So I was wondering: ups seems to answer commands (like Q, TL, CT) with "Ups No Ack" string, while our driver seems to understand as a "message not received", or am I wrong?</font></div>

<div style><font color="#000000">I still don't understand this part, maybe first</font></div><div style><font color="#000000">What are commands represented by string 12 and 13? Is it just casualty that they show up before and after the selected command strings? May the protocol work somehow like this:</font></div>

<div style><font color="#000000"><br></font></div><div style><font color="#000000" size="1">ask string 13 (Meaning: "hey, I'm sending you a manteinance command")</font></div><div style><font color="#000000" size="1">ask string <command number> (Meaning: "do this/do that")</font></div>

<div style><font color="#000000" size="1">expecting "ups no ack" response</font></div><div style><font color="#000000" size="1">ask string 12 (Meaning: "hey, have you done last thing I asked?")</font></div>

<div style><font color="#000000" size="1"><br></font></div><div style><font color="#000000" size="1"><br></font></div><div style><font color="#000000" size="1">PS: I hope I may eventually make some tries adding debug options to the code in next days (more probably next week). What values do you suggest to print out? "buf" variable for example?</font></div>

<div style><font color="#000000"><br></font></div></div><div><br></div>
<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/1/9 flavio <span dir="ltr"><<a href="mailto:gigafrav@gmail.com" target="_blank">gigafrav@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I have the same UPS at home, I can do some other sniff with a Window laptop, what software I can use to do the sniff ?<div>



<br></div><div>Flavio Astorino<br><br><div class="gmail_quote">2013/1/8 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div style="word-wrap:break-word"><div><div><div>


On Jan 7, 2013, at 8:27 PM, Rob Power wrote:</div>
<br><blockquote type="cite">

<span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div>





<div><pre>TL (0x05) or CT (0x0b) code seems not to be used in the relative sniffed file and 0x07 (Q in nut coding) seems to be related to "UPS No Ack" string).<br></pre></div></div></span></blockquote></div><div>





<span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div>





<div>If I'm reading drivers/blazer_usb.c correctly, "UPS No Ack" causes the read loop to retry (up to 10 times). This is similar to the USB-to-serial converter code in tripplite_usb.c, where it looks to make sure that the received buffer differs from what was sent the last time. But it's possible that this UPS doesn't use Q, just Q1 (string index 3, which does return a somewhat normal-looking buffer).</div>





</div><div><br></div><div><div>                { "test.battery.start.deep", "TL\r" },</div><div>                { "test.battery.start.quick", "T\r" },</div><div>                { "test.battery.stop", "CT\r" },</div>





</div><div><br></div><div>Looks like TL and CT are for battery testing.</div><div><br></div><div>I hate to nitpick about log.txt, but it appears to have the results from the original langid_fix setting (0x4095) instead of 0x409. Could you please capture and send that again? Using -DDDDD worked well. (I remember you said it didn't work, but we're looking for any small differences in the output that might narrow down where the problem lies.)</div>





<div><br></div></span></div><div><blockquote type="cite">port was setted according to lsusb output:<div><div><div>$ lsusb</div><div>[...]</div><div>Bus 002 Device 002: ID 0001:0000 Fry's Electronics</div></div>
</div><br></blockquote></div><div>Actually, for the USB drivers in NUT, the port setting is ignored (although the NUT core needs some value, so we usually use 'auto'). The matching is done by the numeric USB VID:PID combination.</div>





<br>What does 'lsusb -vvv -d 0001:0000' return?</div><span><font color="#888888"><br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div>





-- </div><div>Charles Lepple</div><div>clepple@gmail</div><div><br></div></span><br>
</div>
<br></font></span></div><br></div></div>_______________________________________________<br>
Nut-upsdev mailing list<br>
<a href="mailto:Nut-upsdev@lists.alioth.debian.org" target="_blank">Nut-upsdev@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev</a><br></blockquote></div><br>
</div>
</blockquote></div><br></div></div>