Headless Raspberry Pi setup w/o Ethernet

1 minute read

Related: Headless Raspberry Pi setup with Ethernet


Some Raspberry Pi models such as the Zero and Zero W do not have an Ethernet port on the board. While one can use a USB-Ethernet adapter in the USB OTG port, if one wants to use only the Pi itself without adapters, the procedure below is required.

  1. Install Raspbian operating system on micro SD card.
  2. On the SD card, edit /boot/config.txt, adding the line:
    dtoverlay=dwc2
    

Now pick one of the following connection methods.

Ethernet over USB

  1. edit boot/cmdline.txt, adding after rootwait on the same line with a space:
    rootwait modules-load=dwc2,g_ether
    
  2. boot the Pi with the micro SD card inserted, waiting 90 seconds or so, and then type from your laptop

If this doesn’t work, ensure that you see the new Ethernet port on your laptop. On Linux this would be seen in

ip a

reference

serial over USB

This method uses very basic USB drivers that should be on any laptop operating system.

  1. edit boot/cmdline.txt, adding after rootwait on the same line with a space:
    rootwait modules-load=dwc2,g_serial
    
  2. boot the Pi with the micro SD card (using an HDMI monitor or SSH), and type in the Pi:
    sudo systemctl enable [email protected]
    

    this is a one-time command that will be “remembered”

  3. Reboot the Pi and connect from your laptop with a serial client like PuTTY at 115200 baud. You can find the port the device is on in Linux from
    dmesg
       
    ls /dev/tty*
    

    before and after plugging in the Pi.

reference

Leave a comment