> Hi all, > > If I eliminate the line: > > handle.setConfiguration(1) This is really weird, you could try your original code in Linux.
> > I get an error: USBError: usb_submit_async: invalid configuration 0 Yes, now I remember, libusb needs set_configuration call for internals data structures. Sorry making you loosing your time. > > So clearly a Configuration is needed. Not sure where to go from here. I'm > wondering if I should just try to access LibUSB directly with Ctypes - that's > what PyUSB does, right? I haven't seen any of the PyUSB code so I'm not > sure what's under the hood. So maybe now the question is: PyUSB 1.0 does, PyUSB 0.x is a native module, written in C. > > Is there a minimal amount of code, using Ctypes and LibUSB (win32) to > > 1. Instantiate and HID device (enumerated below) > 2. Write a string > 3. Read the response You can give a look at PyUSB 1.0 sources at svn. > > Please let me know. > > Best Regards, > > J.D. > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > Sorry for the long delay, but I have had hardworking in my main job... > Strange this error... Try to not call setConfiguration. Maybe the > underline hardware > driver already called it, and calling it twice may be causing the > peripheral hangs... > > Wander > > 2009/11/9 J.D. Main <jdm...@comcast.net>: >> Hi - thanks for the tip. It doesn't work though. >> >> The line: >> >> handle.setConfiguration(1) >> >> causes the whole program to lock up. The code never gets past it. Any >> ideas about what's causing this? >> >> Best Regards, >> J.D. >> >> Try this: >> >>> handle = dev.open() >>> handle.setConfiguration(1) >>> handle.interruptWrite(2,"hello world") >> >> But probably your device doesn't know what "hello world" means, some >> expect no side effect... >> >> Wander >> >> 2009/11/4 J.D. Main <jdm...@comcast.net>: >>> Hi folks, >>> >>> I was hoping to get a little snippet of code to help me query a USB >>> temperature sensor with Python. I have installed libusb-win32 (v1.12.2) > and >>> pyusb (v0.4.2). I can sucessfully enumerate the device. Here's what it >>> looks like: >>> >>> Device: \\.\libusb0-0008--0x1dfd-0x0002 >>> Device class: 0 >>> Device sub class: 0 >>> Device protocol: 0 >>> Max packet size: 8 >>> idVendor: 7677 (0x1dfd) >>> idProduct: 2 (0x0002) >>> Device Version: 01.10 >>> Configuration: 1 >>> Total length: 41 >>> selfPowered: 0 >>> remoteWakeup: 0 >>> maxPower: 200 >>> Interface: 0 >>> Alternate Setting: 0 >>> Interface class: 3 >>> Interface sub class: 0 >>> Interface protocol: 0 >>> Endpoint: 0x81L >>> Type: 3 >>> Max packet size: 16 >>> Interval: 10 >>> Endpoint: 0x2L >>> Type: 3 >>> Max packet size: 16 >>> Interval: 10 >>> >>> I'm more used to working with serial ports than usb so I was hoping for a >>> very minimal amount of code to: >>> >>> 1. Instantiate the device >>> 2. Write a string ("hello world") >>> 3. Read the response >>> >>> I have gotten as far as: >>> >>> handle = dev.open() >>> handle.bulkWrite(0x81,"hello world") >>> >>> but then get an error: invalid endpoint 0x81 >>> >>> I'm clearly missing some steps or doing something wrong. Any help > would >>> be greatly appreciated. >>> >>> Best Regards, >>> >>> J.D. > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Pyusb-users mailing list > Pyusb-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyusb-users > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Pyusb-users mailing list Pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users