Re: [pyusb-users] pyusb 1.0a for a hid device on linux

2010-12-16 Thread Tormod Volden
On Wed, Dec 15, 2010 at 9:33 PM, nick caruso wrote: > > I have read that Wireshark can analyze USB protocol under linux.  I > have not yet tried it, so I can't say > anything about how well it works.  But you might try that. I can confirm that Wireshark is very useful for USB debugging. Since you

Re: [pyusb-users] pyusb 1.0a for a hid device on linux

2010-12-15 Thread nick caruso
On Wed, Dec 15, 2010 at 2:02 PM, Marcos Wolff wrote: > Hi lil' update, > I found out how to sniff it with sudo cat /sys/kernel/debug/usb/usbmon/2u : > https://docs.google.com/Doc?id=dfpfb3rg_128f855msfs&authkey=COzv2oUI > that's the output but it's really difficult to read, I tried with this > tut

Re: [pyusb-users] pyusb 1.0a for a hid device on linux

2010-12-15 Thread Marcos Wolff
Hi lil' update, I found out how to sniff it with sudo cat /sys/kernel/debug/usb/usbmon/2u : https://docs.google.com/Doc?id=dfpfb3rg_128f855msfs&authkey=COzv2oUI that's the output but it's really difficult to read, I tried with

Re: [pyusb-users] pyusb 1.0a for a hid device on linux

2010-12-15 Thread Marcos Wolff
Hey Santiago, I've tried sending control messages but either the devices does not use it or I cannot construct them correctly, for example, here I've tried to send a GET_REPORT (the one that keyboard and mises use to communicate according to HID especification) message: # 0x91 and 0x01 for a GET_

Re: [pyusb-users] pyusb 1.0a for a hid device on linux

2010-12-14 Thread Santiago Palomino Sanchez-Manjavacas
It was a long time since I worked with the usb, but I recall the endpoints are unidirectional. I think trying to read from an output shall return some kind of error. You can try to find out which of the two operations (r/w) is working first. You can try to find out if the device accepts the writes

Re: [pyusb-users] pyusb 1.0a for a hid device on linux

2010-12-14 Thread Marcos Wolff
update: If I use the same endpoint for reading and writing it works but returns just 0s :( #prueba.py import usb.core dev = usb.core.find(idVendor=1240,idProduct=32) if dev is None: raise ValueError('Device not found') interface = dev.get_interface_altsetting() if dev.is_kernel_driver_active(

Re: [pyusb-users] pyusb 1.0a for a hid device on linux

2010-12-14 Thread Marcos Wolff
Hi again, Did a little more research. I found out the console command lsusb -vv to analyze the device, runned it, got this: Bus 002 Device 030: ID 04d8:0020 Microchip Technology, Inc. Device Descriptor: bLength18 bDescriptorType 1 bcdUSB 1.10 bDeviceC

Re: [pyusb-users] pyusb 1.0a for a hid device on linux

2010-12-14 Thread Marcos Wolff
Follow-up: Santiago: Also found the method doesn't exists in pyusb 1.0 apparently it manages interface claiming automatically. source: http://www.mail-archive.com/pyusb-users@lists.sourceforge.net/msg00374.html On Tue, Dec 14, 2010 at 3:30 PM, Marcos Wolff wrote: > Hi Santiago, > > Following t

Re: [pyusb-users] pyusb 1.0a for a hid device on linux

2010-12-14 Thread Marcos Wolff
Hi Santiago, Following this tutorial it doesn't seem to be needed: http://pyusb.sourceforge.net/docs/1.0/tutorial.htm#talk-to-me-honey Anyway I've tried (kind of desperate here) and didn't work :( thank for the quick answer ! On Tue, Dec 14, 2010 at 3:18 PM, Santiago Palomino Sanchez-Manjavac

Re: [pyusb-users] pyusb 1.0a for a hid device on linux

2010-12-14 Thread Santiago Palomino Sanchez-Manjavacas
missing claimInterface() before using the control endpoint? Just a guess On Tue, Dec 14, 2010 at 18:54, Marcos Wolff wrote: > Hi everyone, > > I'm having trouble comunicating with a custom made (from a PIC 18f4550 > micro-controller) HID device. Nowadays is used with windows and the default > H

[pyusb-users] pyusb 1.0a for a hid device on linux

2010-12-14 Thread Marcos Wolff
Hi everyone, I'm having trouble comunicating with a custom made (from a PIC 18f4550 micro-controller) HID device. Nowadays is used with windows and the default HID driver in vb6 but I would like to port it to linux (ubuntu 10.10) and pyusb (1.0a). The device is simple, when it receives 3 bytes vi