Questions tagged [usb4java]

usb4java is a Java library to access USB devices.

usb4java is a Java library to access USB devices. It is based on the native libusb 1.0 library and uses Java NIO buffers for data exchange between libusb and Java. usb4java also supports the javax-usb standard (JSR-80) through the usb4java-javax extension.

Supported platforms are Linux (x86 32/64 bit, ARM 32 bit), OS X (x86 32/64 bit) and Windows (x86 32/64 bit). But other platforms may work as well (as long as they have at least Java 6 and are supported by libusb) by compiling the JNI library manually.

Source: http://usb4java.org/

69 questions
5
votes
1 answer

Reading data from USB Port

currently I am working on a project for university where i have to create a program which controls the humidity in a terrarium. On this purpose i've got an hygrometer. First of all the program has to import the raw data from the hygrometer, but i…
Xinren
  • 71
  • 1
  • 1
  • 4
5
votes
1 answer

I try to read from a usb device I get USB error 5: Unable to read data: Entity not found can someone help me?

I try to read from a usb device through usb4java api but I get an error: USB error 5: Unable to read data: Entity not found can anybody help me? It has to be noted that the endpoint_in i get it from LibUsb.ENDPOINT_IN and i pass it to…
javac31
  • 91
  • 2
  • 11
5
votes
2 answers

usb4java USB error 4: Unable to open USB device:

I am attempting to interface with the PS3's DS3 controller. I have managed to do so in C# using an implementation of libusb but decided to move my implementation to java. Unfortunately my move to java has not been so smooth. The device seems to be…
Devin Wall
  • 180
  • 1
  • 16
5
votes
2 answers

Unable to claim interface: Resource busy

I am working with USB4Java (the low-level version) and am basically working from this code here. I'm working in Ubuntu, and I was running into a problem about permissions but was able to resolve by running eclipse using gksu from the terminal. Now I…
Will
  • 3,413
  • 7
  • 50
  • 107
4
votes
2 answers

Sending a message to a USB device using usb4java - Input/Output Error

I am trying to send a message to my USB device (Silicon Labs USB-UART Bridge) using this code: public void sendMessage(UsbInterface iface, String message, int i){ UsbPipe pipe = null; try { iface.claim(new…
pilgrimm
  • 43
  • 1
  • 5
4
votes
0 answers

Usb4java and Windows 7 64 bit OS I get USB error 8 or 12

I am trying to get usb4java package to work. I get the basic connection, but when I try to get the product, Serial Number, or Manufacturer, I get USB error 12 or 8. I think I may have the libraries messed up. I am using Win 7 Pro 64 bit OS…
cliff2310
  • 570
  • 2
  • 15
  • 28
4
votes
1 answer

Communication between an USB HID device and usb4java

I'm trying to communicate to an embedded system programmed with a HID interface. I get this error: Exception in thread "main" org.usb4java.LibUsbException: USB error 0: Unable to check kernel driver active: Success at…
Fabio Angeletti
  • 311
  • 3
  • 12
4
votes
1 answer

UsbInterface claim fails

I got a Problem: I'm using usb4java on my windows 8 laptop. I got an Infrared Remote Controller plugged in, in my usb port. Now I want to access this Controller.I got the following example code(There are no Exceptions programmed and NullPointers are…
Chris
  • 599
  • 3
  • 11
  • 24
3
votes
2 answers

Java usb4java reading from usb device on windows 10 platform

I am trying to read a message from RFID reader connected via USB to windows 10pro machine with usb4java library. I have managed to claim the interface, opened pipe and registered listener for the data, however the listener is never triggered. The…
John
  • 5,189
  • 2
  • 38
  • 62
3
votes
1 answer

Getting a string descriptor for a USB device

Under Windows 8.1, with LibUsb.getDeviceList(null,connectedDevices), I successfully get each and every USB device connected to my PC with the following code : connectedDevices= new DeviceList(); if(LibUsb.getDeviceList(null,connectedDevices){ …
Zelig63
  • 1,592
  • 1
  • 23
  • 40
3
votes
1 answer

Unresolved import of external library with properties file in classpath

I'm working with usb4java at the high level following this demo: http://usb4java.org/quickstart/javax-usb.html. My issue is that we need javax.usb.properties in the classpath, so I've put it in the src directory. I've also loaded up the .jars into a…
3
votes
0 answers

Usb4Java to HID Device

I am trying to send raw data to an HID Device (NTAG NFC Tag) using the Usb4Java Api. ANY HELP would be greatly appreciated! My code connects to the interface and LibUsb.interruptTransfer(handle, outEndpoint, buffer, transferred, timeout) ==…
3
votes
1 answer

Read data from usb device in libusb with java(usb4java)

I'm reading data from usb device in java with libusb api. I'm able to write data to the device but I can not read data from device. I can read first data group (size : 1 byte) but when I want to read second data group (size : 2 byte) I'm getting…
bzkrtmurat
  • 189
  • 1
  • 3
  • 15
2
votes
1 answer

Convert USB keyboard data from byte array to String USB4Java

I am reading a USB Keyboard (QR Code scanner) input using usb4java. My code snippet looks like this: byte[] data = new byte[16]; UsbPipe usbPipe = usbEndpoint.getUsbPipe(); if (usbPipe != null) { if (!usbPipe.isOpen()) { usbPipe.open(); …
kleash
  • 1,211
  • 1
  • 12
  • 31
2
votes
1 answer

usb4java: Can't get data transfers to work

I'm trying to use usb4java (low-level API) to communicate with a USB-connected scientific instrument set up as an HID device on Windows (both x86 and x86_64). There is a very old C++ application for it that works fine, but I'm trying to replace it…
Sasha
  • 93
  • 9
1
2 3 4 5