Raspberry Pi Wireless Access Point

by SuitableBat9 in Circuits > Raspberry Pi

279 Views, 2 Favorites, 0 Comments

Raspberry Pi Wireless Access Point

Raspberry-Pi-WiFi-Access-Point-VPN-v3.png

A Raspberry Pi wireless access point is a great way to extend the length of your Wi-Fi coverage and provide additional access to your network.


This tutorial will show you how to set up a Wi-Fi access point using your Raspberry Pi. A wireless access point sometimes goes by “hotspot”, but it is essentially the same thing.

The process of setting up your Pi as a Wi-Fi hotspot has been made simple thanks to the Pi’s usage of the Network Manager. Older methods used to require you to configure several pieces of software that could prove quite unstable.

One crucial thing to remember is that your Raspberry Pi’s inbuilt Wi-Fi or a Wi-Fi dongle will most likely not be able to handle as much traffic as a regular router. This means you should avoid allowing too many connections to the device to prevent it from becoming overburdened and slow.

Supplies

While you can use any Wi-Fi dongle that supports being enabled as an access point, this tutorial will directly focus on how to set this up for the Raspberry Pi’s built-in Wi-Fi module. If you are using an early model of the Raspberry Pi, you can purchase a Wi-Fi adapter that supports being utilized as an access point from numerous websites. Make sure you research before buying to make sure it works on the Pi.

Additionally, the newer the Raspberry Pi, the better experience you will have with setting up an access point. Newer Pi’s have better processing power and have had improvements to how it’s networking works at a hardware level.

Preparing Your Pi

Before we set up the Raspberry Pi as a Wi-Fi access point, you will want to ensure that you are running an updated operating system. This ensures that we have the latest version of Network Manager.

Use the following two commands to update the package list cache and upgrade any out-of-date packages.

sudo apt update
sudo apt upgrade -y

The first command updates the package list cache. This cache contains a list of the packages you can install, their version, and where apt can download them.

The second command uses the updated package list cache to find and update any out-of-date packages.

Getting the Wi-Fi Device to Hotspot From on Your Raspberry Pi

With your Raspberry Pi now up to date, you will need to get the name of your Wi-Fi device so you can hotspot from it.

Your Wi-Fi adapter will need to support access point mode, which luckily for us, all the Pi’s built-in Wi-Fi supports.

Use the following command to get a list of Wi-Fi capable devices available on your Raspberry Pi. Typically, on most setups your wireless device will use the name “wlan0“.

iwconfig

Below you can see a list of network devices this tool found on our Pi. We only have one Wi-Fi adapter available to us which is “wlan0“. There is a chance your adapter might use a different name.

lo no wireless extensions.

eth0 no wireless extensions.

wlan0 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=31 dBm
Retry short limit:7 RTS thr:off Fragment thr:off

Power Management:on

Configuring a Wi-Fi Access Point on Your Raspberry Pi

Once you know the device name for your Wi-Fi adapter, we can configure your Raspberry Pi to act as a wireless access point.

Luckily, the Network Manager tool, which was discussed earlier, will handle most of the hard work.

To change your Raspberry Pi’s Wi-Fi into hotspot/access point mode, use the following command.

While typing out this command, there are a few details that you must replace with your own.

  1. <DEVICE>: This is the device name assigned to your Raspberry Pi’s Wi-Fi adapter. In the vast majority of cases, this should be “wlan0“.
  2. <SSID>: Replace this placeholder with the name you want broadcast by your access point. It is the ID that will be used by others when connecting to your hotspot.
  3. <PASSWORD>: The last value you must replace is the password that will be used to secure your Raspberry Pi’s Wi-Fi access point.
sudo nmcli d wifi hotspot ifname <DEVICE> ssid <SSID> password <PASSWORD>

5. We can verify that the Wi-Fi hotspot has been created using the “nmcli” tool to output all connections.

nmcli con show

Below is a list of connections that exist on our Pi. At the top, you can see that we now have a connection called “Hotspot” with the device set to “wlan0“.

NAME UUID TYPE DEVICE
Hotspot 59f9160c-b49f-47a2-ac54-87987f743df2 wifi wlan0
Wired connection 1 9d27eb3e-7657-3a54-ad8a-344cb4bb56e3 ethernet eth0
lo a54edcc4-0ffa-4090-a2b3-081905aee1c5 loopback lo
preconfigured 6e07c33c-9764-4145-af3f-49875c8a9342 wifi --

Another cool feature of the Network Manager tool is that it can generate QR codes that you can use to access your Wi-Fi hotspot easily.

All you need to do to get the “nmcli” tool to generate this code is to use the following command.

nmcli dev wifi show-password

Troubleshooting Your Wireless Access Point

You should now have a Wi-Fi hotspot broadcasting from your Raspberry Pi. Hopefully, everything is working correctly, but you should test the internet connection before proceeding.


If you have issues connecting to your access point despite entering the correct password, you may have to disable the network stack’s protected management frames functionality.

While this functionality helps with security, it can cause issues with certain Wi-Fi adapters and clients.

Disabling this functionality is as simple as using the following command within the terminal.

sudo nmcli con modify Hotspot wifi-sec.pmf disable

Hopefully, you can now access your new Raspberry Pi Wireless Access Point without any more issues.