I want to connect to printer and print barcodes from node using usb lib, but I get this error - Error: claimInterface error: Error: LIBUSB_ERROR_BUSY. I tried to use web/no web usb device - the same error. If I ask him isKernalDriverActive() he tells false, but libusb say it is busy! I don't know.
Before this error I was getting LIBUSB_ERROR_ACCESS and I solve it like thistext
If I use deviceInterface.detachKernelDriver()
and then eviceInterface.attachKernelDriver()
it throws another error - LIBUSB_ERROR_NOT_FOUND.
I use Ubuntu 22.04.4 LTS
const usb = require('usb');(async () => { const device = usb.findByIds(0x232b, 0x5e20); const webDevice = await usb.WebUSBDevice.createInstance(device); if (webDevice) { console.log(webDevice); // WebUSB device } await webDevice.open(); await webDevice.selectConfiguration(1); await webDevice.claimInterface(0)})();
From terminal command 'lsusb' I get
Bus 002 Device 002: ID 174c:3074 ASMedia Technology Inc. ASM1074 SuperSpeed hubBus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hubBus 001 Device 004: ID 174c:2074 ASMedia Technology Inc. ASM1074 High-Speed hubBus 001 Device 005: ID 320f:5055 Evision RGB KeyboardBus 001 Device 003: ID 058f:6254 Alcor Micro Corp. USB HubBus 001 Device 013: ID 232b:5e20 Pantum Ltd. M6550NW seriesBus 001 Device 002: ID 1ea7:0064 SHARKOON Technologies GmbH 2.4GHz Wireless rechargeable vertical mouse [More&Better]Bus 001 Device 007: ID 8087:0026 Intel Corp. AX201 BluetoothBus 001 Device 006: ID 0b05:19af ASUSTek Computer, Inc. AURA LED ControllerBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub