How to create an accesspoint using a RealTek 8192cu Usb Wifi Dongle In RPI1 B+

8192cu is now supplied in default kernel, but it is not working when running as an access point. So I need to recompile the driver.

1.get the kernel’s headers

You have to get the kernel’s header files, the common way is

sudo apt-get install linux-headers-...

But in RPI, the easiest way is rpi-source.

sudo wget -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update

The kernel is compiled by gcc-4.8.3+, so if you have the gcc below 4.8.3, you have to install it.
first add

deb jessie main contrib non-free rpi

in /etc/apt/sources.list, and then

sudo apt-get install -t jessie gcc-4.8 g++-4.8

maybe you want to manage multi gcc versions

sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50

also you need curses for make menuconfig

sudo apt-get install libncurses5-dev

2.compile the kernel


if it fails after downloading, you can fix the error and compile it yourself.

cd /root/linux && ./make

3.compile the right 8192cu

maybe /lib/modules/3.8.11+/arch/armv6l is missing, just link it

cd /lib/modules/3.18.11+/arch && ln -s arm armv6l


git clone
cd rt8192cu
sudo make
sudo make install

and if you copy the ko manually, you have to add the 8192cu to blacklist avoiding the supplied driver. modify /etc/modprobe.d/8192cu.conf

blacklist rtl8192cu

4. renew the hostapd
Download the software from this url:
the file is called “Linux Kernel 2.6.18~2.6.38 and Kernel 3.0.8…” version: 3.4.4_*

tar zxvf RTL8188C_8192C_USB_linux_
cd wpa_supplicant_hostapd-0.8_
sudo cp hostapd hostapd_cli /usr/local/sbin/

20151101 Update: I found a better way, patching the hostapd. More information please look at hostapd-rtl871xdrv, I patched hostapd 2.5, and it works fine.

5.change the config of hostapd

just add


in hostapd.conf, and also if you want more speed and your wifi support 802.11n, change to

wpa_pairwise=CCMP TKIP

Because If you’re using TKIP for encryption with WPA2, you’re restricted to 54 mbps. You have to use CCMP (AES) to get 150 mpbs.See the wiki

That’s all.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.