Sometimes even though a wireless adaptor works out of the box on the Raspberry Pi, it might throw errors when it's asked to serve as an access point.
This is especially true of cards that use Realtek chipsets, like the one we've used, MicroNext MN-WD152B, which uses the RTL8192CU chipset. While it works right off the bat for browsing the web, it doesn't work with the hostapd client in Raspbian's repository.
It turns out Realtek has its own version of hostapd client, which you'll have to use in case you are in the same predicament.
To download the file, head to Realtek's download section and select your chipset from the ones listed. This takes you to a page that lists the drivers for your chipsets.
From this page grab the driver for Linux, which will download a compressed zip file with a long-winded name. In our case this was called 'RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip'. We'll just refer to it as 'driver.zip'.
Copy this file to the Raspberry Pi using scp using something like:
scp driver.zip email@example.com:/home/pi
This copies the file to the Raspberry Pi's home directory. Now extract the file with
and cd into the wpa_supplicant_hostapd directory. It'll list several compressed tarballs. Use the tar zxvf command to extract the file beginning with wpa_supplicant_hostapd. Now cd into the hostapd directory under the extract directory. This directory has a file named Makefile. Open it in a text editor and replace the
CFLAGS = -MMD -O2 -Wall -g
line towards the top of the file with the following:
CFLAGS=-MMD -Os -Wall -g
Save the file and enter make to compile the hostapd client. It'll take quite some time and, when it's complete, it'll replace the hostapd binary in this directory.
Before using this new version, move out the old version with:
sudo mv /usr/sbin/hostapd /usr/sbin/hostapd.orig
Then copy over the newly compiled version with the following:
sudo cp hostapd /usr/sbin/
and give it the right permissions with:
sudo chmod 755 /usr/sbin/hostapd
You should now be able to get your access point online without any issues.
- Find out what else you can do with the tiny PC with our collection of Raspberry Pi Projects