Questions tagged [pyusb]

PyUSB is a Python library allowing easy USB access. Make sure to provide all relevant details like exact versions of the operating system, PyUSB library and libusb backend you are trying to use.

PyUSB is a Python library allowing easy USB access. It has the following features:

  • Support for libusb 0.1, libusb 1.0 and OpenUSB.
  • Easy API to communicate with devices.
  • Support for custom library backends.
  • Isochronous transfer type support.
  • 100% written in Python by ctypes.
  • It runs on any Python version >= 2.4 (this includes Python 3).
259 questions
2
votes
0 answers

Reverse engineering USB protocol - Offset issue

I'm trying to reverse engineer a device protocol that works in windows but has no drivers on linux. I capture (windows vm + wireshark) and then later play back all the USB communication. I believe I have the exact same wireshark trace on the windows…
Reyn
  • 261
  • 1
  • 4
  • 11
2
votes
0 answers

PyUSB USBError: [Errno None] Unknown error

I'm trying to run the set_configuration() method to connect with my USB device but am receiving the following error: [Errno None] Unknown error Traceback (most recent call last): File "usb_ruf_test.py", line 74, in
rufism
  • 382
  • 1
  • 9
2
votes
3 answers

No module named usb.core

How can I remove this error in the below mentioned program? The error iI'm getting is ImportError: No module named usb.core and my code is: import usb.core import usb.util # find our device dev = usb.core.find(idVendor=0xfffe,…
Rahul Dhiman
  • 21
  • 1
  • 1
  • 3
2
votes
1 answer

PyUSB device claimed, detach_kernel_driver return Entity Not Found

I'm attempting to do bulk reads and writes from a USB device on Ubuntu using PyUSB. However, i've been unsuccessful at getting that far. import usb.core import usb.util dev = usb.core.find(idVendor=0xXXXX,idProduct=0xYYYY) if dev is None: …
jbh
  • 1,153
  • 2
  • 11
  • 24
2
votes
2 answers

what is happening in this python code?

The following snippet is from a pyusb tutuorial. It is being used to find all printers connected : import usb.core import usb.util import sys class find_class(object): def __init__(self, class_): self._class = class_ def…
Flame of udun
  • 2,136
  • 7
  • 35
  • 79
2
votes
0 answers

Does LibUsb-win32 require every device to have its own INF file?

I'm trying to develop a USB board that can connect to the computer as a HID device and talk to a Python application I'd write. I want to use Python and I went with a HID device to be driver free. This seems like a great solution until I ran into…
user2559383
  • 106
  • 1
  • 3
2
votes
1 answer

Using pyUSB to read data from ELM327 OBDII to USB device

I am having problems using the pyUSB library to read data from an ELM327 OBDII to USB device. I know that I need to write a command to the device on the write endpoint and read the received data back on the read endpoint. It doesn't seem to want to…
mcpolandc
  • 217
  • 2
  • 7
  • 15
2
votes
1 answer

libusb installed- but pyUSB backend not found

I am trying to design a GUI using wxGlade for a USB device. The pyUSB portion of the code has been added to the python code generated by Glade. However, there is an error. 'No backend available' This is is response to using a function usbDev =…
user1485180
  • 36
  • 1
  • 4
1
vote
2 answers

Install pyUSB 0.4.3 on OSX Lion 10.7.3

I'm trying to install pyusb 0.4.3 on Mac OS X Lion 10.7.3 running Xcode 4.3 (the new Mac App Store .app with command line tools installed). When I try to "python setup.py install" I get this long list of error ending with "error: command…
lyxicon
  • 163
  • 3
  • 6
1
vote
4 answers

Difference between '\x81' and 0x81

I'm new to Python and I'm trying to read some values from an USB device via PyUSB. Well, it works now but I ran into some trouble: While reading data from the device, PyUSB needs an endpoint to read the data from. This endpoint is identified via a…
Karl Nickel
  • 188
  • 1
  • 2
  • 10
1
vote
0 answers

Problems with PyUSB in Python 2.7. Do I need LibUSB driver?

I installed PyUSB from source for Python 2.7 When I import the module I get no error, but when I try: printers = usb.core.find(find_all=True, bDeviceClass=7) or dev = usb.core.find(idVendor=0x04d8, idProduct=0x003f) I get: TypeError: expected…
David Rinck
  • 6,637
  • 4
  • 45
  • 60
1
vote
1 answer

PyUSB AttributeError: 'int' object has no attribute 'enumerate_devices'

First time using PyUSB, trying to reverse engineer an eye-toy (Play Station) for OS X. Though I get the following error, when attempting to establish a testing collection. Traceback (most recent call last): File "eye.py", line 5, in dev =…
Robert
  • 2,222
  • 2
  • 21
  • 36
1
vote
0 answers

Read whole TI calculator file system with PyUSB

I am trying to read the whole file system on a TI calculator via USB. The program runs successfully until it tries to read the file system with dev.read(). To dev.read(), I give the arguments ep.bEndpointAddress (0x81) as the endpoint address and…
1
vote
0 answers

How to control bar code scanner beep with data validation?

I use a 2D barcode scanner to scan the barcode (CODE128) off a smartphone screen. I have a program (python script) to listen for the scanned data while the code is being scanned, however, the issue is that sometimes the data received in the python…
Sam
  • 475
  • 1
  • 7
  • 19
1
vote
1 answer

Using PyUSB, Listing only the device details of mass storage devices

Additionally as I am on Windows (this is eventually going to be for work) I am using libusb_package to use libusb on Windows as well as the PyUSB package as suggested in their documentation. I am trying to get Mass Storage device details from the…
dlystyr
  • 103
  • 6