Raspberry Pi Model Zero

CircleCIHex version

This is the base Nerves System configuration for the Raspberry Pi Zero and Raspberry Pi Zero W.

If you are not interested in Gadget Mode it might be worth checking out nerves_system_rpi. That image configures the USB port in host mode by default and is probably more appropriate for your setup.

Fritzing Raspberry Pi Zero image
Image credit

FeatureDescription
CPU1 GHz ARM1176JZF-S
Memory512 MB
StorageMicroSD
Linux kernel4.4 w/ Raspberry Pi patches
IEx terminalOTG USB serial port (ttyGS0). Can be changed to HDMI or UART.
GPIO, I2C, SPIYes - Elixir ALE
ADCNo
PWMYes, but no Elixir support
UART1 available - ttyAMA0
CameraYes - via rpi-userland
EthernetYes - via OTG USB port
WiFiSupported on the Pi Zero W
BluetoothNot supported yet

Supported OTG USB modes

The base image activates the dwc2 overlay, which allows the Pi Zero to appear as a device (aka gadget mode). When plugged into a host computer via the OTG port, the Pi Zero will appear as a composite Ethernet and serial device. The virtual serial port provides access to the IEx prompt and the Ethernet device can be used for firmware updates, Erlang distribution, and anything else running over IP.

Supported WiFi devices

The base image includes drivers for the onboard Raspberry Pi Zero W wifi module (brcmfmac driver). Due to the USB port being placed in gadget mode, this system does not support USB WiFi adapters.

Linux kernel and RPi firmware/userland

There's a subtle coupling between the nerves_system_br version and the Linux kernel version used here. nerves_system_br provides the versions of rpi-userland and rpi-firmware that get installed. I prefer to match them to the Linux kernel to avoid any issues. Unfortunately, none of these are tagged by the Raspberry Pi Foundation so I either attempt to match what's in Raspbian or take versions of the repositories that have similar commit times.

Installation

Add nerves_system_farmbot_rpi0 to your list of dependencies in mix.exs:

def deps do
[{:nerves_system_farmbot_rpi0, "~> 0.16.0"}]
end

Image credit: This image is from the Fritzing parts library.