Questions tagged [libusb]
libusb is a library that gives user level applications uniform access to USB devices across many different operating systems.
libusb
879
questions
47
votes
7
answers
206k
views
Simple way to query connected USB devices info in Python?
How can we query connected USB devices info in Python?
I want to get UID Device Name (ex: SonyEricsson W660), path to device (ex: /dev/ttyACM0)
And also what would be the best Parameter out of above ...
47
votes
0
answers
1k
views
libusb: error [op_open] getcap failed in C++ on Linux [closed]
I am running into trouble calling libusb_open in C++ on Linux (running on Raspberry Pi but virtualized to x86 using Exagear).
I can find a device using libusb_get_device_list but it appears ...
46
votes
12
answers
82k
views
More than one file was found with OS independent path 'lib/x86/libusb.so'
I am using libusb in my android application. When I am trying to build libusb native library then I get below error message, *.so files generated.
Error:Execution failed for task ':app:...
45
votes
13
answers
107k
views
Pyusb on windows - no backend available
I'm trying to have my Python application interface with an NFC device via USB.
The best option seems to be PyUSB, but I can't get it to connect to the libusb backend.
I keep getting
ValueError: No ...
43
votes
4
answers
93k
views
How to set up libusb on Mac OS X?
I'd like to try to make a user-space device driver using libusb on Mac, but I'm confused where to start. In the SDK installer (which I got from http://www.ellert.se/twain-sane) it said something about ...
40
votes
7
answers
236k
views
How to install libusb in Ubuntu
I have a C program that have #include part in the header.
I have download libusb-1.0.0 to my computer. If I simply copy libusb-1.0.0 folder to the folder where my C program is, it will not work. ...
24
votes
3
answers
50k
views
How to most properly use libusb to talk to connected USB devices?
How do I most properly use libusb to talk to connected USB devices?
Specifically, how do I transfer data to the USB devices, receive information from the devices, find out the name of the connected ...
21
votes
1
answer
2k
views
How to set alternate setting for the USB device using libusb
I am trying to set alternate setting for the USB HUB device which has 5 interfaces.
Following are the configurations for each interface.
1. Ifs= 5 Cfg#= 1 Atr=c0 MxPwr= 2mA A: FirstIf#= 0 IfCount= ...
20
votes
3
answers
34k
views
How to use libusb and libusb_get_device_descriptor()?
I'm learning to use libusb v1.0.0 for the first time on Ubuntu 12.10. Here is some small test code I'm using to try and understand how to use this API:
#include <libusb-1.0/libusb.h>
...
...
17
votes
3
answers
44k
views
Determine USB device file Path
How can i get USB device file path correctly in Linux.
I used command: find / -iname "usb" and got the result as below:
/dev/bus/usb
/sys/bus/usb
/sys/bus/usb/drivers/usb
/sys/kernel/debug/usb
Under ...
17
votes
2
answers
16k
views
Android ADK with PC as USB Host with libusb, bulk transfer error
I'm trying to make my PC the USB Host for Android 2.3.4 devices in order to be able to develop APIs without needing actual "accessories". To do this, I need to establish the PC as the USB Host and ...
15
votes
4
answers
21k
views
How to give /dev/bus/usb permissions for libusb android applications?
i am developing an Application that uses libusb via jni.
this application is currently targeted only to rooted, usb-host
Android 3+ machines.
the scenario is as follows:
<java Activity>
...
15
votes
2
answers
3k
views
LibUsb claim interface access denied Java
I want to be able to read data from an USB pedometer. I'm trying this in Java and I'm using the LibUsb and Usb4Java libraries. I can't seem to claim the usb pipe or anything like that.
The code I'm ...
13
votes
2
answers
24k
views
know a usb device's endpoint
Is there a bash command, a program or a libusb function (although I did not find one) which indicates me what are the OUT or IN endpoints of a usb device ?
For example, bNumEndpoints of ...
12
votes
4
answers
39k
views
Libusb undefined reference to
I'm trying to set up libusb API on my OS. I downloaded libusb api on libusb.org. I followed the standard installation procedure:
cd into directory
./configure
make
make check //without errors
make ...
12
votes
3
answers
15k
views
Why does PyUSB / libusb require root (sudo) permissions on Linux?
I have been toying around with PyUSB lately, and found that it works beautifully on Linux (Ubuntu has libusb 0.1 and 1.0, as well as OpenUSB)... but only if I run the program with root privileges (...
12
votes
3
answers
20k
views
libusb interface already claimed
I'm writing a device driver for a usb device using libusb. When I attempt to claim the device I get the error code LIBUSB_ERROR_BUSY (-6). According to the documentation that means that the device ...
12
votes
3
answers
26k
views
Error message 'Interface not claimed' from libusb
I'm trying to use libusb, but I am get the following error message:
usbfs: process 24665 (myprogram) did not claim interface 0 before use
I don't really understand why, because as far as I can ...
11
votes
5
answers
39k
views
libusb_open returns 'LIBUSB_ERROR_NOT_SUPPORTED' on Windows 7
I have been developing USB drivers using LibUSB on Linux, but now I want to have one of my drivers compiled for Windows (this is the first time I am doing it).
My environment
I am working on Windows 7 ...
11
votes
3
answers
26k
views
linux / libusb get usb device path
I use libusb to enumerate over a few usb-devices. Now i like to get the "device-path". I think it's not called usb device-path, because i was not successful with google.
If i connect a usb-device ...
11
votes
2
answers
14k
views
Using libusb on Android without rooting
I am trying to communicate with USB device from Android-based smartphone via OTG. I was able to communicate with my device using Android USB Host API. The problem of USB Host API solution is ...
11
votes
1
answer
2k
views
Reading from Android USB Accessory throws ENODEV IOException
So I've implemented the Android USB Accessory API such that I can plug in my phone to my laptop running linux and it puts the phone into USB Accessory mode. Then I can access the accessory, open it, ...
11
votes
3
answers
32k
views
How to send data to USB device in node.js using libusb
I have try to get data from device (USB thermometer), following this documentation, but I have not any result.
For getting themperature data from device, I should send the data like that 'd\n'.
This ...
11
votes
1
answer
713
views
How to recover from a stall in chrome.usb?
I'm sending an out bulk transfer, and I stall it in the device (I write the code on both end of the cable) to abort the action. I'm sending a home-made control transfert SET_FEATURE ENDPOINT_HALT to ...
10
votes
8
answers
5k
views
Input from 20+ microphones
I've been asked (if it's possible) to write a program monitoring the input of at least 20 microphones, on a single computer.
Currently I'm prototyping in python (2.6), on a Ubuntu system using Alsa. ...
10
votes
3
answers
3k
views
How can I know if a USB device is already in use?
I am writing a C++ Linux userspace driver for a USB device using the C library libusb. I have two copies of the same device (same vendor ID and product ID) and would like to know how to handle this ...
10
votes
1
answer
5k
views
Software based Android accessory on Windows
I would like to turn my computer into an Android accessory using my application. So instead of a specialized hardware this will be just PC that will switch the phone into accessory mode, thus ...
9
votes
1
answer
8k
views
hidapi vs libusb for Linux
Writing some C code for USB mouse.
More specifically writing configuration and information to mouse like poll, sensitivity, button actions, colors (light), tactile alters, OLED etc.
Started out with ...
9
votes
1
answer
15k
views
Accessing Linux /dev/USB as standard files to communicate with USB device
I'm researching ways to communicate with a USB device in Linux and would prefer to not write a Linux Kernel driver. I understand that libusb exists and is a user-land library that would work, but our ...
9
votes
3
answers
16k
views
PyUSB 1.0: NotImplementedError: Operation not supported or unimplemented on this platform
I just began to use pyusb, and basically I'm playing with the sample code here.
I'm using Windows7 64 bit, and downloaded the zip version from https://walac.github.io/pyusb/. Backend is libusb-1.0....
8
votes
2
answers
21k
views
Compiling against libusb-dev on Ubuntu
I am trying to compile the example libusb.c provided by libusb package (if you dl the source code.)
It doesn't work to say the least.
#include <stdio.h>
#include <sys/types.h>
#include &...
8
votes
5
answers
36k
views
PyUSB: SCPI communication with OWON Oscilloscope
This is an updated and shortened question.
Communicating with a USB-device should be easy via PyUSB. So, I'm trying to read from a USB-device (oscilloscope) using PyUSB under Win10. Apparently, the ...
8
votes
2
answers
17k
views
pyusb: cannot set configuration
I am trying to make a script (on linux) that can turn a light in my mouse on or off.
This is the code I have so far:
import usb.core
import usb.util
import sys
interface = 0
dev = usb.core.find(...
8
votes
1
answer
2k
views
`libusb_attach_kernel_driver` not working
I have a problem shutting down cleanly my Linux application that uses libusb (the kernel does not reclaim the interface):
int rc;
rc = libusb_reset_device(handle_);
if (rc < 0) {
cerr <<...
7
votes
1
answer
9k
views
USB Programming with Objective-C
Can anyone tell me how to program USB devices with Objective-C as an iPhone application?
I want to access USB device contents through iPhone
7
votes
3
answers
13k
views
Pyusb on Windows 7 cannot find any devices
So I installed Pyusb 1.0.0-alpha-1
Under Windows, I cannot get any handles to usb devices.
>>> import usb.core
>>> print usb.core.find()
None
I do have 1 usb device plugged in(...
7
votes
2
answers
39k
views
libusb bulk transfer
I am trying to implement user space usb driver using libusb1.0.9. I have lpc2148 blueboard(ARM7) with me..This board is loaded with opensource USB stack/firmware by Mr. Bertrik Sikken. Now my user ...
7
votes
1
answer
6k
views
libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=2 - What am I doing wrong with LibUSB?
Ok, I'm probably doing something dumb, but I can't get libusb to let me transfer data to my device for the life of me.
Code:
#include <iostream>
#include <iomanip>
#include <unistd.h&...
7
votes
2
answers
8k
views
LibUsbDotNet No devices found when calling UsbDevice.AllDevices
I am executing the example code of LibUsbDotNet which will return me the information of all connected usb devices. You can find this code below.
using System;
using LibUsbDotNet;
using LibUsbDotNet....
7
votes
1
answer
1k
views
What are consequences of not calling libusb_exit()
I am writing a userspace program which interacts with the USB video playback controller. I am programming in C++ and the program is intended to run on Linux. While studying the libusb manual I came ...
7
votes
1
answer
4k
views
libusb_claim_interface fails on Mac OS X Mountain Lion
I've searched for hours with no avail. I've seen it everywhere that libusb_detach_kernel_driver isn't supported on Mac OS X, but I haven't been able to find a patch or alternative for it.
...
7
votes
1
answer
8k
views
USB permission obtained via android.hardware.usb does not apply to NDK
I was able to obtain a permission to communicate with a device via Android's USB Host API.
private static final String ACTION_USB_PERMISSION = "com.android.example.USB_PERMISSION";
protected void ...
7
votes
0
answers
4k
views
Turn off specific USB port in windows with python
This is my first post, and I kind of have seen that the more specific the better, so I'll try to be super clear, and thanks in advance!
What I want:
I need to scan images from 2 or more scanners ...
6
votes
1
answer
4k
views
Python on M1 MBP trying to connect to USB devices - NoBackendError: No backend available
I am trying to connect with Python to my USB devices.
The final result should be a connection to my Blood Pressure Monitor but I am failing already to connect to ANY device.
My simple code - which I ...
6
votes
3
answers
12k
views
Unable to claim USB interface with C + libusb on Mac OS X
I've got a compound USB + CDC device I built using a PIC32 microcontroller, and I'm trying to connect to the device and send some data to the CDC data interface endpoint from my Mac.
I know the ...
6
votes
2
answers
1k
views
How do I mutate the item in Iterator::find's closure?
I would like to use Iterator::find on libusb::Devices object, which has a signature like so:
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where Self: Sized, P: ...
6
votes
2
answers
15k
views
Accessing a USB device with libusb-1.0 as a non-root user
I am trying to interface with a USB device as a non-root user on RHEL5. The device is a GPIO interface (its documentation can be found at http://www.xdimax.com/sub20/sub20.html) which uses libusb-1.0....
6
votes
3
answers
5k
views
Android L | libusb_init returns LIBUSB_ERROR_OTHER (-99)
I trying to use libusb on not rooted Nexus 5 as advised in this approach (by transferring usb file descriptor from java to native side).
My application ask permission via UsbManager.requestPermission ...
6
votes
2
answers
18k
views
libusb interrupt transfer
I need to reverse engineer a driver for custom made HID USB device (some buttons and leds on an control panel). The driver is only available on Windows and we need a *nix implementation.
The device ...
6
votes
2
answers
11k
views
Control the power of a usb port in Python
I was wondering if it could be possible to control the power of usb ports in Python, using vendor ids and product ids. It should be controlling powers instead of just enabling and disabling the ports. ...