Anzeige:
Seite 2 von 2 ErsteErste 12
Ergebnis 16 bis 23 von 23

Thema: USB Bus und Device ID einer Schnittstelle zuordnen

  1. #16
    Banned
    Registriert seit
    Feb 2005
    Beiträge
    1.151
    Ja, schon klar.

    Nur brauche ich für meine Idee EINE Ausgabe ZWEIER Befehle, WENN ALLE angesteckt sind.
    lsusb und ls -Rl /dev | grep -i usb

    NICHT die Ergebnisse von udevadmin.

  2. #17
    Elefantenversteher Avatar von florian0285
    Registriert seit
    Jun 2016
    Beiträge
    1.054
    Du meinst er spricht japanisch? *rofl*
    Denken drücken sprechen....

    Mein Script ist quick&dirty und funktioniert... verbessern... verändern kann er es wie er es möchte... und gerne ein LANG=C einfügen... oder auch keins... na wenn du keine externen prozesse aufrufst? Das schau ich mir jetzt mal entspannt an wie du das ohne externen Prozess löst... hast ja schon mal lsusb & co drin [emoji6] good luck Mr. B. [emoji6]
    Matthäus 7:3 Was siehst du aber den Splitter in deines Bruders Auge, und wirst nicht gewahr des Balkens in deinem Auge?

  3. #18
    Banned
    Registriert seit
    Feb 2005
    Beiträge
    1.151
    @florian0258:
    Zitat Zitat von florian0285 Beitrag anzeigen
    Du meinst er spricht japanisch? *rofl*
    Denken drücken sprechen....
    Nein, und das habe ich nicht gesagt. Es war dazu gedacht, das Problem zu verdeutlichen. Da halt ls nun einmal die locale bei der Ausgabe berücksichtigt, kann die Ausgabe von Sprache zu Sprache erheblich differieren. Wenn man das gleich richtig schreibt (und in Linuxforen KEINE schlampigen Beispiele gibt) vermeidet man solche Fehler. Manche schreiben ein Script, und das wird dann in vielen Niederlassungen vieler Länder eingesetzt. Man kann es gleich richtig machen.

    Mein Script ist quick&dirty und funktioniert... verbessern... verändern kann er es wie er es möchte... und gerne ein LANG=C einfügen... oder auch keins... na wenn du keine externen prozesse aufrufst? Das schau ich mir jetzt mal entspannt an wie du das ohne externen Prozess löst... hast ja schon mal lsusb & co drin [emoji6] good luck Mr. B. [emoji6]
    Ich habe auch nie behauptet, dass man jedes Script ohne externe Prozesse schreiben kann. Diese Dummheit stammt alleine von deinem mutwilligen Mistverstehen.
    In der angegeben Codezeile ist es überflüssiger Unsinn, der noch dazu subtile Fehler enthalten kann. Auch dieses Argument wirst du wohl in dieser Inkarnation nicht mehr verstehen. Es reicht bei dir einfach nicht. Weder an Lernfähigkeit, noch Charakterbildung.
    Ich zitiere mich erneut:
    Ich bitte dich, florian0285, erst meine Argumente zu verstehen, was dauert. Dann sorgfältig zu prüfen. Mit eigenständiger Recherche. Zuerst, ob ich recht haben könnte, dann ob deine Schargumentation (ich habe dieses hübsche Wort gerade extra für dich erfunden) irgendetwas aufwiegen könnte. Und erst dann posten.
    Es macht keinen Sinn mit tiefergelegten Posts und fragwürdigen bewimpelten Signaturen durch die Foren zu brausen.


    Und das war meine letzte Antwort an dich in diesem Thread.
    Threads anderer Leute sind nicht dazu da, unsere Zwistigkeiten auszutragen.
    Bleib also bei der Sache,
    oder halt einfach die Klappe.

  4. #19
    Registrierter Benutzer
    Registriert seit
    Dec 2004
    Beiträge
    212
    Code:
    # lsusb
    
    Bus 001 Device 007: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
    Bus 001 Device 010: ID 058f:6387 Alcor Micro Corp. Flash Drive
    Bus 001 Device 005: ID 046a:b090 Cherry GmbH 
    Bus 001 Device 024: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
    Bus 001 Device 023: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
    Bus 001 Device 013: ID 2109:2812 VIA Labs, Inc. VL812 Hub
    Bus 001 Device 022: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
    Bus 001 Device 021: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
    Bus 001 Device 011: ID 2109:2812 VIA Labs, Inc. VL812 Hub
    Bus 001 Device 020: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
    Bus 001 Device 019: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
    Bus 001 Device 018: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
    Bus 001 Device 006: ID 2109:2812 VIA Labs, Inc. VL812 Hub
    Bus 001 Device 004: ID 2109:2812 VIA Labs, Inc. VL812 Hub
    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
    Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    
    
    
    
    # ls -Rl /dev | grep -i usb 
    
    crw-rw---- 1 root dialout 188,   0 Feb 11 17:28 ttyUSB0
    crw-rw---- 1 root dialout 188,   1 Feb 11 18:29 ttyUSB1
    crw-rw---- 1 root dialout 188,  10 Feb 11 18:29 ttyUSB10
    crw-rw---- 1 root dialout 188,  11 Feb 11 18:29 ttyUSB11
    crw-rw---- 1 root dialout 188,  12 Feb 11 18:29 ttyUSB12
    crw-rw---- 1 root dialout 188,  13 Feb 11 18:29 ttyUSB13
    crw-rw---- 1 root dialout 188,  14 Feb 11 18:29 ttyUSB14
    crw-rw---- 1 root dialout 188,   2 Feb 11 18:29 ttyUSB2
    crw-rw---- 1 root dialout 188,   3 Feb 11 18:29 ttyUSB3
    crw-rw---- 1 root dialout 188,   4 Feb 11 18:29 ttyUSB4
    crw-rw---- 1 root dialout 188,   5 Feb 11 18:29 ttyUSB5
    crw-rw---- 1 root dialout 188,   6 Feb 11 18:29 ttyUSB6
    crw-rw---- 1 root dialout 188,   7 Feb 11 18:29 ttyUSB7
    crw-rw---- 1 root dialout 188,   8 Feb 11 18:29 ttyUSB8
    crw-rw---- 1 root dialout 188,   9 Feb 11 18:29 ttyUSB9
    drwxr-xr-x 2 root root          60 Jan  1  1970 usb
    drwxr-xr-x 3 root root 60 Jan  1  1970 usb
    /dev/bus/usb:
    /dev/bus/usb/001:
    lrwxrwxrwx 1 root root 14 Feb 11 17:28 180:0 -> ../usb/hiddev0
    lrwxrwxrwx 1 root root 10 Feb 11 17:28 188:0 -> ../ttyUSB0
    lrwxrwxrwx 1 root root 10 Feb 11 18:29 188:1 -> ../ttyUSB1
    lrwxrwxrwx 1 root root 11 Feb 11 18:29 188:10 -> ../ttyUSB10
    lrwxrwxrwx 1 root root 11 Feb 11 18:29 188:11 -> ../ttyUSB11
    lrwxrwxrwx 1 root root 11 Feb 11 18:29 188:12 -> ../ttyUSB12
    lrwxrwxrwx 1 root root 11 Feb 11 18:29 188:13 -> ../ttyUSB13
    lrwxrwxrwx 1 root root 11 Feb 11 18:29 188:14 -> ../ttyUSB14
    lrwxrwxrwx 1 root root 10 Feb 11 18:29 188:2 -> ../ttyUSB2
    lrwxrwxrwx 1 root root 10 Feb 11 18:29 188:3 -> ../ttyUSB3
    lrwxrwxrwx 1 root root 10 Feb 11 18:29 188:4 -> ../ttyUSB4
    lrwxrwxrwx 1 root root 10 Feb 11 18:29 188:5 -> ../ttyUSB5
    lrwxrwxrwx 1 root root 10 Feb 11 18:29 188:6 -> ../ttyUSB6
    lrwxrwxrwx 1 root root 10 Feb 11 18:29 188:7 -> ../ttyUSB7
    lrwxrwxrwx 1 root root 10 Feb 11 18:29 188:8 -> ../ttyUSB8
    lrwxrwxrwx 1 root root 10 Feb 11 18:29 188:9 -> ../ttyUSB9
    lrwxrwxrwx 1 root root 18 Feb 11 17:28 189:0 -> ../bus/usb/001/001
    lrwxrwxrwx 1 root root 18 Feb 11 17:28 189:1 -> ../bus/usb/001/002
    lrwxrwxrwx 1 root root 18 Feb 11 17:28 189:10 -> ../bus/usb/001/011
    lrwxrwxrwx 1 root root 18 Feb 11 17:28 189:12 -> ../bus/usb/001/013
    lrwxrwxrwx 1 root root 18 Feb 11 18:29 189:17 -> ../bus/usb/001/018
    lrwxrwxrwx 1 root root 18 Feb 11 18:29 189:18 -> ../bus/usb/001/019
    lrwxrwxrwx 1 root root 18 Feb 11 18:29 189:19 -> ../bus/usb/001/020
    lrwxrwxrwx 1 root root 18 Feb 11 17:28 189:2 -> ../bus/usb/001/003
    lrwxrwxrwx 1 root root 18 Feb 11 18:29 189:20 -> ../bus/usb/001/021
    lrwxrwxrwx 1 root root 18 Feb 11 18:29 189:21 -> ../bus/usb/001/022
    lrwxrwxrwx 1 root root 18 Feb 11 18:29 189:22 -> ../bus/usb/001/023
    lrwxrwxrwx 1 root root 18 Feb 11 18:29 189:23 -> ../bus/usb/001/024
    lrwxrwxrwx 1 root root 18 Feb 11 17:28 189:3 -> ../bus/usb/001/004
    lrwxrwxrwx 1 root root 18 Feb 11 17:28 189:4 -> ../bus/usb/001/005
    lrwxrwxrwx 1 root root 18 Feb 11 17:28 189:5 -> ../bus/usb/001/006
    lrwxrwxrwx 1 root root 18 Feb 11 17:28 189:6 -> ../bus/usb/001/007
    lrwxrwxrwx 1 root root 18 Feb 11 17:28 189:9 -> ../bus/usb/001/010
    lrwxrwxrwx 1 root root  9 Feb 11 17:28 usb-Generic_Flash_Disk_F51D96F9-0:0 -> ../../sdc
    lrwxrwxrwx 1 root root 10 Feb 11 17:28 usb-Generic_Flash_Disk_F51D96F9-0:0-part1 -> ../../sdc1
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 usb-HUAWEI_Mass_Storage-0:0 -> ../../sr6
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 usb-HUAWEI_TF_CARD_Storage-0:0 -> ../../sdh
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.1.1:1.3-scsi-0:0:0:0 -> ../../sr0
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.1.1:1.4-scsi-0:0:0:0 -> ../../sda
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.1.3:1.3-scsi-0:0:0:0 -> ../../sr1
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.1.3:1.4-scsi-0:0:0:0 -> ../../sdb
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.2:1.3-scsi-0:0:0:0 -> ../../sr2
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.2:1.4-scsi-0:0:0:0 -> ../../sdd
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.3.1:1.3-scsi-0:0:0:0 -> ../../sr3
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.3.1:1.4-scsi-0:0:0:0 -> ../../sde
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.3.4:1.3-scsi-0:0:0:0 -> ../../sr4
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.3.4:1.4-scsi-0:0:0:0 -> ../../sdf
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.4.2:1.3-scsi-0:0:0:0 -> ../../sr5
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.4.2:1.4-scsi-0:0:0:0 -> ../../sdg
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.4.3:1.3-scsi-0:0:0:0 -> ../../sr6
    lrwxrwxrwx 1 root root  9 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.4.3:1.4-scsi-0:0:0:0 -> ../../sdh
    lrwxrwxrwx 1 root root  9 Feb 11 17:28 platform-3f980000.usb-usb-0:1.4:1.0-scsi-0:0:0:0 -> ../../sdc
    lrwxrwxrwx 1 root root 10 Feb 11 17:28 platform-3f980000.usb-usb-0:1.4:1.0-scsi-0:0:0:0-part1 -> ../../sdc1
    lrwxrwxrwx 1 root root 9 Feb 11 17:28 usb-Cherry_USB_keyboard-event-if01 -> ../event1
    lrwxrwxrwx 1 root root 9 Feb 11 17:28 usb-Cherry_USB_keyboard-event-kbd -> ../event0
    lrwxrwxrwx 1 root root 9 Feb 11 17:28 platform-3f980000.usb-usb-0:1.3:1.0-event-kbd -> ../event0
    lrwxrwxrwx 1 root root 9 Feb 11 17:28 platform-3f980000.usb-usb-0:1.3:1.1-event -> ../event1
    lrwxrwxrwx 1 root root 14 Feb 11 18:29 usb-HUAWEI_Technology_HUAWEI_Mobile-if00-port0 -> ../../ttyUSB13
    lrwxrwxrwx 1 root root 14 Feb 11 18:29 usb-HUAWEI_Technology_HUAWEI_Mobile-if01-port0 -> ../../ttyUSB14
    lrwxrwxrwx 1 root root 13 Feb 11 17:28 usb-Prolific_Technology_Inc._USB-Serial_Controller_D-if00-port0 -> ../../ttyUSB0
    lrwxrwxrwx 1 root root 13 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.1.1:1.0-port0 -> ../../ttyUSB1
    lrwxrwxrwx 1 root root 13 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.1.1:1.1-port0 -> ../../ttyUSB2
    lrwxrwxrwx 1 root root 13 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.1.3:1.0-port0 -> ../../ttyUSB3
    lrwxrwxrwx 1 root root 13 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.1.3:1.1-port0 -> ../../ttyUSB4
    lrwxrwxrwx 1 root root 13 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.2:1.0-port0 -> ../../ttyUSB5
    lrwxrwxrwx 1 root root 13 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.2:1.1-port0 -> ../../ttyUSB6
    lrwxrwxrwx 1 root root 13 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.3.1:1.0-port0 -> ../../ttyUSB7
    lrwxrwxrwx 1 root root 13 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.3.1:1.1-port0 -> ../../ttyUSB8
    lrwxrwxrwx 1 root root 13 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.3.4:1.0-port0 -> ../../ttyUSB9
    lrwxrwxrwx 1 root root 14 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.3.4:1.1-port0 -> ../../ttyUSB10
    lrwxrwxrwx 1 root root 14 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.4.2:1.0-port0 -> ../../ttyUSB11
    lrwxrwxrwx 1 root root 14 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.4.2:1.1-port0 -> ../../ttyUSB12
    lrwxrwxrwx 1 root root 14 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.4.3:1.0-port0 -> ../../ttyUSB13
    lrwxrwxrwx 1 root root 14 Feb 11 18:29 platform-3f980000.usb-usb-0:1.2.4.3:1.1-port0 -> ../../ttyUSB14
    lrwxrwxrwx 1 root root 13 Feb 11 17:28 platform-3f980000.usb-usb-0:1.5:1.0-port0 -> ../../ttyUSB0
    /dev/usb:

  5. #20
    Registrierter Benutzer
    Registriert seit
    Dec 2004
    Beiträge
    212
    Auch Interessant: (Ich glaube, ich komme der Lösung näher)
    Code:
    # lsusb -t
    /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
        |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
            |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
            |__ Port 2: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
                |__ Port 1: Dev 6, If 0, Class=Hub, Driver=hub/4p, 480M
                    |__ Port 1: Dev 18, If 0, Class=Vendor Specific Class, Driver=option, 480M
                    |__ Port 1: Dev 18, If 1, Class=Vendor Specific Class, Driver=option, 480M
                    |__ Port 1: Dev 18, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
                    |__ Port 1: Dev 18, If 3, Class=Mass Storage, Driver=usb-storage, 480M
                    |__ Port 1: Dev 18, If 4, Class=Mass Storage, Driver=usb-storage, 480M
                    |__ Port 3: Dev 19, If 0, Class=Vendor Specific Class, Driver=option, 480M
                    |__ Port 3: Dev 19, If 1, Class=Vendor Specific Class, Driver=option, 480M
                    |__ Port 3: Dev 19, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
                    |__ Port 3: Dev 19, If 3, Class=Mass Storage, Driver=usb-storage, 480M
                    |__ Port 3: Dev 19, If 4, Class=Mass Storage, Driver=usb-storage, 480M
                |__ Port 2: Dev 20, If 0, Class=Vendor Specific Class, Driver=option, 480M
                |__ Port 2: Dev 20, If 1, Class=Vendor Specific Class, Driver=option, 480M
                |__ Port 2: Dev 20, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
                |__ Port 2: Dev 20, If 3, Class=Mass Storage, Driver=usb-storage, 480M
                |__ Port 2: Dev 20, If 4, Class=Mass Storage, Driver=usb-storage, 480M
                |__ Port 3: Dev 11, If 0, Class=Hub, Driver=hub/4p, 480M
                    |__ Port 1: Dev 21, If 0, Class=Vendor Specific Class, Driver=option, 480M
                    |__ Port 1: Dev 21, If 1, Class=Vendor Specific Class, Driver=option, 480M
                    |__ Port 1: Dev 21, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
                    |__ Port 1: Dev 21, If 3, Class=Mass Storage, Driver=usb-storage, 480M
                    |__ Port 1: Dev 21, If 4, Class=Mass Storage, Driver=usb-storage, 480M
                    |__ Port 4: Dev 22, If 0, Class=Vendor Specific Class, Driver=option, 480M
                    |__ Port 4: Dev 22, If 1, Class=Vendor Specific Class, Driver=option, 480M
                    |__ Port 4: Dev 22, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
                    |__ Port 4: Dev 22, If 3, Class=Mass Storage, Driver=usb-storage, 480M
                    |__ Port 4: Dev 22, If 4, Class=Mass Storage, Driver=usb-storage, 480M
                |__ Port 4: Dev 13, If 0, Class=Hub, Driver=hub/4p, 480M
                    |__ Port 2: Dev 23, If 0, Class=Vendor Specific Class, Driver=option, 480M
                    |__ Port 2: Dev 23, If 1, Class=Vendor Specific Class, Driver=option, 480M
                    |__ Port 2: Dev 23, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
                    |__ Port 2: Dev 23, If 3, Class=Mass Storage, Driver=usb-storage, 480M
                    |__ Port 2: Dev 23, If 4, Class=Mass Storage, Driver=usb-storage, 480M
                    |__ Port 3: Dev 24, If 0, Class=Vendor Specific Class, Driver=option, 480M
                    |__ Port 3: Dev 24, If 1, Class=Vendor Specific Class, Driver=option, 480M
                    |__ Port 3: Dev 24, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
                    |__ Port 3: Dev 24, If 3, Class=Mass Storage, Driver=usb-storage, 480M
                    |__ Port 3: Dev 24, If 4, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 3: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
            |__ Port 3: Dev 5, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
            |__ Port 4: Dev 10, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 5: Dev 7, If 0, Class=Vendor Specific Class, Driver=pl2303, 12M

  6. #21
    Registrierter Benutzer
    Registriert seit
    Dec 2004
    Beiträge
    212
    Ich denke ich habe den Zusammenhang erkannt:
    Code:
    1.2.1.1:1.0-port0 -> ../../ttyUSB1
    1.2.1.1:1.1-port0 -> ../../ttyUSB2
    1.2.1.3:1.0-port0 -> ../../ttyUSB3
    1.2.1.3:1.1-port0 -> ../../ttyUSB4
    1.2.2:1.0-port0 -> ../../ttyUSB5
    1.2.2:1.1-port0 -> ../../ttyUSB6
    1.2.3.1:1.0-port0 -> ../../ttyUSB7
    1.2.3.1:1.1-port0 -> ../../ttyUSB8
    1.2.3.4:1.0-port0 -> ../../ttyUSB9
    1.2.3.4:1.1-port0 -> ../../ttyUSB10
    1.2.4.2:1.0-port0 -> ../../ttyUSB11
    1.2.4.2:1.1-port0 -> ../../ttyUSB12
    1.2.4.3:1.0-port0 -> ../../ttyUSB13
    1.2.4.3:1.1-port0 -> ../../ttyUSB14
    
    
                   /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    1                 |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
    1.1                  |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
    1.2                  |__ Port 2: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
    1.2.1                   |__ Port 1: Dev 6, If 0, Class=Hub, Driver=hub/4p, 480M
    1.2.1.1  ttyUSB1              |__ Port 1: Dev 18, If 0, Class=Vendor Specific Class, Driver=option, 480M
    1.2.1.1  ttyUSB2              |__ Port 1: Dev 18, If 1, Class=Vendor Specific Class, Driver=option, 480M
    1.2.1.1                       |__ Port 1: Dev 18, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
    1.2.1.1                       |__ Port 1: Dev 18, If 3, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.1.1                       |__ Port 1: Dev 18, If 4, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.1.3  ttyUSB3              |__ Port 3: Dev 19, If 0, Class=Vendor Specific Class, Driver=option, 480M
    1.2.1.3  ttyUSB4              |__ Port 3: Dev 19, If 1, Class=Vendor Specific Class, Driver=option, 480M
    1.2.1.3                       |__ Port 3: Dev 19, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
    1.2.1.3                       |__ Port 3: Dev 19, If 3, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.1.3                       |__ Port 3: Dev 19, If 4, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.2                   |__ Port 2: Dev 20, If 0, Class=Vendor Specific Class, Driver=option, 480M
    1.2.2                   |__ Port 2: Dev 20, If 1, Class=Vendor Specific Class, Driver=option, 480M
    1.2.2                   |__ Port 2: Dev 20, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
    1.2.2                   |__ Port 2: Dev 20, If 3, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.2                   |__ Port 2: Dev 20, If 4, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.3                   |__ Port 3: Dev 11, If 0, Class=Hub, Driver=hub/4p, 480M
    1.2.3.1  ttyUSB7              |__ Port 1: Dev 21, If 0, Class=Vendor Specific Class, Driver=option, 480M
    1.2.3.1  ttyUSB8              |__ Port 1: Dev 21, If 1, Class=Vendor Specific Class, Driver=option, 480M
    1.2.3.1                       |__ Port 1: Dev 21, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
    1.2.3.1                       |__ Port 1: Dev 21, If 3, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.3.1                       |__ Port 1: Dev 21, If 4, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.3.4  ttyUSB9              |__ Port 4: Dev 22, If 0, Class=Vendor Specific Class, Driver=option, 480M
    1.2.3.4  ttyUSB10             |__ Port 4: Dev 22, If 1, Class=Vendor Specific Class, Driver=option, 480M
    1.2.3.4                       |__ Port 4: Dev 22, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
    1.2.3.4                       |__ Port 4: Dev 22, If 3, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.3.4                       |__ Port 4: Dev 22, If 4, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.4                   |__ Port 4: Dev 13, If 0, Class=Hub, Driver=hub/4p, 480M
    1.2.4.2  ttyUSB11             |__ Port 2: Dev 23, If 0, Class=Vendor Specific Class, Driver=option, 480M
    1.2.4.2  ttyUSB12             |__ Port 2: Dev 23, If 1, Class=Vendor Specific Class, Driver=option, 480M
    1.2.4.2                       |__ Port 2: Dev 23, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
    1.2.4.2                       |__ Port 2: Dev 23, If 3, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.4.2                       |__ Port 2: Dev 23, If 4, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.4.3  ttyUSB13             |__ Port 3: Dev 24, If 0, Class=Vendor Specific Class, Driver=option, 480M
    1.2.4.3  ttyUSB14             |__ Port 3: Dev 24, If 1, Class=Vendor Specific Class, Driver=option, 480M
    1.2.4.3                       |__ Port 3: Dev 24, If 2, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M
    1.2.4.3                       |__ Port 3: Dev 24, If 3, Class=Mass Storage, Driver=usb-storage, 480M
    1.2.4.3                       |__ Port 3: Dev 24, If 4, Class=Mass Storage, Driver=usb-storage, 480M
    1.3                  |__ Port 3: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
    1.3                  |__ Port 3: Dev 5, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
    1.4                  |__ Port 4: Dev 10, If 0, Class=Mass Storage, Driver=usb-storage, 480M
    1.5                  |__ Port 5: Dev 7, If 0, Class=Vendor Specific Class, Driver=pl2303, 12M

  7. #22
    Registrierter Benutzer
    Registriert seit
    Dec 2004
    Beiträge
    212
    Und so gehts - Beispiel: Was hat Bus 001/Device 018 für ttyUSB-Schnittstellen?

    Code:
              | # lsusb -t
    1-?       | /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    1-1       |    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
    1-1.1     |       |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
    1-1.2     |       |__ Port 2: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
    1-1.2.1   |             |__ Port 1: Dev 6, If 0, Class=Hub, Driver=hub/4p, 480M
    1-1.2.1.1 |                |__ Port 1: Dev 18, If 0, Class=Vendor Specific Class, Driver=option, 480M
    1-1.2.1.1 |                |__ Port 1: Dev 18, If 1, Class=Vendor Specific Class, Driver=option, 480M
    Bus 001/Device 018 hat die Adresse 1-1.2.1.1.

    Code:
    # find /sys/bus/usb/devices/usb*/ -name dev|grep '/1-1.2.1.1/' | grep ttyUSB
    
    /sys/bus/usb/devices/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1.1/1-1.2.1.1:1.0/ttyUSB1/tty/ttyUSB1/dev
    /sys/bus/usb/devices/usb1/1-1/1-1.2/1-1.2.1/1-1.2.1.1/1-1.2.1.1:1.1/ttyUSB2/tty/ttyUSB2/dev
    Bus 001/Device 018 ist auf /dev/ttyUSB1 und /dev/ttyUSB2 verfügbar.

    Jetzt muss das ganze noch in ein Skript gegossen werden.
    Ich hoffe ich bekommes mit Shell-Skript hin.

    Wenn ich so weit bin, poste ich es.

  8. #23
    Registrierter Benutzer
    Registriert seit
    Dec 2004
    Beiträge
    212
    Ich hab es hinbekommen.
    Es ist wahrscheinlich das unperformanteste Skript, dass ihr je gesehen habt, ABER es funktioniert.
    Für Verbesserungsvorschläge bin ich immer offen:
    Code:
    #!/bin/bash
    
    busno=""
    portaddr=()
    while IFS= read -r line; do
       if [ "$busno" == "" ]
         then
            # checking the BUS-Number and detecting indent wspcs for each level
            indentcnt=$(echo -n "$line" | sed 's/Bus.*//' | wc -c )
            busno=$(echo -n $line | sed 's/\..*/ /' | sed 's/.*Bus//')
            let ' busno += 0 '
            ########
         else
            level=$(echo -n "$line" | sed 's/|.*//' | wc -c )
            let ' level /= indentcnt '
            
            # Current Port Addres in var $addr
            current_portno=$(echo -n "$line"| sed 's/.*Port//'|sed 's/:.*//')
            let ' current_portno += 0 '
            portaddr[$level]=$current_portno
            unset portaddr[$level+1]
            sep="-"
            addr=$busno
            for i in "${portaddr[@]}"
            do
               addr="$addr$sep$i"
               sep="."
            done
            ########
            
            # Getting Dev Number
            devno=$(echo -n "$line" | sed 's/.*Dev//' | sed 's/,.*//')
            let ' devno += 0 '
            ########
            
            ttys=$(find /sys/bus/usb/devices/usb*/ -name dev|grep "/$addr:" |
                    grep ttyUSB |
                    sed 's/.*tty\///' | sed 's/\/dev*//'
                  )
            
            echo "Bus $busno Device $devno -> $addr"
            echo $ttys
            echo ""
       fi
    done < <(  lsusb -t )

Ähnliche Themen

  1. ETHx einer MAC zuordnen
    Von riedochs im Forum System installieren und konfigurieren
    Antworten: 4
    Letzter Beitrag: 16.02.10, 08:09
  2. soundkarte einem device zuordnen
    Von pita im Forum Musik
    Antworten: 4
    Letzter Beitrag: 16.02.08, 20:10
  3. USB Device fix zuordnen
    Von Die Borg im Forum stationäre Hardware
    Antworten: 4
    Letzter Beitrag: 02.11.05, 15:10
  4. usb geräten festes device zuordnen
    Von golddachs im Forum stationäre Hardware
    Antworten: 8
    Letzter Beitrag: 29.07.05, 14:58
  5. route einem device zuordnen ... aber wie???
    Von funzel im Forum Anbindung an die Aussenwelt
    Antworten: 3
    Letzter Beitrag: 29.10.02, 10:19

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •