If you need Wi-Fi in your attic or garden and happen to have a Raspberry Pi lying around, you don't have to buy a wireless access point anymore: you just make it yourself. You simply install the RaspAP software on your Raspberry Pi and then easily configure it via the built-in web interface. RaspAP can also be combined with an adblocker, VPN server, Tor or a captive portal.
01 Raspberry Pi with Wi-Fi
If you have a Raspberry Pi to spare, you can use it to set up a wireless network to which you can connect. It doesn't really matter which model of the Pi it is, although the latest model, the Raspberry Pi 4, does achieve the highest performance. You obviously need a WiFi chip, so you use at least a Raspberry Pi 3 or an older model that you expand via one of the USB ports with a WiFi adapter such as the Edimax EW-7811Un. For simplicity, let's assume you connect the Pi to your home network via an Ethernet cable.
02 Install Raspbian
Then you need to install Raspbian Buster Lite on your Pi.. In short: download Raspbian Buster Lite, write the image with balenaEtcher to a micro-sd card, enable ssh, boot the Pi and log on with an ssh client your Pi over the network. After that, change the default password and update all packages. After that, your Pi is ready to turn it into a wireless access point.
Wi-Fi performance of the Pi
There are important differences in Wi-Fi performance between the different Pi models. The Raspberry Pi Zero W(H) and Raspberry Pi 3 support 802.11n in the 2.4 GHz band. Benchmarks from the Raspberry Pi Foundation show that the first achieves a throughput of 25 Mbit/s and the second 50 Mbit/s. The Raspberry Pi 3B+, 3A+ and 4B support 802.11 b/g/n/ac in both the 2.4GHz and 5GHz bands. In the first band, the throughput of those models is around 60 Mbit/s and in the second around 100 Mbit/s, with an outlier for the Raspberry Pi 4B at 114 Mbit/s.
03 Additional configuration
In the terminal, start the Raspbian configuration program with the command sudo raspi-config, use the arrow keys to go to 4 Localization Options and press Enter. Then choose I4 Change Wi-Fi Country and then confirm your country. If you want the web interface of RaspAP to automatically recognize the language of your web browser when it is set to Dutch, open I1 Change Locale and use the spacebar to check the utf-8 version of your language in the list, for example nl_NL.UTF-8 for Dutch. Then tab to OK and confirm with Enter. You can use the default language in the next step en_GB.UTF-8 leave. Finally, exit the program with Finish.
04 Install raspAP
First, download the RaspAP installer with the command wget -q //git.io/voEUQ -O /tmp/raspap and then run the program with bash /tmp/raspap. Confirm with y and press Enter that you want to install RaspAP. You will then be shown which packages will be installed: confirm again with y and Enter. After the installation you will be asked a few questions about the configuration: confirm each time with Enter to choose the recommended configuration. At the very end you will be asked to restart your Pi: choose y and Enter to do that.
05 Web Interface
From now on you don't need the command line anymore. After the restart, your wireless access point will be active with raspi-webgui as ssid and ChangeMe as password. Connect to this wireless network: you will then be assigned an IP address and access to the internet via the ethernet interface of the Pi. Then visit the ip address 10.3.141.1 in your web browser. Log in to the web interface with admin as username and secret as password. You will now see the dashboard with some statistics about the access point, including a list of connected devices with their IP address and MAC address.
06 Set language
If your language is unexpectedly not in Dutch, click on the left System and then on the tab Language. There you can manually set your language. Save your change and reload the page. You may need to restart your Pi (this can be done in the System). If you still get to see the interface in English, check whether you really did nl_NL.UTF-8 as a language: this is how we noticed that RaspAP is the language nl_BE.UTF-8 not recognized as Dutch. When you have solved this, you will see everything in Dutch.
07 Hotspot Settings
First, check out the hotspot settings. Click on the left for this Configure hotspot. In the first tab you can change the SSID, the wireless mode and the channel (see also the box 'Choose which WiFi channel?'). Also look in the tab Advanced check if the country code is correct there. In the tab Security there is usually no reason to use the default choices WPA and TKIP to accept: choose the safer options WPA2 and CCMP. Also change the password ChangeMe. Save your settings and then restart your Pi or click (if you are not accessing the web interface via RaspAP's Wi-Fi network) Stop Hotspot and after that Launch hotspot.
08 Change password
In addition to the password for your ssid, you also need to change the password for the web interface of RaspAP. You do that in Configure authentication. Optionally you can also change the default username admin change. But the most important thing is that you remember the default password secret (that you at Old password enter) with a more secure password. Enter your new password twice and click Save settings. Then the web interface asks for the new password. It is important that both the ssid password and the password of your web interface are strong enough, so that unauthorized persons cannot access your network and the configuration of your hotspot.
Which WiFi channel to choose?
Which WiFi channel you set for RaspAP mainly depends on which channels are already in use in your area. If multiple wireless networks use the same channel, this often comes at the expense of connection speed. In addition, on the 2.4GHz band, those channels overlap, making it even more problematic. So the first step is to see which channels are already in use. This is possible under Android with an app such as Wifi Analyzer, in which you can also see the overlap of the channels. For RaspAP, choose a channel that overlaps as little as possible with the other networks.
09 Solving Connection Problems
If you are unable to connect to your Wi-Fi access point, go to Configure Hotspot / Advanced and toggle the option Log output in. click on Save settings and restart the hotspot with Stop Hotspot and after that Launch hotspot. After that you get in the tab log file logs that can point you to the source of your problems. For a solution, search for the error message you see in Google or on RaspAP's GitHub page.
10 Set up DHCP server
RaspAP runs a dhcp server on the wireless interface, which you can access via the menu Configure DHCP server can set. By default, it hands out IP addresses from 10.3.141.50 to 10.3.141.255, but you can change that. In the tab Client list you will see which dhpc leases are configured. In Static Leases configure your fixed ip addresses. You then enter the MAC address of a device and the IP address that it should be assigned. Then click add and then Save settings. This is especially useful if you want to run a server on one of the WiFi-connected devices or if you want to allow or disallow specific network traffic with a firewall based on the IP address.
11 Wireless instead of Ethernet
With RaspAP you can also set up a wireless access point in a place where you don't have an Ethernet connection. You then need to connect a second WiFi interface via USB to your Raspberry Pi, which you then use instead of an Ethernet cable to connect to your router. First open the configuration file of RaspAP with sudo nano /var/www/html/includes/config.php and change as a rule define('RASPI_WIFI_CLIENT_INTERFACE', 'wlan0'); wlan0 by means of wlan1. Save your change with Ctrl+O and exit nano with Ctrl+X. Then open the file with nano /etc/dhcpcd.conf and at the very end add the line nohook wpa_supplicant and place a hash (#) in front of the line static routers=10.3.141.1. Then run the command sudo systemctl restart hostapd.service from.
Https
By default, RaspAP's web interface runs on http, not the encrypted https. On the project's wiki you can find how to activate https support. In short, it comes down to this: you run your own local certificate authority (CA), create a certificate for RaspAP and sign it. Then you configure lighttpd, the web server used by RaspAP, so that it uses your certificate for encrypted communication with the web interface. Finally, you must also download the root certificate (from your own certificate authority) on every device with which you want to visit the web interface so that the certificate of RaspAP is trusted and gets a green lock in your web browser.
12 Configure Wifi Client
Then click on the left in the web interface of RaspAP Configure WiFi device and right on rescan. Choose the wireless network that serves as access to your home network for RaspAP. Enter the password for the correct network and click Add and then on Connect. Then turn on Configure Hotspot / Advanced the WiFi client AP mode in, click on Save settings and restart the hotspot. Incidentally, this is a step in which you can run into some problems. If something doesn't work, check the issues on RaspAP's GitHub page to see if anyone has had a similar problem and solved it.
13 Upgrade GratingAP
RaspAP is still under development. It is therefore recommended to regularly upgrade to the latest version. Unfortunately, this is not (yet) possible via the web interface and you have to type in a few commands. First find out what the latest version is, and whether it is newer than the version number you see in the top left corner of the RaspAP web interface. Then run the following commands on your Pi: go to the correct directory with cd /var/www/html, download the latest source code with sudo git fetch --tags and then install the desired version with (for example for version 1.6.1) sudo git checkout tags/1.6.1.
14 Remove grater
If you used RaspAP as a workaround, you may want to uninstall the program afterwards. Fortunately, RaspAP provides an uninstall script that not only removes all traces of the program itself, but also restores your system configuration files to the versions that RaspAP made a copy of during its installation. This includes the configuration of your network interfaces, dns and dhcp. To do this, go to the correct folder with cd /var/www/html/installers and run the script with ./uninstall.sh.
Integrate additional services
RaspAP can be expanded with additional services. Unfortunately, the integration is not yet complete, so you still have to do some configuration work in this area yourself. But on the wiki and in the issues of the GitHub page you will find additional information about this. For example, you can integrate an OpenVPN client so that all clients that connect to your access point surf through a specific VPN server. You can install Tor on your Pi so that all Wi-Fi clients will automatically surf the Tor network anonymously. And the adblocker Pi-hole can also work together with RaspAP to automatically block ads on all connected Wi-Fi clients.