Skip to content

Basic setup for Raspberry Pi Zero W

Setup Raspberry Pi Zero W

SSH via USB and serial console

  1. Download the raspbian image and flash to the SD card. Mount the SD card on the host computer. You should see two partitions "boot" and "rootfs".

  2. Edit the file "/boot/config.txt" and add the following line to the end of the text:

# add the following line if you also want serial console
  1. Edit the file "/boot/cmdline.txt", add "modules-load=dwc2,g_ether" after rootwait. It's a one-line text file and be careful about the format. After the change, it should look something like:
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait modules-load=dwc2,g_ether
  1. Create a new file named "ssh" without any suffix to enable ssh.
$ touch ssh
  1. USB network configuration. Edit "rootfs/etc/network/interfaces" and add the following lines:
allow-hotplug usb0
iface usb0 inet static
  1. Now you can plug the SD card back to rpi0W and boot the board. If the host computer fails to get an IP address for the USB connection with rpi, you need to manually assign one:
# use ifconfig to check the name of the USB connection with rpi first
$ sudo ifconfig enp0s20f0u2 netmask

Patch kernel with Xenomai 3

Before pactching Xenomai 3, ther kernel shipped with "2018-06-27-raspbian-stretch-lite.img" is "4.14.50+". Afterwards the kernel is "4.14.37-ipipe+".

Additional commands

# disable dhcpcd service
$ sudo systemctl disable dhcpcd.service 
$ sudo systemctl enable wpa_supplicant.service