11. USB On-the-Go
● The USB port on Pi Zero can be either Host or Device
BCM2835
LAN 9514
USB
Hub
LAN
USB
Port
USB
Port
Pi B+ Pi Zero
BCM2835
USB
Port
12. Raspberry Pi Zero USB Gadget
● https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/overview
●
http://blog.gbaman.info/?p=699
●
As of 2016-05-27 the Debian Jessie image already contains USB gadget mode
support
Mass storage and Serial (g_acm_ms)
Ethernet and Serial (g_cdc)
2 from Ethernet, Mass storage and Serial (g_multi)
Webcam (g_webcam)
Printer (g_printer)
Gadget tester (g_zero)
Serial (g_serial)
Ethernet (g_ether)
Mass storage (g_mass_storage)
MIDI (g_midi)
Audio (g_audio)
Keyboard/Mouse (g_hid)
13. A Demo of g_serial
● Add dtoverlay=dwc2 to /boot/config.txt
● Add dwc to /etc/modules
● Add g_serial to /etc/modules or load with modprobe
● Program can now access data from Virtual Serial from
/dev/ttyGS0
● Imaging: $5 POWERFUL Arduino
● Enable console on ttyGS0
sudo systemctl enable getty@ttyGS0.service
14. A Demo of PiShift (g_acm_ms)
● https://github.com/tomhartley/piShift
● Uses g_acm_ms combo device