Has anyone got WiFi working in buildroot for the Raspberry Pi Zero W? I can't find any online notes or walkthroughs on it.

The raspberrypi0_defconfig works fairly well, but doesn't include wireless.

I'm using the latest iteration of buildroot, 2017-08. I've added the rpi-wifi-firmware. Which packages are needed as a bare minimum to connect to a WiFi network?

2 Answers 2


I also tried to find the "bare minimum wireless" for RPi Zero W using buildroot so this Q&A came quite high on the search results. Eventhough the original answer was somewhat helpful, it's definitely not the best one so I though it would be worth sharing my own findings:

Using buildroot 2018.02.2

make raspberrypi0_defconfig

to clean you config. Then (make menuconfig and) select following from Target packages:

Hardware Handling -> Firmware -> rpi-wifi-firmware
Networking applications -> wpa_supplicant
Networking applications -> wpa_supplicant - Enable 80211 support

Everything else that's necessary should already be pre-selected.

Then at /etc/network/interfaces

auto wlan0
iface wlan0 inet dhcp
  pre-up wpa_supplicant -D nl80211 -i wlan0 -c /etc/wpa_supplicant.conf -B
  post-down killall -q wpa_supplicant

and at /etc/wpa_supplicant.conf


   ssid="My WLAN"

and now we're still missing the secret ingredient: the wifi driver must be loaded before the networking init-scripts kick in. You could Enable WCHAR support (at Toolchain -menu) in order to have eudev as /dev management (at System configuration -menu) which would automatically handle the driver loading. Actually I recommend this if you're going to connect UBS devices to your RPi....

...but if not, edit /etc/inittab and modprobe brcmfmac yourself just before the rc scripts are ran:

# Load Wifi driver
::sysinit:/sbin/modprobe brcmfmac 

# now run any rc scripts

That's it.

UPDATE 21.03.2022. Using the latest buildroot from git://git.buildroot.net/buildroot it seems that there are some changes:

  1. rpi-wifi-firmware is renamed to brcmfmac-sdio-firmware-rpi-wifi which can be found under brcmfmac_sdio-firmware-rpi at Hardware Handling.
  2. Line ctrl_interface=/var/run/wpa_supplicant at wpa_supplicant.conf doesn't seem to be valid nor necessary anymore (if it ever even was)

I also found that if the wifi is needed for access over SSH, OpenSSH should be paired with haveged for faster random generator initialization. Without it the boottime can be minutes!

To fully prepare the board for direct headless access and considering all above, I made an external buildroot library with rpi-wifi package which handles all the necessary configuring from wifi setup to SSH config:

rpi-wifi at my buildroot-externals repo

  • Should above configuration provide DHCP negotiation too? I currently have to run udhcpc -i wlan0 manually to get an IP address.
    – Jaakko
    Jan 7, 2020 at 16:37
  • 1
    @Jaakko, yes it should or at least it did for me. It also worked with 2019-something version of buildroot few weeks ago, but compared to 2018.02.2 there was a separate defconfig for raspberry Pi zero and zero W. Not sure when that was introduced. Jan 8, 2020 at 18:09
  • Yes, it started working after a boot. Not sure what I messed up.
    – Jaakko
    Jan 10, 2020 at 9:29

Turned out that an incorrect /etc/network/interfaces and/or /etc/wpa_supplicant was to blame. In between builds I've been adding additional packages, so I'm not 100% sure if these are all needed, but anyway these are the ones I included:

Hardware Handling Hardware Handling -> Firmware -> linux-firmware -> Broadcom BRCM bcm43xxx Hardware Handling -> Firmware -> rpi-firmware (extended 'x' firmware) Hardware Handling -> Firmware -> Install DTB overlays Hardware Handling -> Firmware -> rpi-wifi-firmware Hardware Handling -> dbus Hardware Handling -> dbus-glib

Networking applications Networking applications -> dhcpd Networking applications -> ifupdown scripts Networking applications -> iproute2 Networking applications -> iptables Networking applications -> wireless-tools (+install shared lib) Networking applications -> wpa_supplicant Networking applications -> wpa_supplicant - Enable 80211 support Networking applications -> wpa_supplicant - Enable EAP Networking applications -> wpa_supplicant - Install wpa_cli binary Networking applications -> wpa_supplicant - Install wpa_client shared library Networking applications -> wpa_supplicant - Install wpa_passphrase binary

I don't think any other categories are relevant to WiFi networking.

/etc/network/interfaces auto lo iface lo inet loopback allow-hotplug wlan0 iface wlan0 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

/etc/wpa_supplicant.conf ctrl_interface=/var/run/wpa_supplicant update_config=1 network={ ssid="OpenWrt" psk=<your psk key here> }

After boot I run: wpa_supplicant -B -i wlan0 -W -D nl80211, wext -c /etc/wpa_supplicant.conf wpa_cli -B -i wlan0 -p /var/run/wpa_supplicant -a /sbin/wpa_action dhcpcd -q -w

I want networking to come up well after boot as it's embedded linux and some more important stuff needs to start first. Therefore I'll add it to some post boot script somewhere. If you want to have your interface up at boot, then add these to your boot process somewhere. I'll consider this out of the scope for this question.

So, this works, it's not perfect, but it will be a good starting point for those that like me struggled. I am pretty sure not all mentioned packages are the bare minimum, also /sbin/wpa_action doesn't exist, but when leaving it out you'll enter interactive mode. I'll be refining this answer once I have a better grip on it. Suggestions are welcome!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.