Run through this step-by-step guide to set-up an access-point for a version 3.2 Realtek chipset wifi dongle on Raspian.
- Linux 4.14.98+ #1200 kernel
Check that your wifi dongle got recognized correctly after plugging it in.
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 https://raw.githubusercontent.com/RPi-Distro/rpi-source/master/rpi-source -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:
Follow the instructions from the repository:
sudo make all
sudo make install
sudo modprobe 8188eu
If everything has run successfully, you should see
Further, you should see the module as well, when running
sudo rebootand a new interface
wlan1 should show up when running
lsusb now also shows the device correctly
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 https://install.raspap.com | 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:
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
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:
Now you can also set the configuration file by doing the following:
sudo nano /etc/default/hostapd
DAEMON_CONF by running
sudo nano /etc/default/hostapd
Let’s now check if everything runs as expected after the last reboot:
Check if you can still connect via
ssh email@example.com. 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
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 📝🤖.