-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
K40NanoDriver: LibUsbException: USB error 6: Could not claim the interface.: Resource busy #172
Comments
As discussed here t-oster/VisiCut#605 (comment) , So the problem is that VisiCut does not detach the USB driver of the CH341 device. @tatarize Could you maybe have a look? Or someone else who has access to such a lasercutter? |
Okay, cloned a fresh repo. Ran it.
Trying again, running netbeans as Administrator. Apparently not good enough I need to run Visicut directly as administrator. -- Loading files suddenly broke. In Raspberry pi, I believe there might be an issue with the order of operations a deep dive by a contributor in the MeerK40t project had the order there shifted a bit. As for windows I might have to figure out he proper method for DLL calls (to code a secondary default windows driver using the CH341DLL) because the need to run in admin mode is really really annoying. |
Attempted again, after uninstalling and reinstalling viscut. Gave another insufficient permission error, even from root. I ran it successfully during testing. Not sure if anything changed or if it's just being weird. Orderwise:
For some linux installs:
Depending on things it might need the rule to permit you to access the K40. You can test this if it works with sudo visicut and works. |
It sounds like the "access denied" is a separate issue that will also affect any other lasercutting program (as far as it uses libusb). Also discussed in Regarding "Loading files suddenly broke": Opening SVG files works for me, so can you please create an issue with more details (which file, which OS)? |
Even with windows being weird raspberry pi should work, but sometimes the permission error is actually a permission error and the OS doesn't have access. If sudo fixes it, then it's actually permission. My error recovered after reinstall. I think it was an old config file or something and didn't give me a highly specific error. The access thing is a bit weird. Python code doesn't have that requirement. If I could call a little python script I could run this stuff without hitting any permissions issues. Though rPi would still need a rule (or sudo) to access the USB, as posted above. But, windows is fine with access without any USB snafus, for Python but not for Java. I could add in lhyserver devices, where they accept TCP data and just send it over the USB to the device. Though this might be a somewhat rare construction. And it seems like it would need to be compiled or run in a venv or stored in the drivers or stored as a frozen .exe (which is even less desirable). The network capabilities are desirable enough. Rig up a raspberry pi zero and control the M2 Nano by just TCP sending data to that server. Though asking that folks use a second program to get the first program to work isn't very helpful. |
Discussed in t-oster/VisiCut#605
Originally posted by papapingouin-be April 21, 2021
Hello,
I use visicut with my K40 lasercutter on a raspberry pi3b from 1year and all is ok but after updates i have this message and i can't rollback
...
pi@raspberrypi:~ $ visicut
openjdk version "11.0.9.1" 2020-11-04
...
org.usb4java.LibUsbException: USB error 6: Could not claim the interface.: Resource busy
at de.thomas_oster.liblasercut.drivers.K40NanoDriver$K40Usb.claimInterface(K40NanoDriver.java:1762)
at de.thomas_oster.liblasercut.drivers.K40NanoDriver$K40Usb.open(K40NanoDriver.java:1433)
at de.thomas_oster.liblasercut.drivers.K40NanoDriver$K40Queue.open(K40NanoDriver.java:1272)
at de.thomas_oster.liblasercut.drivers.K40NanoDriver$K40Device.open(K40NanoDriver.java:469)
at de.thomas_oster.liblasercut.drivers.K40NanoDriver$K40Device.open(K40NanoDriver.java:463)
at de.thomas_oster.liblasercut.drivers.K40NanoDriver.sendJob(K40NanoDriver.java:109)
at de.thomas_oster.visicut.VisicutModel.sendJob(VisicutModel.java:778)
at de.thomas_oster.visicut.gui.MainView.lambda$executeOrSaveJob$7(MainView.java:2209)
at java.base/java.lang.Thread.run(Thread.java:834)
org.usb4java.LibUsbException: USB error 6: Could not claim the interface.: Resource busy
at de.thomas_oster.liblasercut.drivers.K40NanoDriver$K40Usb.claimInterface(K40NanoDriver.java:1762)
at de.thomas_oster.liblasercut.drivers.K40NanoDriver$K40Usb.open(K40NanoDriver.java:1433)
at de.thomas_oster.liblasercut.drivers.K40NanoDriver$K40Queue.open(K40NanoDriver.java:1272)
at de.thomas_oster.liblasercut.drivers.K40NanoDriver$K40Device.open(K40NanoDriver.java:469)
at de.thomas_oster.liblasercut.drivers.K40NanoDriver$K40Device.open(K40NanoDriver.java:463)
at de.thomas_oster.liblasercut.drivers.K40NanoDriver.sendJob(K40NanoDriver.java:109)
at de.thomas_oster.visicut.VisicutModel.sendJob(VisicutModel.java:778)
at de.thomas_oster.visicut.gui.MainView.lambda$executeOrSaveJob$7(MainView.java:2209)
at java.base/java.lang.Thread.run(Thread.java:834)
root@raspberrypi:/home/pi# lsusb
Bus 001 Device 004: ID 1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter
Bus 001 Device 005: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Thanks for your help
Laurent
The text was updated successfully, but these errors were encountered: