<html>
  <head>
    <meta content="text/html; charset=iso-8859-2"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Zdravím,<br>
    <br>
    nechci Vás svést na špatnou cestu, ale netváří se ta čtečka jako COM
    port? Poznámka o CP2102 by o tom svědčila. Pak bych ovšem doporučil
    pyserial místo pyusb ;-)<br>
    <br>
    Jen nápad...<br>
    <br>
    Dex<br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 17.5.2015 8:30, "Ing. Vladislav
      Ludík" wrote:<br>
    </div>
    <blockquote cite="mid:5558357A.9000101@ludik.cz" type="cite">
      <meta content="text/html; charset=iso-8859-2"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">libusb0 jsem jsem měl nahrané, ale
        asi špatné verze.<br>
        Teď jsem našel správnou verzi, libusb0 se nahrálo korektně.<br>
        <br>
        Čtečka pak zmizela ve správci zařízení z Portů (byl tam nějaký
        COM) <br>
        a objevil se samostatný symbol pro usb jako libusb-32 devices s
        podsložkou<br>
        CP2102 USB to UART Bridge Controller<br>
        <br>
        Když nyní dám usb.core.show_devices()<br>
        vrátí mi: <br>
        DEVICE ID 10c4:ea60 on Bus 000 Address 001, Specified at
        interface<br>
        <br>
        Takže idVendor=0x10C48 měl být 0x10C4<br>
        Po opravě se vše rozjelo. Zdá se, že jsem na dobré cestě.<br>
        <br>
        Děkuji za pomoc.<br>
        <br>
        Vláďa<br>
        <br>
        Dne 17.5.2015 v 2:43 Petr Messner napsal(a):<br>
      </div>
      <blockquote
cite="mid:CAK9Q5BQ9rgHH4C6xeQGMg-FkfJ+ZVoZJbN7tQQDi0=GjLkzX+Q@mail.gmail.com"
        type="cite">
        <div dir="ltr">Njn, když chceš hackovat, tak na to musíš mít
          křídla :)
          <div><br>
          </div>
          <div>Z chyby <span style="font-size:12.8000001907349px"><font
                face="monospace, monospace">'generator' object has no
                attribute 'set_configuration'</font> je zřejmé, že to <font
                face="monospace, monospace">usb.core.find</font> vrací
              iterátor. No a proč to vrací iterátor? Protože <a
                moz-do-not-send="true"
href="https://github.com/walac/pyusb/blob/a83f17e568bf893bed53fa984f00c1e168348cb9/usb/core.py#L1127">deklarace

                té funkce</a> je</span></div>
          <div><span style="font-size:12.8000001907349px"><br>
            </span></div>
          <div><span class=""
              style="color:rgb(167,29,93);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">def</span><span
style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">
            </span><span class=""
              style="color:rgb(121,93,163);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">find</span><span
style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">(</span><span
              class=""
              style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">find_all</span><span
              class=""
              style="color:rgb(167,29,93);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">=</span><span
              class=""
              style="color:rgb(0,134,179);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">False</span><span
style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">,
            </span><span class=""
              style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">backend</span><span
style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">
            </span><span class=""
              style="color:rgb(167,29,93);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">=</span><span
style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">
            </span><span class=""
              style="color:rgb(0,134,179);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">None</span><span
style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">,
            </span><span class=""
              style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">custom_match</span><span
style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">
            </span><span class=""
              style="color:rgb(167,29,93);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">=</span><span
style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">
            </span><span class=""
              style="color:rgb(0,134,179);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">None</span><span
style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">,
              **</span><span class=""
              style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">args</span><span
