Closed sirthias closed 11 months ago
Forgot to mention that I'm currently running the application as root
to eliminate all user permissions issues for the time being.
The first error is likely because the device is also mounted like a USB memory stick. But I'm not familiar with how to best unmount the device and still be able to access it.
Have you been successful with the rust code on Linux?
I will look into it and come back to you.
Using an IT8951 device as well, I wasn't able to reproduce the problem. It just runs fine, both on Ubuntu (on a rather recent Core i7) as well as on Raspian/Debian (on a Raspberry Pi 4).
It sufficient to create udev rules. Running as root is not needed. The mass storage device will be unmounted when the USB interface is claimed. On Ubuntu, this is obvious from the eject/unmount sound.
Are you using version 0.5.0 from Maven Central? If so, it will not work as the kernel driver detaching was added later. You would need to build the library yourself from the main branch.
Another reason why it doesn't work for you could be that the USBDEVFS_DISCONNECT_CLAIM
ioctl call is not supported yet. I think you mentioned that you are using a Raspberry Pi Zero 2, which likely has an older Linux version. To check it, you would need to locate the file usbdevice_fs.h
(likely in /usr/include/linux
) and then search for USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER
in that file. If the macro is missing, then the Linux version might be too old.
Oh, that sounds great, Manuel! Thank you for going through the trouble of reproducing the problem on your end! I was indeed experimenting with release 0.5.0 and forgot to both mention the version in the ticket description above as well as checking for newer commits on top of 0.5.0... Sorry about that!
Currently I'm running Raspberry Pi OS (64-bit) on the Pi Zero 2W, which is based on Debian Bullseye. I switched to a Rust- and libusb-based approach a few days ago, which is working nicely so far. It has the benefit that I can run the application directly on my dev mac for quick turnaround and easily cross-build and deploy it for the Pi. So, currently I'm off the JVM for this project.
I'm trying to use
JavaDoesUSB
to control an IT8951 attached to a Waveshare ePaper Display and speaking SCSI over USB. The platform is a Raspberry Pi Zero 2 runningDebian GNU/Linux 11 (bullseye)
.JavaDoesUSB
lets me find and open the IT8951 alright, but attempting to claim the only interface (#0) fails with this exceptionMy
/etc/udev/rules.d/80-javadoesusb-udev.rules
files has this content:The vendor should match the device nicely:
When I force an unbind with this command:
The exception changes to:
Do you have any ideas as to how I might make progress? This latter exception looks weird to me. Finding and opening the device works just as before, but when trying to claim interface #0 the "file" is suddenly gone?