This can be many things, does your device have more than one
configuration or interface/alternate setting? And about the endpoint
address? I see you are using PyUSB 1.0, are you running it under
Windows? I haven't tested it in Windows yet (actually I did, but there
are some issues that I did not fix yet, then I could not progress with
tests).
Wander
2010/1/21 Romain Aviolat <r.a...@gm...>:
> Hi, this my first time in this mailing list,
>
> I'm trying to reverse a device that has no support for Linux, I'm new to
> pyusb and have a problem with my script.
>
> I sniffed the USBlog from a virtual machine running windows and my working
> device here's the log:
>
> f53ed800 355026092 S Co:2:002:0 s 40 02 0002 0000 0000 0
> f53ed800 355027800 C Co:2:002:0 0 0
> f53ed800 355075185 S Bo:2:002:2 -115 3 = 00ffff
>
> If the device receive the 0x00, 0xFF, 0xFF sequence, it then send it's data
>
> Here's my code (mainly used the examples on the pyusb website)
>
> ------------------------
> import usb.core
> import usb.util
>
> # find our device
> dev = usb.core.find(idVendor=0x10c4, idProduct=0x0002)
>
> # was it found?
> if dev is None:
> raise ValueError('Device not found')
>
> # set the active configuration. With no arguments, the first
> # configuration will be the active one
>
> dev.set_configuration()
>
> msg = [0x00, 0xFF, 0xFF]
> sent_bytes = dev.write(0x02, msg, 0, 100)
> ------------------------
>
> and here's the output
>
> f341b700 484297497 S Co:2:003:0 s 00 09 0001 0000 0000 0
> f341b700 484299102 C Co:2:003:0 0 0
> f341b700 484312389 S Bo:2:003:2 -115 3 = 00ffff
>
> The 0x00, 0xFF, 0xFF sequence is correctly sent but the device doesn't send
> it's data, we can see in the first line of both log that the ControlOutput
> is not the same, I think this is my problem.
>
> I don't know how to change 09 0001 0000 0000 to 40 02 0002 0000 0000
>
> Hope someone can help me,
>
> Cheers, Romain
>
>
>
> ------------------------------------------------------------------------------
> Throughout its 18-year history, RSA Conference consistently attracts the
> world's best and brightest in the field, creating opportunities for
> Conference
> attendees to learn about information security's most important issues
> through
> interactions with peers, luminaries and emerging and established companies.
> http://p.sf.net/sfu/rsaconf-dev2dev
> _______________________________________________
> Pyusb-users mailing list
> Pyu...@li...
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>
>
|