Wireless on Raspberry Pi with Buildroot
Raspberry Pi does not have Wi-Fi on board. You’ll need to use a Wi-Fi dongle and discover the driver to build into the kernel. One way to find the driver is to plug the dongle into a Raspberry Pi running Raspbian, and run
lsmod to see which module gets loaded. The following text assumes you’re building a custom embedded Linux system using Buildroot.
Invoke the Kernel configuration utility using
Enable Wireless Networking support under Networking support
Enable cfg80211 - wireless configuration API, and Generic IEEE 802.11 Networking Stack (mac80211), under Networking Support, Wireless
Enable EEPROM 93CX6 support under Device Drivers, Misc devices, EEPROM support. Required for RTL8187 module in my Wi-Fi dongle, may not be needed for your particular adapter
Enable Wireless LAN driver support under Device Drivers, Network device support
Enable Realtek 8187 and 8187B USB support under Device Drivers, Network device support, Wireless LAN. Select the driver appropriate for your adapter
make menuconfig within the buildroot folder from a command prompt.
Select package wpa_supplicant and its sub-packages for WPA/WPA2 support
Perform the build by invoking make, copy the newly minted system to an SD card, and use it to boot up your Raspberry Pi.
Configure Wireless Networking
List your wireless interfaces
If you’ve selected the iproute2 package above, the following should list all network interfaces
Bring up the wlan0 interface
ip link set wlan0 up
ifconfig wlan0 up
Find the access point you want to connect to
iw dev wlan0 scan
Assuming you’re using WPA/WPA2, invoke wpa_passphrase to create config file, and wpa_supplicant to connect to network
wpa_passphrase your_SSID your_passphrase > your_SSID.conf wpa_supplicant -B -i wlan0 -c your_SSID.conf
Instead, if you want to connect to an open network
iw dev wlan0 connect your_SSID
Request IP address using DHCP
Check link status
iw dev wlan0 link
Add nameserver entries to /etc/resolv.conf e.g.
nameserver 126.96.36.199 nameserver 188.8.131.52
Test internet connectivity using ping