473,624 Members | 2,502 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.setConfigura tion 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 2151

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

Similar topics

14
2316
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 going to use .Net......I highly recommend signing up for the free KBAlertz newsletter at http://www.kbalertz.com/default.aspx. Looking at all of the errors and quirks sometimes makes me wonder if this thing is really ready for prime time.
1
3038
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
8791
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) - DAYS(PROBLEMS.CLOSE_DATE)) = 365 AND PROBLEMS.CLOSE_DATE IS NOT NULL But this doesn't: db2 SELECT DISTINCT PROBLEM_OBJECTS.PROBLEM_ID FROM PROBLEM_OBJECTS
10
2401
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) ComboBox.SelectedValue = db_value; If the db_value was not included in the ComboBox value list the ComboBox.SelectedIndex used to return -1, Now the very same code is
2
3169
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 problems that I have encountered to date and the solutions (if any) that I found. http://users.adelphia.net/~brianpclab/ServerControlCollectionIssues.htm This page also has all of the source code in a compressed file that you are free to download...
0
2236
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 computer, the problem comes when the file is in a network drive. The most amazing thing is that in one computer I can execute my .Net program without problems independently if the file is
1
10298
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 libusb.. and i managed to learn the syntax which was quite easy.. and now am left with the job of the "coding".. to be honest i never in my life wrote a code that reads from serial, usb or parallel ports .. and i have no clue about how to do...
5
6871
by: TonyAm | last post by:
Hi, Just wondering if anyone has any simple examples of PyUSB. Thanks, Tony
3
7323
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 this message: >python setup.py install running install running build running build_ext error: Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not...
0
8246
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8179
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8631
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1489
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.