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
0
votes
2answers
46 views

Idea about encryption with Pi

I had an idea about having an encrypted partition on the Pi's SD card which can be auto-decrypted with a headless setup (no keyboard available for manual decryption). Would it not be possible to ...
1
vote
1answer
74 views

Raspberry Pi Zero g_mass_storage not recognized by some Systems

I have a Raspberry Pi Zero W configured as a USB device (latest raspian version 5.10.11+). Make a Pi Zero W Smart USB flash drive In general it works fine, and the device will be recognized by Windows ...
2
votes
0answers
199 views

Bit-perfect USB Audio gadget

I want to use Raspberry Pi Zero as a USB DAC with switchable sample rate. Maximum resolution should be 96/24 with all 4 common rates ie. 44.1, 48, 88.2 an 96 kHz supported. It should also work with ...
0
votes
0answers
590 views

Using a raspberry pi 4 as a usb audio interface

I want to use my raspberry pi 4 with hifiberry dac and adc as a usb audio interface for my android phone so that I can stream audio and make handsfree calls in my car. I'm having trouble finding ...
1
vote
1answer
256 views

Is it possible for a Raspberry Pi Zero to act as both a Usb Gadget and a Usb Host?

I am currently working on a Raspberry Pi project, and found an amazing feature that I used many times on my LineageOs phone: Usb Gadget. I figured I could change the function of the Usb port to act as ...
1
vote
0answers
31 views

Is it possible to enter USB-C Gadget Mode using only dhcpcd?

I've been following tutorials like this one to make USB 'Gadget Mode' work on the Pi: https://www.hardill.me.uk/wordpress/2019/11/02/pi4-usb-c-gadget/ However the other day I had an issue getting it ...
0
votes
1answer
1k views

SSH into Rasberry Pi 4 over USB (Ubuntu Core) [duplicate]

Is it possible to SSH connect via USB-C -> USB to Rasberry Pi 4 in Ubuntu? Like this
0
votes
1answer
245 views

Pi Zero configured as HID not being recognized by PC (dmesg error)

I followed this guide to setup my Pi Zero W as a keyboard HID. Connected it to a laptop (via the data USB, not the power) to see no effect. When I started investigating, I saw that dmesg is showing ...
3
votes
1answer
2k 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 ...
1
vote
0answers
484 views

Unable to access laptop's internet on Pi Zero over Usb

I've been going over so many web pages trying out numerous things for the past 6 hours to just get internet on my rpi to no avail hence I have come here to hopefully find a solution. Below are the ...
1
vote
1answer
590 views

Gadgetfs - Filesystem not found

While trying the solutions suggested by a comment on my first question I tried to enable gadgetfs. I tried the following: sudo modprobe dwc2 sudo modprobe gadgetfs sudo mkdir /dev/gadget sudo mount -...
3
votes
1answer
4k 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 ...
2
votes
0answers
334 views

Is it possible to connect a Raspberry Pi 0 to the USB port of a router, to connect to the internet?

Recently I read (in articles such as this one) that it is possible to use the Raspberry Pi Zero in 'USB/Ethernet gadget mode'. Now my modem has two USB ports, which the manual says can be used for ...
11
votes
5answers
12k 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 ...
2
votes
0answers
177 views

Waking computer with raspberry pi zero usb keyboard gadget

I've been trying to set up a raspberry pi zero as a keyboard gadget, hoping i could wake a laptop (No ethernet) with it. I would also be able to encrypt it and send the password, which is an added ...
1
vote
0answers
57 views

Cannot SSH from pi zero to pi zero over OTG USB

I am running Raspbian Stretch Lite Linux testpi1 4.14.98+ #1200 Tue Feb 12 20:11:02 GMT 2019 armv6l GNU/Linux I am able to SSH to my pi zero over the OTG USB cable as many guides online have ...
1
vote
1answer
153 views

RPI is not visible in LAN when using ethernet over usb

I'm following this tutorial for converting RPI to usb gadget. I've modified setup script a little to fit my needs: err_file=$HOME/usb_setup_err echo "Time: $(date -Ins)" >> $err_file echo '...
3
votes
0answers
439 views

Detect if a host is connected (gadget mode)

