-
Notifications
You must be signed in to change notification settings - Fork 148
Bug Report: USB Connection Failure with Lunii Boîte à Histoires on MacBook M1 #531
Description
Describe the bug
The application fails to connect to the Lunii boîte à histoires device on a MacBook M1, resulting in a USB error 3: Access denied (insufficient permissions) error. This issue persists despite multiple attempts to modify USB permissions and update relevant libraries.
To Reproduce
Steps to reproduce the behavior:
Connect the Lunii boîte à histoires device to the MacBook M1 via USB.
Run the studio-linux.sh script to start the application.
Observe the error messages in the console output.
See the error log indicating the failure to claim the libusb interface.
Expected behavior
The application should successfully connect to the Lunii boîte à histoires device, allowing for seamless interaction and data transfer.
Screenshots
Logs
Check the logs in the console for errors. Below is the relevant log output:
2025-02-22 10:11:36,979 [INFO ] [i.v.c.i.l.c.VertxIsolatedDeployer]: Succeeded in deploying verticle
2025-02-22 10:11:37,465 [INFO ] [s.w.a.EvergreenController]: Current version infos: {"version":"0.5.0","timestamp":"2023-12-14T15:02:19Z"}
2025-02-22 10:11:37,609 [INFO ] [s.w.a.LibraryController]: Library packs scanned in 7ms
2025-02-22 10:12:27,947 [INFO ] [s.d.LibUsbDetectionHelper]: Hotplug event callback (0c45:6820): 1
2025-02-22 10:12:27,953 [INFO ] [s.w.s.StoryTellerService]: Device 1.x plugged
2025-02-22 10:12:27,961 [ERROR] [s.w.s.StoryTellerService]: Failed to plug device 1.x
java.util.concurrent.CompletionException: studio.core.v1.utils.exception.StoryTellerException: Unable to claim libusb interface
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: studio.core.v1.utils.exception.StoryTellerException: Unable to claim libusb interface
at studio.driver.raw.LibUsbMassStorageHelper.lambda$executeOnDeviceHandle$0(LibUsbMassStorageHelper.java:244)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
... 6 more
Caused by: org.usb4java.LibUsbException: USB error 3: Access denied (insufficient permissions)
... 8 more
Additional Information
Operating System: macOS (version details can be added here)
Device: Lunii boîte à histoires
Java Version: OpenJDK 17
libusb Version: 1.0.27
Script: studio-linux.sh
Steps Taken to Resolve
Verified and modified USB permissions using sudo chmod 666 /dev/cu.*.
Added permission modification script to ~/.zshrc to ensure permissions are set on startup.
Verified kernel extensions using kextstat | grep usb.
Updated libusb to the latest version (1.0.27).
Ensured Java JDK 17 is installed and configured correctly.
Potential Causes
The device itself may be incompatible with macOS or Apple Silicon.
There may be an issue with the specific USB port or hub being used.
Additional system-level permissions or configurations may be required.
Next Steps
Verify device compatibility with macOS and Apple Silicon.
Consult Lunii support for any known issues or firmware updates.
Please review the above information and provide any additional details or steps that may help in resolving this issue.
FYI my last sh version`#!/bin/sh
STUDIO_PATH="dirname \"$0\""
DOT_STUDIO="$HOME/.studio"
LIB_PATH="$STUDIO_PATH/lib"
LIBRARY_URL="https://repo1.maven.org/maven2/io/github/dsheirer/libusb4java-darwin-aarch64/1.3.1/libusb4java-darwin-aarch64-1.3.1.jar"
LIBRARY_JAR="$LIB_PATH/libusb4java-darwin-aarch64-1.3.1.jar"
DB_PATH="/var/root/.studio/db"
UNOFFICIAL_DB="$DB_PATH/unofficial.json"
Make sure the .studio subdirectories exist
if [ ! -d $DOT_STUDIO/db ]; then mkdir -p $DOT_STUDIO/db; fi
if [ ! -d $DOT_STUDIO/library ]; then mkdir -p $DOT_STUDIO/library; fi
Make sure the lib directory exists
if [ ! -d $LIB_PATH ]; then mkdir -p $LIB_PATH; fi
Download the library if it doesn't exist
if [ ! -f $LIBRARY_JAR ]; then
echo "Téléchargement de la bibliothèque libusb4java-darwin-aarch64..."
curl -L -o $LIBRARY_JAR $LIBRARY_URL
if [ $? -ne 0 ]; then
echo "Échec du téléchargement de la bibliothèque."
exit 1
fi
fi
Make sure the DB directory exists
if [ ! -d $DB_PATH ]; then
echo "Création du répertoire $DB_PATH..."
sudo mkdir -p $DB_PATH
if [ $? -ne 0 ]; then
echo "Échec de la création du répertoire $DB_PATH."
exit 1
fi
fi
Make sure the unofficial.json file exists
if [ ! -f $UNOFFICIAL_DB ]; then
echo "Création du fichier $UNOFFICIAL_DB..."
sudo touch $UNOFFICIAL_DB
if [ $? -ne 0 ]; then
echo "Échec de la création du fichier $UNOFFICIAL_DB."
exit 1
fi
fi
Configurer le chemin de classe pour inclure la bibliothèque native
export JAVA_LIBRARY_PATH=/usr/local/lib
Vérifiez si la bibliothèque existe
if [ ! -f $JAVA_LIBRARY_PATH/libusb4java.dylib ]; then
echo "La bibliothèque libusb4java.dylib n'existe pas dans $JAVA_LIBRARY_PATH"
exit 1
fi
Vérifiez les permissions USB
echo "Vérification des permissions USB..."
if [ ! -d /dev/cu.* ]; then
echo "Aucun périphérique USB trouvé sous /dev/cu.*."
echo "Veuillez vérifier les périphériques USB connectés et leurs chemins."
exit 1
fi
Modifier les permissions des périphériques USB
echo "Modification des permissions des périphériques USB..."
sudo chmod 666 /dev/cu.*
if [ $? -ne 0 ]; then
echo "Échec de la modification des permissions des périphériques USB."
exit 1
fi
Vérifiez les extensions kernel USB
echo "Vérification des extensions kernel USB..."
kextstat | grep usb
if [ $? -ne 0 ]; then
echo "Les extensions kernel USB nécessaires ne sont pas chargées."
exit 1
fi
Exécuter votre application Java
java -Dfile.encoding=UTF-8 -Dvertx.disableDnsResolver=true
-Djava.library.path=$JAVA_LIBRARY_PATH
-cp $STUDIO_PATH/studio-web-ui-0.5.0.jar:$STUDIO_PATH/lib/*:.
io.vertx.core.Launcher run studio.webui.MainVerticle
`