style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">):</span><span
              style="font-size:12.8000001907349px"><br>
            </span></div>
          <div class="gmail_extra"><br>
          </div>
          <div class="gmail_extra">a když to voláš bez keyword
            argumentů, tak se jako <font face="monospace, monospace">find_all</font>
            nastaví to 0x10C48, což se interpretuje podobně jako <font
              face="monospace, monospace">find_all=True</font>.</div>
          <div class="gmail_extra"><br>
          </div>
          <div class="gmail_extra">Takže o krok zpět k <span
              style="font-size:12.8000001907349px"><font
                face="monospace, monospace">ValueError: No backend
                available</font>.  Podívej se do zdrojáku, co to dělá.
              Prochází to moduly </span><span
              style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">usb.backend.libusb1</span><span
              style="font-size:12.8000001907349px">,</span><span
              style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre"> u</span><span
style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">sb.backend.libusb0</span><span
              style="font-size:12.8000001907349px"> a </span><span
              style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">usb.backend.openusb</span><span
              style="font-size:12.8000001907349px"> a volá to jejich
              funkci </span><span
              style="color:rgb(51,51,51);font-family:Consolas,'Liberation
Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">get_backend()</span><span
              style="font-size:12.8000001907349px">, která se snaží
              danou DLL (nebo .so) knihovnu načíst (protože <font
                face="monospace, monospace">usb.backend.* </font>jsou
              jen ctypes wrappery "céčkových" knihoven). Takže problém
              je v tom, že žádnou z těch knihoven buď nemáš k dispozici,
              nebo ji pyusb nemůže najít.</span></div>
          <div class="gmail_extra"><span
              style="font-size:12.8000001907349px"><br>
            </span></div>
          <div class="gmail_extra">PM</div>
          <div class="gmail_extra"><br>
            <div class="gmail_quote">Dne 16. května 2015 16:28 "Ing.
              Vladislav Ludík" <span dir="ltr"><<a
                  moz-do-not-send="true" href="mailto:vlada@ludik.cz"
                  target="_blank">vlada@ludik.cz</a>></span>
              napsal(a):<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">Ještě

                chyby:<br>
                <br>
                dev = usb.core.find(idVendor=0x10C48, idProduct=0xEA60)<br>
                <br>
                hlásí chybu:<br>
                <br>
                dev = usb.core.find(idVendor=0x10C48, idProduct=0xEA60)<br>
                  File "build\bdist.win32\egg\usb\core.py", line 1199,
                in find<br>
                    raise ValueError('No backend available')<br>
                ValueError: No backend available<br>
                <br>
                Když jsem změnil řádek na:<br>
                <br>
                dev = usb.core.find(0x10C48, 0xEA60)<br>
                <br>
                program projde dále, ale hlásí chybu:<br>
                <br>
                dev.set_configuration()<br>
                AttributeError: 'generator' object has no attribute
                'set_configuration'<br>
                <br>
                Co s tím dále, nevím.
                <div class="">
                  <div class="h5"><br>
                    <br>
                    Díky Vláďa<br>
                    _______________________________________________<br>
                    Python mailing list<br>
                    <a moz-do-not-send="true" href="mailto:python@py.cz"
                      target="_blank">python@py.cz</a><br>
                    <a moz-do-not-send="true"
                      href="http://www.py.cz/mailman/listinfo/python"
                      target="_blank">http://www.py.cz/mailman/listinfo/python</a><br>
                    <br>
                    Visit: <a moz-do-not-send="true"
                      href="http://www.py.cz" target="_blank">http://www.py.cz</a><br>
                  </div>
                </div>
              </blockquote>
            </div>
            <br>
          </div>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
Python mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:python@py.cz">python@py.cz</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.py.cz/mailman/listinfo/python">http://www.py.cz/mailman/listinfo/python</a>

Visit: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.py.cz">http://www.py.cz</a></pre>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:python@py.cz">python@py.cz</a>
<a class="moz-txt-link-freetext" href="http://www.py.cz/mailman/listinfo/python">http://www.py.cz/mailman/listinfo/python</a>

Visit: <a class="moz-txt-link-freetext" href="http://www.py.cz">http://www.py.cz</a></pre>
    </blockquote>
    <br>
  </body>
</html>