studio icon indicating copy to clipboard operation
studio copied to clipboard

lunii not recognize, usb error

Open lotib opened this issue 4 years ago • 7 comments

Describe the bug My lunii is not recognize and does not appear in the studio application on MacOS and Linux

To Reproduce

  1. Launch Studio
  2. plug-in lunii's usb wire

Expected behavior Lunii should be recognize and appear in the application

Logs On macos

2020-06-28 06:43:12,347 [INFO ] [s.w.s.StoryTellerService]: Device plugged 2020-06-28 06:43:12,349 [ERROR] [s.w.s.StoryTellerService]: Failed to plug device java.util.concurrent.CompletionException: studio.driver.StoryTellerException: Unable to claim libusb interface at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1766) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1756) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177) Caused by: studio.driver.StoryTellerException: Unable to claim libusb interface at studio.driver.LibUsbHelper.lambda$executeOnDeviceHandle$4(LibUsbHelper.java:311) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1764) ... 6 more Caused by: org.usb4java.LibUsbException: USB error 99: Other error ... 8 more

openjdk 11.0.7 2020-04-14

On linux 020-06-28 00:23:02,654 [INFO ] [s.w.s.StoryTellerService]: Device plugged 2020-06-28 00:23:02,691 [WARN ] [s.d.StoryTellerAsyncDriver]: No serial number in SPI 2020-06-28 00:23:02,694 [WARN ] [s.d.StoryTellerAsyncDriver]: No firmware version

Desktop and environment (please complete the following information):

  • OS: MacOS 10.12.6 Linux Debian 10
  • Browser : firefox
  • Java version: MacOS openjdk 11.0.7 2020-04-14 Linux openjdk 11.0.7 2020-04-14
  • STUdio application version release 0.2

lotib avatar Jun 28 '20 15:06 lotib

Hi, thanks for the feedback.

Do you have the official luniistore running when using STUdio? If so, can you try closing it? On linux I don't see any error, did you try refreshing the webpage? Can you check the "network" tab to see if there are errors, or to see the response for endpoint /device/infos?

marian-m12l avatar Jun 29 '20 06:06 marian-m12l

Hi, For information, I have also troubles to connect lunii box with the recently 2.0 release. However, it's working well with 2.0b. I'll try to analyze driver's logs later. UPDATE After rebooting it works again with 2.0 version, maybe a Windows driver bug...

crazymonster999 avatar Jun 29 '20 21:06 crazymonster999

@crazymonster999 Thanks for the details. Didn't have the chance to upgrade yet. With this firmware upgrade, does your device appear as a filesystem? It seems like the plan is to move to a filesystem-based device, but I was expecting this to be only for a newer generation "v2" device. Will have to take a look.

@lotib Are you using firmware 2.x too?

marian-m12l avatar Jun 30 '20 11:06 marian-m12l

On linux it is working well, I don't know why I thought it was not working. On macos, I'm pretty sure official luniistore is not working (unless there is a hidden daemon), and I have the same USB error.

I'm not sure how to identify the lunii firmware version, I can see the label "Model: LUNII-1" written on the device.

Sorry for the Linux misunderstanding, and thanks for your awesome work !

lotib avatar Jul 01 '20 10:07 lotib

Good to know.

I'm not aware of a deamon for the official application, but I'm not using macOS either...

If it works well on Linux, your firmware version should be displayed on the UI when you plug the device.

marian-m12l avatar Jul 01 '20 11:07 marian-m12l

Here is a screenshot of what I see when I plug the device (linux) :

  • I hid the UUID cause I don't know if it's safe to expose it, but it seems to be well identified by Studio.
  • no serial number
  • no firmware version lunii-version

And the log are showing these warnings

2020-07-01 14:25:37,406 [WARN ] [s.d.StoryTellerAsyncDriver]: No serial number in SPI
2020-07-01 14:25:37,409 [WARN ] [s.d.StoryTellerAsyncDriver]: No firmware version

lotib avatar Jul 01 '20 12:07 lotib

Hi @lotib

This seems to be related to a bug in libusb on earlier macOS versions (< 10.14) : see https://github.com/usb4java/usb4java/issues/78 and https://github.com/libusb/libusb/issues/519

The issue seems to be fixed with the latest release of libusb (1.0.23), unfortunately the Java wrapper has not been upgraded yet. If you're willing to experiment, you could try dropping the latest library in-place within libusb4java-1.3.0-darwin-x86-64.jar, but I'm not sure the libusb api is backwards-compatible. Otherwise, as the bugs seems to occur only when compiling on macOS 10.14+, maybe you could just recompile version 1.0.22 yourself.

marian-m12l avatar Jul 03 '20 20:07 marian-m12l