🛠 Installation headless : la Zero en carte réseau USB (g_ether)

Raspberry Pi Zero (2015) — Fiche carte · debutant · Schéma : IMG-zero-debutant-2-installation-headless-usb-gadget.svg — Zero branchée sur le port USB d'un ordinateur portable par son port données (câble micro-USB), interface réseau USB apparaissant sur le portable, terminal SSH, alimentation sur le port POWER.

Goal

Set up the Zero with no monitor, no keyboard and no network cable, using its OTG gadget mode: plugged into a laptop's USB port it enumerates as a network adapter (g_ether) plus keyboard, and you SSH in. This is the natural Zero setup — the board has no WiFi, no Bluetooth and no Ethernet at all.

Parts

Steps

On the laptop, mount the card's FAT boot partition and add two lines:

sudo mount /dev/sdX1 /mnt
echo "dtoverlay=dwc2" | sudo tee -a /mnt/config.txt
sudo sed -i 's/rootwait/rootwait modules-load=dwc2,g_ether/' /mnt/cmdline.txt
sudo umount /mnt

Boot the Zero, then plug its DATA micro-USB port into the laptop — it appears as usb0 / a RNDIS network adapter:

ssh pi@raspberrypi.local
sudo apt update && sudo apt full-upgrade -y

Check

The laptop shows a new USB network interface, ping raspberrypi.local answers and SSH drops you into a shell on the Zero.

Pitfalls

Autres tutoriels pour cette carte

Exemples de code pour cette carte

← Retour à la fiche 🛠 Tous les tutoriels