Having weak WiFi signal in parts of your home can be frustrating. A simple solution is to build your own DIY WiFi extender using a Raspberry Pi to boost your wireless network's range.
Why Build a WiFi Extender
There are a few reasons you may want to build your own DIY WiFi extender:
-
Improve wireless coverage in dead zones or far corners of your home where your main router's signal doesn't reach well. An extender fills in weak spots.
-
Avoid buying expensive extenders. Pre-made extenders can cost $50-$100. A Raspberry Pi solution is cheaper.
-
Learn new skills. Building your own extender is a fun electronics project for Raspberry Pi fans.
-
Customize capabilities. DIY gives you control over the extender's software and functionality.
How a WiFi Extender Works
A WiFi extender (also called repeater) works by picking up the existing WiFi signal, amplifying it, and rebroadcasting it on a different channel. This effectively increases the range and coverage area of your wireless network.
The Raspberry Pi will connect to your main router wirelessly, then act as a middleman to relay the signal into areas that couldn't reach the router before. Devices in those "dead zones" can now connect to the Pi's repeated signal.
Choosing a Raspberry Pi Model
Any Raspberry Pi model with built-in wireless capabilities will work for a DIY extender. Here are some good options:
-
Raspberry Pi 3B+ - The Pi 3B+ has fast dual-band wireless radios making it a popular choice. It also has good wired Ethernet speeds.
-
Raspberry Pi Zero W - The tiny Zero W is the most compact and budget-friendly option. The smaller size makes it easier to hide away.
-
Raspberry Pi 4 - The newest Pi 4 has dual-band wireless and gigabit Ethernet. It's the fastest choice overall.
I would recommend the Pi 3B+ or Pi 4 for the best performance as an extender, unless size is a constraint. The Zero W will work but is slower.
Required Hardware and Software
To build your Raspberry Pi WiFi extender you'll need:
-
A Raspberry Pi board - Pi 3B+, Pi 4, Pi Zero W, or another model with built-in wireless LAN.
-
MicroSD card - To flash the Raspberry Pi OS software image onto. 8GB or larger recommended.
-
Power supply - The official USB-C power supply for your Pi model.
-
A case - To protect the Pi. Optional but recommended.
-
Software - Raspbian OS or Raspberry Pi OS. Any Linux distro with hostapd and dnsmasq will work.
Steps to Set Up the Extender
Once you have the required hardware, follow these steps:
1. Flash Raspberry Pi OS
Download the latest Raspberry Pi OS (formerly Raspbian) image and flash it onto your microSD card.
Insert the card into your Pi and power it on. Run sudo raspi-config
to set up the OS as needed.
2. Configure the Wireless Interface
Edit /etc/dhcpcd.conf and uncomment this line:
denyinterfaces wlan0
This prevents the Pi from grabbing a wireless IP address from your router which can cause conflicts.
3. Install Software
Run these commands to install the required software:
bash
sudo apt update
sudo apt install hostapd dnsmasq
Hostapd will handle the WiFi access point functions. Dnsmasq will manage DHCP and DNS services.
4. Configure Dnsmasq
Edit /etc/dnsmasq.conf and add:
interface=wlan0
dhcp-range=192.168.220.50,192.168.220.150,12h
This binds dnsmasq to the wireless interface and sets a DHCP range for devices connecting to the extender.
5. Configure Hostapd
Create a new hostapd config file:
bash
sudo nano /etc/hostapd/hostapd.conf
Add the following, replacing WiFi SSID and password with your own:
interface=wlan0
driver=nl80211
ssid=MyExtender
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=password123
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
This configures the wireless access point settings hostapd will use.
6. Update sysctl.conf
Edit /etc/sysctl.conf and uncomment:
```
net.ipv4.ip_forward=1
```
This enables IP forwarding required to route connections.
7. Create hostapd service
Create a new service file:
bash
sudo nano /etc/systemd/system/hostapd.service
Add:
```
[Unit]
Description=Hostapd WiFi Extender Service
After=syslog.target network.target
[Service]
Type=simple
ExecStart=/usr/sbin/hostapd /etc/hostapd/hostapd.conf
[Install]
WantedBy=multi-user.target
```
This will run hostapd when the Pi boots up.
8. Reboot and Connect Devices
Reboot your Raspberry Pi. It should now be broadcasting your new extender wireless network. Connect devices to test that it is extending your main router's signal range!
Optimizing the Extender
To get the best performance from your DIY Raspberry Pi WiFi extender, try these tips:
-
Position the Pi in a central location between your main router and weak signal areas. Avoid obstacles blocking the line of sight.
-
Use 5GHz 802.11ac wireless if your devices support it. This newer standard is faster and less crowded than 2.4GHz.
-
Set the extender's WiFi channel to be different than your main router's channel to reduce interference.
-
If speeds are slow, try an Ethernet backhaul instead of wireless backhaul to the main router.
With good placement and tweaked settings your homebrew Raspberry Pi extender should reliably expand your wireless network's coverage!