This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Raspberry Pi Zero USB Webcam Gadget | |
# Creates a UVC USB gadget with YUYV + MJPEG modes and starts uvc-gadget. | |
# Tested with Raspberry Pi OS (Legacy / Bullseye). Should also work on Bookworm with /boot/firmware layout. | |
set -euo pipefail | |
# -------- Settings you may tweak -------- | |
GADGET_NAME="pi-webcam" | |
VID="0x1d6b" # Linux Foundation (for testing). Vendors use their own IDs. | |
PID="0x0104" # Generic composite gadget PID (testing) |