Device: Raspberry Pi Zero W v1.1 State: Pi Zero is running in gadget mode, acting as a USB Mass Storage device (seen by / mounted on a MacBook Pro). Question: What is the best way to detect whether ...
0
votes
0answers
158 views

Forward internet to usb0

I have Raspberry Pi 3 (running Raspbian) and Raspberry Pi Zero (DietPi). The Raspberry Pi 3 is connected to ethernet. The Raspberry Pi Zero is set as Ethernet gadget (according to this https://dietpi....
1
vote
1answer
2k views

Headless pi zero HID keyboard

I am trying to get my pi zero to act as a HID USB keyboard when plugged in to a computer, following this guide. I finished the configuration, and I get to the "Keyboard / Mouse / Joystick (HID)" ...
1
vote
1answer
866 views

Raspberry Pi Zero as webcam [duplicate]

I read some case, like using dwc2 and g_webcam in /boot/config and cmdline. but hard to understand and doesn't work. and can't find a tutorial, there are some tutorials only about serial and ethernet. ...
0
votes
1answer
323 views

Raspberry Pi Zero W access point sharing LAN thorough ethernet gadget

I've recently wanted to do a project with the Raspberry Pi Zero. Basically, I want to set up the Pi as an ethernet gadget for computers to be able to play games over WLAN. The computers have no wifi ...
4
votes
2answers
12k views

Use Raspberry Pi as keyboard/mouse output to control server

I want to connect to a RPi thought LAN (possibly with VNC) and have it controlling a server that is connected to the RPi by USB. Basically the RPi would have to send every keystroke/mouse movement to ...
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 ...
0
votes
0answers
415 views

Pi Zero Connects as USB serial gadget, but does not receive data

I have a few Pi Zeros I'm working on for a project. I have the Pi connected to a PC with Windows 7 with a USB cable, and I need to send packets of text to it with information to control devices on the ...
1
vote
0answers
238 views

On RPi Zero, garbage received using g_printer gadget

I have a RPi Zero W as a printer gadget, and it shows up as a printer on my Macbook (solved here in comments https://unix.stackexchange.com/questions/408293/how-to-make-g-printer-usb-gadget-printer-...
1
vote
0answers
280 views

PI Zero gadget with g_ether on Ubuntu host creates new wired connection every boot

I have a Raspberry PI Zero running Raspbian Stretch 2017-09-07 configured in otg mode with the g_ether module loaded. When I set a static IP in the interfaces files, connecting on Windows is ...
0
votes
0answers
267 views

RPI Zero W gadget after plugging in turns my PC off

Hello I am making a rpi zero USB gadget but something is wrong with it I am sure that pads don't connect to each other
1
vote
1answer
659 views

configure pi as a usb gadget, add vivid driver to the image, build and run code

Need to configure RPi as a USB UVC (video camera gadget). As far as I understand here is how it can be done. Then I need to test this application. Instructions on how to do it located here. ...
10
votes
1answer
16k 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?
0
votes
1answer
258 views

Powering the Pi zero from a USB port: what if I acidentally unplug it without doing “sudo shutdown”? How to protect it?

I want to create composite gadget device with Raspberry Pi Zero W, and use power and data in the same USB port on another, host, machine. I am worried about it being unplugged while things are written ...
4
votes
0answers
213 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 ...
5
votes
2answers
2k views

Pi Zero g_mass_storage not recognized by some computers until after another computer recognizes it

So the basic issue is this: once the Pi Zero with g_mass_storage is booted up, as long as there is a power source for it (like a battery, so it won't shut off) I can plug it into any windows machine (...
3
votes
3answers
6k 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 ...
1
vote
1answer
1k views

Modifying libcomposite module doesn't work

I'm trying to modify the libcomposite module in a way that it prints the functions of which are loaded to the log file. I'm using an Raspberry Pi Zero W with the 4.9.20+ Kernel. I updated everything ...
2
votes
1answer
3k views

DHCP on USB0 of Pi Zero not working

I have set up my Raspberry Pi Zero with the USB Ethernet gadget as described by Adafruit. This works wonderfully with static IP addresses. Now I want to put a little DHCP server in the Pi, so that I ...