0

So I'm trying to connect to openEEG upon running the claimInterface() function I get

NetworkError: Unable to claim interface

lsusb shows this problem is likely because some MSI driver is running on the same driver

Output of 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)

I originally tried adding 255 as the classCode on navigator.usb.requestDevice because the documentation said I can do that, but they don't have the same IDs so that was pointless. Also upon reconnecting I can only get lsusb to output of the MSI driver even though Chrome picks it up and I got an access denied error.

which is strange because I changed the udev rules and used sudo chmod -R 777 * In dev/bus/usb

I then found in folder "001" a file that I previously had to manually change the permissions of thinking it was the MSI driver but this time the original file was deleted in place of one named "007" instead of "005" (probably because I tried plugging the device in twice)

So this must be a combination of MSI security features? and OpenEEG creating a new file every time it's loaded?

The only solution I can think of is to delete a file that I don't understand and change the permissions every time it's plugged in. both of which are very prohibitive for uses especially since I want my website to work across a broad range of devices and operating systems

PS: Using Linux Mint if that's relevant and here is my code(I don't think it's the problem) that is being run with on local node.js server

    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'); });
});


  })

EDIT/UPDATE: lsusb returns nothing when not connected the two drivers are coming from the same input???????

4

1 回答 1

0

当您在 USB 端口上连接设备时,Linux 会加载其驱动程序并为自己声明设备。

如果您想在其他地方使用它,只需卸载驱动程序:

$ sudo modprobe -r ftdi_sio

如果您重新启动计算机,驱动程序将再次加载,您必须手动卸载它。如果您想保持卸载,您可以执行以下操作:

$ echo "ftdi_sio" | sudo tee -a /etc/modules

我可以理解为什么它让你感到困惑,考虑到输出lsusb不是那么清楚,但我认为另一个 MSI 驱动程序是用于你计算机上的根 USB 控制器的。如果您删除它,您将无法看到您的端口或连接到它们的任何东西。

如果卸载驱动程序不能解决您的问题,则可能您没有声明正确的设备。如果您在导航栏上书写,您可以通过阅读日志文件了解更多信息chrome://device-log/

于 2019-06-20T18:09:02.090 回答