Add USB Serial to your Raspberry Pi Zero W

From Lofaro Lab Wiki
Revision as of 14:20, 26 March 2019 by Dlofaro (Talk | contribs)

Jump to: navigation, search

This tutorial is based on: https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/serial-gadget

Prerequisites

You must have the following:

  • Raspberry Pi Zero W
  • Raspbian Jessie (or Jessie Lite) installed after the May 2016 release
  • USB Cable

Steps

Step 1. Edit config.txt & cmdline.txt

Insert the SD card into your computer. Use a text editor to open up the config.txt file that is in the SD card post-burn.

Go to the bottom and add the following to the last line:

 dtoverlay=dwc2as

Save the config.txt file as plain text and then open up cmdline.txt After rootwait (the last word on the first line) add a space and then:

 modules-load=dwc2,g_serial

At the time of writing, this is the full cmdline.txt contents (in case you need to start over). Note it is one very long line

 dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_serial quiet init=/usr/lib/raspi-config/init_resize.sh