Create an AP to gain remote control of the Raspberry

Run through this step-by-step guide to set-up an access-point for a version 3.2 Realtek chipset wifi dongle on Raspian.

Used hardware:

Used software:

cat /etc/os-release
  • Linux 4.14.98+ #1200 kernel
uname -a

Software configuration

TP-Link TL-WN722N not recognized

The “manufacturer” is represented in the ID as 1d6b, the “Linux Foundation”. The nature of the bus is reflected in 0002, USB version 2.0.

As it is version 3.2 of the TP-Link TL-WN722N model, it means that we have a Realtek chipset which is not natively supported by Raspian. We need to build the driver on our system in order to have it working. If you have a better supported chipset, I recommend this set-up guide.

Download the kernel header source to compile the driver later on. There is a good tool called rpi-source available here. Follow the manual and run:

sudo apt-get updatesudo apt install git bc bison flex libssl-devsudo wget -O /usr/local/bin/rpi-source && sudo chmod +x /usr/local/bin/rpi-source && /usr/local/bin/rpi-source -q --tag-updaterpi-source

Then clone the driver repository from here:

git clone

Follow the instructions from the repository:

sudo make all
sudo make install
sudo depmod
sudo modprobe 8188eu

If everything has run successfully, you should see rtl8188eufw.bin within /lib/firmware/rtlwifi

Further, you should see the module as well, when running lsmod

Now runsudo rebootand a new interface wlan1 should show up when running ifconfig.

Further, lsusb now also shows the device correctly

TP-Link TL-WN722N recognized

To set up the access point for the connection between the phone and raspberry, we will use raspap-webgui. Follow the instructions there, no need to install OpenVPN during the process (if you do not need it).

curl -sL | bash

In order to define the port for the RaspAP web-service you can do the following:

sudo nano /etc/lighttpd/lighttpd.conf

Then change the following line:

server.port                 = 8081

Then let’s restart the lighttpd webserver:

sudo systemctl restart lighttpd.service

Then you can access the web-server on http://raspberrypi.local:8081/ with the default credentials:

username: admin
password: secret

First, make sure that you change the default password within the user settings of the UI.

Then change the Hotspot settings to wlan1 in order to use it for the access point. You can then also define the SSID and security settings.

Since Raspbian Stretch, hostapd is disabled at startup and no configuration is set-up. You will see this error when starting the hostapd service:

Failed to start hostapd.service: Unit hostapd.service is masked.

This can be fixed by unmasking:

sudo systemctl unmask hostapd
sudo systemctl enable hostapd

After running sudo reboot, the configuration for the access point has been filled by RaspAP. We can have a look with

sudo nano /etc/hostapd/hostapd.conf

It should look similar to this:

manufacturer=TP Link

Now you can also set the configuration file by doing the following:

sudo nano /etc/default/hostapd

Replace DAEMON_CONF by running sudo nano /etc/default/hostapd


Let’s now check if everything runs as expected after the last reboot:

sudo reboot

Check if you can still connect via ssh pi@raspberrypi.local. If it still works, you can still login by using the on-board wifi module of the Raspberry. If this is not the case, you should attach a keyboard to the Raspberry and look for errors in the logs. Have a look into journalctl -b -e if this is the case.

To be sure everything is configured correctly, you can run iw dev.

You can also check the status of both configured services:

sudo systemctl status hostapd.service
sudo systemctl status dnsmasq.service

If everything is running correctly, you can now connect to the network on your phone:

I hope this helps you converting your raspberry into a Wifi access point 😃.

You can also check out some of my other tutorials like using your Raspberry for retrieving GPRS signals 📝🤖.

Engineering Manager @ Babbel