WiFi adapters for RaspberryPi
It often happens that an external WiFi adapter is needed for a Linux based embedded PC like the RaspberryPi. One of the most important reasons to use an external stick is to extend the wireless range in comparison with built-in WiFi, to add WiFi, or to ommit stability or specific driver issues. While there are some built-in Kernel drivers for certain chipsets, it's often difficult to find-out what driver is available for your specific WiFi chip or even what chip is used in your particular WiFi adapter.
There are some known manufacturers of WiFi to USB convertor chips:
When entering the WiFi stick there is a command to know the details about the manufacturer and the chip:
Recommended by LinkedIn
> lsusb -v
...
iManufacturer: 0x0bda (Realtek)
iProduct: 0xf179 (RTL8188 fu/ftv)
In some cases it's required to install an additional user space driver. Because compilation of the driver is a part of the installation process, it's important that the major version of the active gcc compiler matches the gcc version that was used to compile the Kernel, and that the Kernel headers are exposed in line with the Kernel release. The Kernel headers contain the headers of the Kernel functions that are used to link with when compiling user space drivers or other programs.
# Use an alternative gcc compiler
> sudo apt-get update && sudo apt-get install gcc-8
> sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 10
> sudo update-alternatives --config gcc
# Show the Kernel details and Kernel headers
> uname -a -> shows the Kernel name, release, version, etc.
> ls /usr/src/ -> shows the exposed Kernel headers
# Re-install Kernel and Kernel headers
> sudo apt install --reinstall raspberrypi-kernel raspberrypi-bootloader
> sudo apt-get install raspberrypi-kernel-headers
After reboot the WiFi adapter can be tested by setup SSID and password, and temporary assign a DHCP address. A common tool to configure WiFi is wpa_supplicant and setup can be done by using an ssh-session over the native Ethernet interface:
> dhclient eth0 -v -> get a DHCP address on the native interface (eth0)
> ifconfg -> show IP addresses and leases of all ports