Finden Sie heraus, wo das USB 3.0-Gerät angeschlossen ist

Finden Sie heraus, wo das USB 3.0-Gerät angeschlossen ist

Ich möchte einen seriellen Eingang lesen (wie zum Beispiel hier) in der Linux-Befehlszeile, aber ich kann den Pfad des angeschlossenen Geräts (Arduino) nicht herausfinden.

Ich kann das Gerät identifizieren:

# lsusb
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 003: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)  <- this one
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

aber dmesg zeigt nur diese Meldung an

# dmesg | grep usb
[15026545.556311] usb 4-1: new full-speed USB device number 3 using xhci-hcd
[15026545.697929] usb 4-1: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes

was mich auch verwirrt, ist, dass lspci dieses Gerät nicht anzeigt:

# lspci
00:01.0 PCI bridge: Marvell Technology Group Ltd. Device 6820 (rev 04)
00:02.0 PCI bridge: Marvell Technology Group Ltd. Device 6820 (rev 04)
00:03.0 PCI bridge: Marvell Technology Group Ltd. Device 6820 (rev 04)
01:00.0 Network controller: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express) (rev 01)
02:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter

Durchsuchen des /dev-Verzeichnisses:

# ls /dev/
autofs              kmsg                network_latency     ram4                ttyS12
btrfs-control       log                 network_throughput  ram5                ttyS13
bus                 mapper              null                ram6                ttyS14
console             mem                 port                ram7                ttyS15
cpu_dma_latency     memory_bandwidth    ppp                 ram8                ttyS2
full                mmcblk0             ptmx                ram9                ttyS3
fuse                mmcblk0boot0        pts                 random              ttyS4
hwrng               mmcblk0boot1        ram0                root                ttyS5
i2c-0               mmcblk0p1           ram1                rtc0                ttyS6
i2c-1               mmcblk0rpmb         ram10               shm                 ttyS7
i2c-2               mtd0                ram11               snd                 ttyS8
i2c-3               mtd0ro              ram12               spidev0.2           ttyS9
i2c-4               mtd1                ram13               tty                 ubi_ctrl
i2c-5               mtd1ro              ram14               ttyS0               urandom
i2c-6               mtdblock0           ram15               ttyS1               watchdog
i2c-7               mtdblock1           ram2                ttyS10              watchdog0
i2c-8               net                 ram3                ttyS11              zero

Ich kann folgende Dinge herausfinden:

  1. kein ttyUSB*/ttyACM*-Pfad erstellt
  2. der Pfad zum Gerät lautet /dev/bus/usb/004/003
  3. es ist USB 3.0, das xhci-hcd verwenden sollte

Es gibt noch eine weitere Ausgabe, die mich noch mehr verwirrt (die iProduct-Zeile mit der Meldung 2 (Fehler)):

# lsusb -v -s 004:003

Bus 004 Device 003: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            2 Communications
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x2341 Arduino SA
  idProduct          0x0043 Uno R3 (CDC ACM)
  bcdDevice            0.01
  iManufacturer           1 Arduino (www.arduino.cc)
  iProduct                2 (error)
  iSerial               220 8553130343135121F1A0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           62
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              0
      CDC Header:
        bcdCDC               10.01
      CDC ACM:
        bmCapabilities       0x06
          sends break
          line coding and serial state
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval             255
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)

Ist das ein Zeichen dafür, dass das Gerät in dieser Umgebung nicht richtig funktioniert? Können Sie mir helfen, herauszufinden, wie ich die an dieses Gerät angeschlossene Adresse finden kann?

Hintergrundinfo: Das System, das ich hier verwende, ist TurrisOS (basierend auf OpenWrt). Habe auch Debian/Mint/Ubuntu/Manjaro getestet und alle diese lassen sich problemlos an den USB-Stick anschließen (das Gerät selbst ist nicht beschädigt).

BEARBEITEN: dies ist die dmesg-bezogene Ausgabe, wenn USB-Seriell-Treiber installiert sind:

[15707335.904584] usbserial: USB Serial support registered for carelink
[15707335.904622] usbserial: USB Serial support registered for zio
[15707335.904657] usbserial: USB Serial support registered for funsoft
[15707335.904686] usbserial: USB Serial support registered for flashloader
[15707335.904714] usbserial: USB Serial support registered for google
[15707335.904743] usbserial: USB Serial support registered for libtransistor
[15707335.904771] usbserial: USB Serial support registered for vivopay
[15707335.904802] usbserial: USB Serial support registered for moto_modem
[15707335.904832] usbserial: USB Serial support registered for motorola_tetra
[15707335.904863] usbserial: USB Serial support registered for novatel_gps
[15707335.904891] usbserial: USB Serial support registered for hp4x
[15707335.904917] usbserial: USB Serial support registered for suunto
[15707335.904944] usbserial: USB Serial support registered for siemens_mpi
[15707336.867539] usbcore: registered new interface driver ti_usb_3410_5052
[15707336.867582] usbserial: USB Serial support registered for TI USB 3410 1 port adapter
[15707336.867611] usbserial: USB Serial support registered for TI USB 5052 2 port adapter
[15721145.188760] usb 4-1: new full-speed USB device number 4 using xhci-hcd
[15721145.330360] usb 4-1: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes

BEARBEITEN 2: Als ich gegoogelt habe, fand ich diesSkriptin dem klar und deutlich behauptet wird, dass ich Folgendes tun muss:

opkg install kmod-usb-acm

um diese Geräte anzuschließen.

Antwort1

Sie benötigen die Kernelmodule, die den Arduino erkennen und das serielle Portgerät automatisch erstellen.

Laut der OpenWrt-Dokumentation:Verbinden Sie einen Arduino mit OpenWrt:

Bitte installieren Sie die folgenden Pakete (mit „opkg install“, wenn Sie ein Terminal verwenden, oder mit der LuCi Software-Seite)

kmod-USB-Seriell kmod-USB-Seriell-ark3116 kmod-USB-Seriell-Belkin kmod-USB-Seriell-ch341 kmod-USB-Seriell-cp210x kmod-USB-Seriell-ftdi kmod-USB-Seriell-mct kmod-USB-Seriell-mos7720 kmod-USB-Seriell-oti6858 kmod-USB-Seriell-pl2303 kmod-USB-Seriell-einfach kmod-USB-Seriell-ti-usb

In der Praxis werden Sie wahrscheinlich nur einen davon benötigen, wenn Sie den USB-zu-Seriell-Chip identifizieren können, der in Ihrem Arduino (oder Klon) verwendet wird. Sie benötigen ohnehin nicht viel Platz, wenn Sie also unsicher oder faul sind, können Sie einfach alle installieren.

Wie in den Kommentaren angegeben, müssen Sie dieser Liste möglicherweise auch Folgendes hinzufügen kmod-usb-acm.

verwandte Informationen