Questions tagged [gadget]

Gadget are a series of linux drivers that turn a (master) USB port into a slave device when connected to a host, the USB will be presented as a serial, ethernet, camera, printer, storage etc. https://github.com/torvalds/linux/tree/master/drivers/usb/gadget/function

Filter by
Sorted by
Tagged with
7
votes
5answers
7k views

Where is the USB2 OTG port on the RPi 4 Model B located?

According to this answer the Raspberry Pi 4 Model B has a total of five USB ports (two USB3 host, two USB2 host, one USB2 OTG). Where is the fifth USB2 OTG port located and how can I use it? Can I ...
10
votes
1answer
12k views

How to use Raspberry Pi 3 as a USB gadget

How can I use Raspberry Pi 3 as a USB gadget. Is there any way? How can I enable the USB gadget mode on Raspberry Pi?
3
votes
3answers
5k views

USB Mass Storage Gadget - how to convincingly emulate a flash drive?

I've got a Pi Zero W that I'm using in OTG/gadget mode. I've activated dwc2 USB, partitioned and formatted the file that is to be used as filesystem and loaded g_mass_storage. It is working fine in ...
3
votes
1answer
2k views

USB 3.0 OTG on Raspberry Pi 4 (USB gadget)

Raspberry Pi 4 can do USB OTG via the USB-C connector (according to this answer) - but only at USB 2.0 speeds since the USB-C connector only connects to USB 2.0 lanes. My question is - can Pi 4 also ...
3
votes
1answer
1k views

Change Raspberry Pi Zero USB Gadget name from Linux File-Stor Gadget

My goal is to convincingly emulate a well known brand of USB Flash Disk, using Raspberry Pi Zero (with or without Wifi). For the sake of this example, I want to emulate a 4GB Sandisk Cruzer Edge, but ...
4
votes
0answers
186 views

Check if a host device is connected to Pi Zero gadget

How can the Pi detect if a host device has been connected, and gather information about that device, when being used as a gadget (such as mass storage). It would be useful if I could detect this ...
0
votes
2answers
3k views

Is it possible to set a static IP for the first boot of headless Pi ethernet gadget?

I'm setting up a Raspberry Pi Zero as an ethernet gadget using the instructions here. That generally works but until I can log in to the Pi and configure it to use a static IP address it uses for its ...