Skip to content

Document USB gadget networking setup for Raspberry Pi devices #338

@paralin

Description

@paralin

Problem

Raspberry Pi devices (especially Pi 5, but also Pi 4, Zero, etc.) support USB gadget mode for network connectivity via the USB-C port, but this is not documented for these platforms. This would provide a static IP address for initial configuration without needing to scan the network.

Use Case

From issue #330: User suggested adding a static network interface over the USB controller (USB Type-C port) with a static IP, making initial configuration much easier without needing nmap to discover the device.

Current State

  • USB gadget networking is already documented for allwinner/licheerv in configs/allwinner/licheerv/README.md
  • The licheerv config provides a good template showing:
    • Host machine setup (NetworkManager and iptables methods)
    • Device-side configuration
    • IP address customization
    • Connection sharing setup

Proposed Documentation

Add similar USB gadget networking documentation to Raspberry Pi configs, specifically:

For Raspberry Pi 5, 4, Zero, etc.

  1. Enable USB gadget drivers:

    • Load dwc2 kernel module
    • Configure via /etc/modules or kernel cmdline
    • Add g_ether or similar gadget module
  2. Device-side configuration:

    • NetworkManager connection file for USB network
    • Default static IP (e.g., 192.168.7.2 or 10.0.0.3)
    • Example configuration file
  3. Host machine setup:

    • NetworkManager "Shared" method (easiest)
    • Manual iptables setup (for non-NM systems)
    • Required host IP address
  4. Where to place overrides:

    • Kernel config for modules
    • Root overlay for NetworkManager configs
    • Example paths and files

Implementation Details

From #330 discussion, this involves:

  • Loading dwc2 driver (kernel module or cmdline)
  • Possibly: modules=sd-mod,usb-storage,ext4,dwc2,g_ether in cmdline.txt
  • Or: adding to /etc/modules in root overlay
  • NetworkManager connection file similar to licheerv's usb0.nmconnection

Benefits

  • Much easier initial setup - no network scanning needed
  • Provides reliable static IP for first login
  • Useful for headless setups
  • Emergency access if WiFi/Ethernet fails
  • Follows existing pattern from licheerv docs

Location

This documentation should go in:

  • configs/pi/README.md - add new section "USB Gadget Networking"
  • Could reference licheerv docs as the detailed example
  • Include Pi-specific kernel module details

Related

  • Issue Feedback and questions #330
  • Existing USB gadget docs in configs/allwinner/licheerv/README.md
  • Similar feature requested for easier device discovery

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions