claimInterface()
だから私は取得した関数を実行する際にopenEEGに接続しようとしています
NetworkError: インターフェイスを要求できません
lsusb は、一部の MSI ドライバーが同じドライバーで実行されているために、この問題が発生する可能性があることを示しています
lsusb -v -s4 の出力
Bus 002 Device 004: ID 1770:ff00
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x1770
idProduct 0xff00
bcdDevice 1.10
iManufacturer 1 MSI EPF USB
iProduct 1 MSI EPF USB
iSerial 1 MSI EPF USB
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 2mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 33 US
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 57
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Status: 0xa630
(Bus Powered)
Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0403 Future Technology Devices International, Ltd
idProduct 0x6001 FT232 USB-Serial (UART) IC
bcdDevice 6.00
iManufacturer 1 FTDI
iProduct 2 FT232R USB UART
iSerial 3 A105XV9J
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 90mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 2 FT232R USB UART
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered)
ドキュメントにそれができると書かれていたので、最初は classCode として 255 を追加しようとしましたnavigator.usb.requestDevice
が、同じ ID を持っていないので無意味でした。また、再接続するとlsusb
、Chrome が MSI ドライバーを取得して access denied error
.
sudo chmod -R 777 *
udevルールを変更してIn を使用したため、これは奇妙ですdev/bus/usb
その後、フォルダー「001」に、以前は MSI ドライバーだと思って手動でアクセス許可を変更しなければならなかったファイルが見つかりましたが、今回は元のファイルが「005」ではなく「007」という名前のファイルの代わりに削除されました (おそらくデバイスを2回接続しようとしました)
では、これは MSI セキュリティ機能の組み合わせである必要がありますか? そしてOpenEEGはロードされるたびに新しいファイルを作成しますか?
私が考えることができる唯一の解決策は、理解できないファイルを削除し、プラグインするたびにアクセス許可を変更することです.特に、Webサイトを幅広いデバイスで動作させたいので、どちらも使用するには非常に禁止されています.およびオペレーティング システム
PS: 関連する場合は Linux Mint を使用してください。ローカル node.js サーバーで実行されている私のコード (問題ではないと思います) を次に示します。
document.addEventListener('DOMContentLoaded', event => {
let button = document.getElementById('connect')
button.addEventListener('click', async() => {
var device
const VENDOR_ID = 0x0403
const PRODUCT_ID = 0x6001
const CLASS_CODE = 255
device = await navigator.usb.requestDevice({
filters: [{
vendorId: VENDOR_ID,
productId: PRODUCT_ID,
classCode: CLASS_CODE
}]
})
console.log('opening..')
await device.open()
console.log('open!')
.then(() => device.selectConfiguration(1))
.then(() => device.claimInterface(0)).catch(error => { console.log(error + 'eeeeeeerrrr ' + device.configuration.interfaces[0].interfaceNumber); });
console.log(device);
await device.close().catch(error => { console.log(error + 'eeeeeeerrrr'); });
});
})
編集/更新:2つのドライバーが同じ入力から来ている接続されていない場合、lsusbは何も返しません???????