Pi Zero as a universal USB stick
Multitool

© Lead Image © besjunior; 123rf.com
In just a few simple steps, you can turn a Pi Zero into a universal USB flash drive that emulates storage, a serial port, Ethernet, and more.
Instead of taking along a separate USB gadget for every task, you can turn a Pi Zero into a universal device that provides storage, a network interface, and additional functions. This project relies on a rarely used feature of the Pi Zero: Its USB port supports USB On-The-Go (OTG). If you connect the small-board computer (SBC) to another computer, the Raspberry Pi logs in as a lower-level device (gadget).
Normally gadget mode [1] is undesirable. If you want to connect a memory stick to the Pi Zero, you need a special OTG cable; otherwise, it will not work (see the "How OTG Works" box). Conversely, plugging a normal cable into the USB port triggers the desired behavior.
In Figure 1, the USB cable is plugged into the left-hand USB port and is used both to supply power and exchange data. If you want to reproduce the project without much effort, just from the software point of view, you can skip the next steps.
[...]
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

News
-
Blender App Makes it to the Big Screen
The animated film "Flow" won the Oscar for Best Animated Feature at the 97th Academy Awards held on March 2, 2025 and Blender was a part of it.
-
Linux Mint Retools the Cinnamon App Launcher
The developers of Linux Mint are working on an improved Cinnamon App Launcher with a better, more accessible UI.
-
New Linux Tool for Security Issues
Seal Security is launching a new solution to automate fixing Linux vulnerabilities.
-
Ubuntu 25.04 Coming Soon
Ubuntu 25.04 (Plucky Puffin) has been given an April release date with many notable updates.
-
Gnome Developers Consider Dropping RPM Support
In a move that might shock a lot of users, the Gnome development team has proposed the idea of going straight up Flatpak.
-
openSUSE Tumbleweed Ditches AppArmor for SELinux
If you're an openSUSE Tumbleweed user, you can expect a major change to the distribution.
-
Plasma 6.3 Now Available
Plasma desktop v6.3 has a couple of pretty nifty tricks up its sleeve.
-
LibreOffice 25.2 Has Arrived
If you've been hoping for a release that offers more UI customizations, you're in for a treat.
-
TuxCare Has a Big AlmaLinux 9 Announcement in Store
TuxCare announced it has successfully completed a Security Technical Implementation Guide for AlmaLinux OS 9.
-
First Release Candidate for Linux Kernel 6.14 Now Available
Linus Torvalds has officially released the first release candidate for kernel 6.14 and it includes over 500,000 lines of modified code, making for a small release.