Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Raspberry Pi Zero als USB Gadget - Pi and more 10.5

Raspberry Pi Zero als USB Gadget - Pi and more 10.5

Standby Vortrag
Pi and more 10.5 - Uni Stuttgart - 24.02.2018

Der Raspberry Pi Zero bietet unter Raspbian die Möglichkeit über den USB-OTG-Port verschiedene USB-Geräte zu emulieren.

Der Vortrag erläutert wie verschiedene virtuelle USB-Geräte konfiguriert werden und welche Möglichkeiten diese Vorgehensweise bietet. Auf diese Weise kann man zum Beispiel den Pi Zero ohne weiteres Zubehör (nur SDCard und microUSB-Kabel nötig) in Betrieb nehmen und auf ihn zugreifen.

Neue und überarbeitete Version von "Virtuelle USB-Geräte mit dem Raspberry Pi Zero"

Andreas Zilly

February 24, 2018
Tweet

More Decks by Andreas Zilly

Other Decks in Programming

Transcript

  1. Raspberry Pi Zero als USB Gadget Pi and more 10.5

    24.02.2018 Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018 Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018 Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018 Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018 Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018 Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018 RASPBERRY PI ZERO ALS USB GADGET RASPBERRY PI ZERO ALS USB GADGET ANDREAS ZILLY ANDREAS ZILLY Pi and more 10.5 24.02.2018 Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 1
  2. ANDREAS ZILLY ANDREAS ZILLY  @AndreasZilly  www.github.com/azilly-de  blog.andreas-zilly.info

    Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 2
  3. AGENDA AGENDA Spezi kation RaspberryPi Zero(W) Motivation USB Gadget Mode

    Kon guration bei Raspbian Demo verschiedener USB Gadget Ethernet Remote GPIO Serielle Schnittstelle Weitere... Fazit Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 3
  4. RASPBERRY PI ZERO RASPBERRY PI ZERO 1GHz, Single-core CPU 512MB

    RAM Mini-HDMI port µUSB OTG port µUSB power HAT-compatible 40-pin header Composite video and reset headers CSI camera connector Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 4 . 1
  5. RASPBERRY PI ZERO W RASPBERRY PI ZERO W ZUSÄTZLICH: ZUSÄTZLICH:

    802.11 b/g/n wireless LAN Bluetooth 4.1 Bluetooth Low Energy (BLE) Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 4 . 2
  6. ZUR INBETRIEBNAHME WERDEN BENÖTIGT... ZUR INBETRIEBNAHME WERDEN BENÖTIGT... SD-Karte µUSB-Kabel

    OTG-Kabel oder Adapter USB-Hub USB-Netzteil Tastatur / Maus HDMI-Adapter Monitor ... Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 5 . 1
  7. WARUM NICHT EINFACH NUR... WARUM NICHT EINFACH NUR... SD-Karte µUSB-Kabel

    Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 5 . 2
  8. LINUX USB GADGET MODE LINUX USB GADGET MODE MÖGLICHKEIT ÜBER

    DEN USB-OTG-PORT VERSCHIEDENE USB-GERÄTE ZU EMULIEREN: MÖGLICHKEIT ÜBER DEN USB-OTG-PORT VERSCHIEDENE USB-GERÄTE ZU EMULIEREN: serielle Schnittstelle (g_serial) Netzwerkschnittstelle (g_ether) USB-Speicher (g_mass_storage) Eingabegeräte wie Maus oder Tastatur (g_hid) MIDI (g_midi) Audio (g_audio) Webcam (g_webcam) Mehrere Geräte gleichzeitig (g_multi) => ether, serial, mass_storage Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 6
  9. GRUNDLEGENDE KONFIGURATION GRUNDLEGENDE KONFIGURATION Raspbian herunterladen und wie gewohnt auf

    SD- Karte kopieren Boot-Partition der SD-Karte öffnen (vfat) Falls benötigt leere Datei "ssh" anlegen, damit beim Booten der SSH-Daemon gestartet wird Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 7 . 1
  10. GRUNDLEGENDE KONFIGURATION GRUNDLEGENDE KONFIGURATION Editieren <sdcard> boot/con g.txt #... #dtparam=spi=on

    # Uncomment this to enable the lirc-rpi module #dtoverlay=lirc-rpi # Additional overlays and parameters are documented /boot/over.. # Enable audio (loads snd_bcm2835) dtparam=audio=on # Enable USB-Gadget dtoverlay=dwc2 Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 7 . 2
  11. ETHERNET GADGET ETHERNET GADGET Editieren <sdcard> boot/cmdline.txt Alles in einer

    Zeile! Keine Zeilenumbrüche einfügen! dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=49783f5b-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_ether quiet init=/usr/lib/raspi-config/init_resize.sh splash plymouth.ignore-serial-consoles Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 8 . 1
  12. ETHERNET GADGET ETHERNET GADGET WAS WIRD NOCH BENÖTIGT? WAS WIRD

    NOCH BENÖTIGT? ssh-Datei auf der Boot-Partition des RasPi Zero Zeroconf(Avahi, Bonjour) zur einfachen Namensau ösung $ ssh [email protected] Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 8 . 2
  13. ETHERNET GADGET ETHERNET GADGET DEMO DEMO Raspberry Pi Zero als

    USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 8 . 3
  14. REMOTE GPIO REMOTE GPIO Editieren <sdcard> boot/cmdline.txt Alles in einer

    Zeile! Keine Zeilenumbrüche einfügen! dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=49783f5b-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_ether quiet init=/usr/lib/raspi-config/init_resize.sh splash plymouth.ignore-serial-consoles Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 9 . 1
  15. REMOTE GPIO REMOTE GPIO DEMO DEMO Raspberry Pi Zero als

    USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 9 . 2
  16. SERIELLES GADGET SERIELLES GADGET Editieren <sdcard> boot/cmdline.txt Alles in einer

    Zeile! Keine Zeilenumbrüche einfügen! dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=49783f5b-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_serial quiet init=/usr/lib/raspi-config/init_resize.sh splash plymouth.ignore-serial-consoles Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 10 . 1
  17. SERIELLES GADGET SERIELLES GADGET Zur Aktivierung wird ein laufendes System

    benötigt auf dem RasPi benötigt: pi@raspberrypi:~ $ sudo systemctl enable [email protected] Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 10 . 2
  18. SERIELLES GADGET SERIELLES GADGET DEMO DEMO Raspberry Pi Zero als

    USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 10 . 3
  19. WEITERFÜHRENDE DOKUMENTATION WEITERFÜHRENDE DOKUMENTATION Allgemein: https://www.kernel.org/doc/Documentation/usb/ Gadgets: https://www.kernel.org/doc/Documentation/usb/gadget Con gfs:

    https://www.kernel.org/doc/Documentation/usb/gadget_ Massenspeicher: https://www.kernel.org/doc/Documentation/usb/mass- storage.txt Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 11
  20. WEITERE MÖGLICHKEITEN WEITERE MÖGLICHKEITEN Digitaler Bilderrahmen (Mass Storage) Rubber Ducky

    (HID) oder Bash Bunny (Ethernet) Kali Linux (Ethernet) Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 12
  21.  @AndreasZilly  @AndreasZilly  @AndreasZilly  @AndreasZilly  @AndreasZilly

     @AndreasZilly  @AndreasZilly DANKE FÜR EURE AUFMERKSAMKEIT DANKE FÜR EURE AUFMERKSAMKEIT This work is licensed under a .  github.com/azilly-de/piandmore-presentations  @AndreasZilly Creative Commons Attribution 4.0 International License Raspberry Pi Zero als USB Gadget Pi and more 10.5 24.02.2018  @AndreasZilly 13 . 1