473,498 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems with pyusb

angelie
2 New Member
im trying to communicate with an humain interface device using python's pyusb. i need to acquire data using the interrupt transfer type.

i have two endpoints,
EP1 = interrupt, out
EP2 = interrupt, in

1 configuration (configuration 1)
1 interface (interface 0)

idVendor = 0xFFFF
idProduct = 0xFFF1

OS: ubuntu

Expand|Select|Wrap|Line Numbers
  1.  
  2. import usb
  3. def OpenDevice(idVendor, idProduct):
  4.     devices = []
  5.  
  6.     for b in usb.busses():
  7.         for d in b.devices():
  8.             if d.idVendor = idVendor and d.idProduct = id.Product:
  9.                 devices.append(d)
  10.  
  11.     if len(devices) == 1:
  12.         device = devices[0]
  13.         return device
  14.  
  15.     elif not devices:
  16.         print "Device not found"
  17.  
  18.     else
  19.         print "More than one device found"
  20.  
  21. IRCVENDOR = 0xFFFF
  22. POXPRODUCT = 0xFFF1
  23.  
  24. if __name__ == "__main__":
  25.     device = OpenDevice(IRCVENDOR,POXPRODUCT)
  26.     packet_len = 8
  27.  
  28.     dh = device.open()
  29.     dh.setConfiguration(1)
  30.     dh.claimInterface(0)
  31.  
  32.     ADCdata = dh.interruptRead(2,2,100)
  33.     print ADCdata
  34.  
  35.  
do you see any problem with this code?
i get these errors:

usb.USBError: could not set config 1: Operation not permitted

what does this error mean? i tried surfing the net for answers but couldnt find any...i also tried ommiting the dh.setConfiguration line since i only have one configuration but i also got errors (guess that really wasnt the way to solve it :P )

also, what does "error submitting urb" mean?

please help! thanks
Dec 5 '07 #1
0 2138

Sign in to post your reply or Sign up for a free account.

Similar topics

14
2286
by: Jim Hubbard | last post by:
Are you up to speed on the difficulties in using the 1.1 .Net framework? Not if you are unaware of the 1,596 issues listed at KBAlertz (http://www.kbalertz.com/technology_3.aspx). If you are...
1
3024
by: 3f | last post by:
Hello; We have made a web application that people can download from our web site and installed on: Windows XP Windows 2000 Professional Windows 2003 Server Windows 2000 Server
5
8780
by: Corky | last post by:
This works: db2 SELECT DISTINCT PROBLEM_OBJECTS.PROBLEM_ID FROM PROBLEM_OBJECTS INNER JOIN PROBLEMS ON PROBLEM_OBJECTS.PROBLEM_ID = PROBLEMS.PROBLEM_ID WHERE INTEGER(DAYS(CURRENT DATE) -...
10
2375
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
2
3154
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
0
2218
by: Sergistm | last post by:
Hello World, :D I have a problem that it is making me crazy, I hope you can help me. I'm trying to execute a .exe file with the Procces.Start, and there is no problem when the file is on my...
1
10284
by: Max M | last post by:
Hi.. My supervisor just asked to me to "learn" python... and write a script that gets info from a "GPS receiver" that it's connected to the "usb" port.. so i downloaded and built the pyUsb and...
5
6865
by: TonyAm | last post by:
Hi, Just wondering if anyone has any simple examples of PyUSB. Thanks, Tony
3
7317
by: robingfx | last post by:
This seems like a pretty straight forward thing to do, but I just can't get pyUSB to install properly. I download the .gz file from SourceForge and run the normal "python setup.py install". I get...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.