codeminders / javahidapi

Java API for HID (Human Interface) Devices
Other
10 stars 7 forks source link

Should work on ARM with cibuddy Library? #48

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Use javahidapi with cibuddy ARM library.

What is the expected output? What do you see instead?

Device should open, but "open" returns null.

What version of the product are you using? On what operating system?

javahidapi 1.1 on Raspbian Wheezy (Linex 3.2.27, armv6l)

Please provide any additional information below.

I'm trying to get the code working on a Raspberry Pi (ARM v6, soft floating 
point).

In the absence of an ARM binary as part of javahidapi I tried:

  https://github.com/cibuddy/cibuddy/tree/master/drivers/hid/src/main/resources/lib/linux/arm6

This looks hopeful as "listDevices" finds the device I'm interested in:

  HIDDeviceInfo [path=0001:0004:00, vendor_id=4062, product_id=51713, serial_number=null, release_number=770, manufacturer_string=null, product_string=null, usage_page=0, usage=0, interface_number=0]

However, when I "open" this device I get null.

Any inspirations, or plans to provide an ARM binary of your own?

Original issue reported on code.google.com by k...@cs.stir.ac.uk on 1 Feb 2013 at 2:16

GoogleCodeExporter commented 9 years ago
In case this helps anyone finding this post...

I turns out that the cibuddy library does work OK - but only as root. I was 
able to fix this for ordinary users by creating a rules file in 
"/etc/udev/rules.d" containing:

  SUBSYSTEM=="usb", GROUP="staff", MODE="0660"

which gives users in group "staff" read/write access to all USB devices.

So this is a non-issue, though it would still be useful if a Linux/ARM library 
were bundled with javahidapi.

Original comment by k...@cs.stir.ac.uk on 8 Feb 2013 at 2:07

GoogleCodeExporter commented 9 years ago
I compiled from source a version of libhidapi-jni.so on the default Raspbian 
build (w/ hardware floating point). I've attached it.

I also downloaded Oracle's JDK 8 for Arm and rebuilt the entire hidapi-1.1.jar 
library and have also attached that. I may have made mistakes in the build 
process (I am not an experienced linux coder), but it works for my 
applications. I've attached the library. I had to make minor modifications to 
build.xml to build with Java 8.

Original comment by tlauw...@gmail.com on 13 Feb 2013 at 9:21

Attachments:

GoogleCodeExporter commented 9 years ago
That's excellent thank you! I'll try these out.

Original comment by k...@cs.stir.ac.uk on 13 Feb 2013 at 9:58

GoogleCodeExporter commented 9 years ago
Mostly for my own sake I wrote down everything I did to build the native 
library and the jar. Hope it helps, and since I did this partially from memory, 
please let me know if anything is wrong:
http://www.finchrobot.com/compiling-javahidapi-raspberry-pi

Original comment by tlauw...@gmail.com on 14 Feb 2013 at 7:04

GoogleCodeExporter commented 9 years ago
I used the new JAR and library on a Raspberry Pi with the USB device in 
question (a weather station that appears as a Human Interface Device). I'm 
pleased to report that everything works fine. Many thanks for your efforts, 
which I'm sure that others will also appreciate.

Original comment by k...@cs.stir.ac.uk on 15 Feb 2013 at 10:10

GoogleCodeExporter commented 9 years ago
Incidentally, for some reason (different version of Raspbian?) I found it was 
necessary on another Raspberry Pi to define the udev rule as:

  SUBSYSTEMS=="usb", GROUP="staff", MODE="0660"

Original comment by k...@cs.stir.ac.uk on 15 Feb 2013 at 10:13

GoogleCodeExporter commented 9 years ago
I am trying to use this on an udoo duo device, but i get

Exception in thread "main" java.lang.UnsatisfiedLinkError: init

shouldnt the arm library work on any arm based device?
I even compiled the lib by myself, same problem. Any glue about the deeper 
problem?

Original comment by senior.w...@gmail.com on 19 Feb 2014 at 3:43