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

Ubuntu communication to a usb device

I am trying to communicate a USB device (power supply, bk 9115) to python a ubuntu machine- 20.04.02. The company suggested using NI-VISA drivers which are not available for ubuntu machines and I tried using alien to convert rpm drivers to .deb…
2
votes
0 answers

Pyusb and Libusb giving NoBackendError on MacOS

I'm on MacOS Big Sur trying to run rfcat. I am running anaconda as well and I have set up an environment with Python2.7 when I originally got errors with Python3.x. I have downloaded the pyusb, pyreadline, ipython, PySide2, and the libusb…
2
votes
0 answers

Error configuring a USB device using pyvisa

So, as context, I'm writing some controller software in Python for a RTM3004 oscilloscope for laboratory use. I had it working just fine on my laptop (Win10) and the previous laboratory computer (Linux), but upon changing to a new measurement…
Otto Hanski
  • 382
  • 1
  • 6
2
votes
1 answer

Communication with usb device using pyusb

I am using a module called pyUSB version 1.6 and am trying to communicate with a sensor. I have set up the connection and can read from the ROM on the sensor. The sensor, when connected, has a master/slave relationship so I need to send a message…
user800021
  • 29
  • 1
  • 2
2
votes
1 answer

usb.core.USBError: [Errno 5] Input/Output Error

Description: Trying to read mouse data with below code but getting error as given below. please help if anyone has gone through same issue.purpose of doing this is i have read data from the device which is connected as HID device so by the time…
Rahul Gharole
  • 21
  • 1
  • 2
2
votes
2 answers

When using text() with python-escpos I get [Errno None] and key error = 1 (windows 10)

I am trying to print to a TM-T20II thermal printer so I can print receipts. Here is my code: from escpos import printer from escpos import * import escpos from escpos import config import usb.core import usb.util import usb.backend.libusb1 from…
maxxslatt
  • 43
  • 6
2
votes
1 answer

Why is PyUSB not working on Windows 10 despite the proper dependency being installed?

I am using Python 3.8. I have found PyUSB is suggested as the way to go; however, I have tried it but it doesn't find a backend. The included backends are for libusb0.1, libusb1.0, and OpenUSB. libusb0.1 is legacy. libusb1.0 is current; however,…
Inversus
  • 3,125
  • 4
  • 32
  • 37
2
votes
1 answer

Simple communication USB with python PyUSB on Windows 10

I'm trying to communicate with a USB device with python. I am running Windows 10 and that I use Python 3.7.2 32bit. I installed PyUSB with pip pip install pyusb Here is my test code import usb.core dev = usb.core.find(idVendor=0x1664,…
Mick
  • 53
  • 1
  • 1
  • 8
2
votes
1 answer

PyUSB/ similar USB functionality for Python 2.7

Is it possible to get a program like PyUSB, or similar, for python version 2.7?
user715578
  • 467
  • 2
  • 8
  • 16
2
votes
1 answer

How to bind/unbind usb device in PyUsb?

I need to on/off several usb devices on my python script. Can i bind and unbind usb devices with PyUsb? I can do it with shell commands: Power off: echo "device_nuber" > /sys/bus/usb/drivers/usb/unbind Power on: echo "device_nuber" >…
vakym
  • 61
  • 1
  • 9
2
votes
2 answers

Tkinter and detection of USB devices

I would like to monitor the presence of USB devices and have found modules such as PyUSB that serve this purpose. However, I don't know how to run USB detection services alongside the Tkinter main loop. Is this possible?
sentinel
  • 401
  • 5
  • 14
2
votes
0 answers

PyUSB setconfiguration trouble

I want to make a Python script to change the dafault configuration of a Samsung smartphone. I'm using the PyUSB library to get the configuration. I can't switch to the second configuration. The code is the following # -*- coding:Utf-8 -*- import…
Foxrider83
  • 21
  • 6
2
votes
2 answers

PyUSB: No backend available

I'm trying to reach out and find what USB devices are tied to my computer. I'm going through the "Programming with PyUSB 1.0" tutorial. I can't get anything I'm using there to work, I keep getting a "ValueError: No background available" error. What…
Mike
  • 41
  • 1
  • 4
2
votes
1 answer

Isochronous Read/Write with PyUSB

PyUSB 1.0 claims to now support isochronous transfers if the underlying backend supports it. I've figured out how to select the libusb1.0 backend which supports isochronous transfer, but I'm not sure how to actually implement reads and writes. …
2
votes
0 answers

OSX/pyusb/libusb1: Cant read from device

I'm trying to perform bulk read and write operations on a USB-to-Ethernet device using pyusb with libus1 as backend. The code: dev = usb.core.find(idVendor=..., idProduct=...) if dev.is_kernel_driver_active(0) is True: …
blap
  • 76
  • 6