Hotspot Mode
Spin-up a 'portable AP' by turning your WLAN Pi into a test AP
Last updated
Was this helpful?
Spin-up a 'portable AP' by turning your WLAN Pi into a test AP
Last updated
Was this helpful?
The WLAN Pi platform may be switched between a number of "modes" to change the operational personality of the WLAN Pi. Modes available include: "Server Mode", "Wireless Console Mode" and the mode we're exploring in this lab: "Hotspot Mode".
The WLAN Pi Hotspot mode has been created to provide a quick and dirty wireless AP for tasks such as wall attenuation measurements. It will also provide a temporary wireless connection when you want to hook up to a switch ethernet port and extend the network connection out to a wireless client. Finally, it can be used to provide wireless access to the WLAN Pi itself if other connection methods such as Bluetooth or Ethernet are not available.
The Hotspot mode package was originally created using the information in François Vergès blog article: WLAN Pi - Setup a Wi-Fi Hotspot. This has been maintained and improved in the current WLAN Pi platform.
Hotspot mode can be activated and deactivated using the WLAN Pi front panel menu system. When switching to Hotspot mode and back to the original "Classic" mode, the WLAN Pi will reboot to reset all networking operations on the WLAN Pi for each mode.
In this lab, we'll look at how to switch into Hotspot mode, some of its features and how to re-configure it if required.
If you would like more details about Hotspot mode, please view the package software documentation at:
To complete this lab, you will need the following items:
A Windows laptop or Mac to browse to the WLAN Pi M4 and access Terminal
A WLAN Pi M4
A client device to join the AP (e.g. your smartphone)
For this lab, you'll need the WLAN Pi hooked up to a lab switch to obtain PoE power and Internet connectivity. In addition, you'll need an IP connection (provided by the lab wireless network) between your laptop/Mac and the WLAN Pi. This will provide access to the Terminal utility to execute CLI commands that form part of this lab.
In addition, when the WLAN Pi has been switched into Hotspot mode, a client device such as a smartphone will be needed to join the SSID provided by the WLAN Pi. The client device will have Internet access once associated to the SSID.
By default, when your WLAN Pi switches from Classic to Hotspot mode, it will use channel 6 in the 2.4 GHz band to broadcast its SSID.
In our deep-dive lab environment this will not be a great experience if everyone fires up their WLAN Pi on the same channel.
Therefore, before switching to AP mode, please edit the Hotspot configuration to change the channel used.
Hotspot mode may be configured to use any 2.4 GHz channel, or one of the non-DFS 5 GHz channels. The 5 GHz channels will usually be 36, 40, 48, 149, 153, 157, 161 & 165 in many regulatory domains, but check your local domain restrictions.
To set the Hotspot channel, we'll need to edit the configuration file as follows:
Open the Terminal utility to access the CLI of your WLAN Pi and change to the configuration directory as follows:\
We need to edit the file called "hostapd.conf" in this folder. We'll be using an editor called "nano" to modify the file. Nano is quite simple and friendly to use, keyboard arrow keys will allow you to move around the file. Add characters where required, and use your usual delete key to remove characters. When you've completed your updates, hit "Ctrl-X" to exit the editor (hit "Y" when prompted to save your changes):
The configuration entries you will need to update in the file are as follows:
hw_mode=g
channel=6
\
For all channels on the 2.4 GHz band, "hw_mode" can be left as "g". If you are going to set a 5 GHz channel, you will need to update it to "a". The "channel" field will need to be set to your chosen channel. For example, the settings for channel 149 would be:
hw_mode=a
channel=149
The settings for channel 11 would be:
hw_mode=g
channel=11
\
Once updates are complete, save the updated file by hitting "CTRL-X". Hit "Y" when prompted to save the changes.
We now have the Hotspot mode configured to use a channel of our choosing. Let's use the Hotspot mode to create a 'portable AP' on our chosen channel.
Use FPMS to switch into Hotspot mode: Modes > Hotspot
\
The WLAN Pi will reboot once Hotspot mode is selected. The reboot takes ~45 seconds
Once the WLAN Pi boots up, it should automatically start broadcasting an SSID
Check this with your Wi-Fi scanning tool of choice (look for an SSID in the format: "WLAN Pi xxx" - this will reflect the hostname of your WLAN Pi).
To join the WLAN Pi's SSID, confirm the SSID and passphrase via the FPMS option:
Utils > SSID/Passphrase
\
Use the details displayed to join the SSID. Create a new network connection by selecting the SSID and entering the passphrase on your smartphone.
Return to the home page of FPMS and note that it displays the status of Hotspot mode and includes details of the number of clients connected and the IP addresses used on the WLAN Pi for its LAN and wireless interfaces:\
While on the home page note that you can use the centre-press on the front panel joystick to reveal the QR code required to join the Hotspot mode SSID. If you have a second client, give it a try and see if your client will join the SSID via the QR code method. Alternatively, you can get your existing client to "forget" the SSID (if already joined) and try the QR code method, assuming the client device has a camera to scan the QR code.\
Disclaimer: bleeding edge, things may break or not work, and this is not supported.
The WLAN Pi's Hotpot mode is based on an open source package called hostapd which can be used to turn a Linux device into a wireless access point, providing it has a suitable network adapter.
Like other open source packages, hostapd evolves over time, adding new features and fixes in each release. The releases are then picked up by a variety of Linux distributions and included as part of that distribution.
At this point in time, there is a version of hostapd in development that supports 6 GHz. However, it has not been picked up for general use by many Linux distributions, including the WLAN Pi distribution. Although updates will be added in the future, we don't have them available as a standard package in our configured package archives.
However, to demonstrate Wi-Fi 7 (802.11be / EHT) and 6 GHz capability, we have put together a lab that will allow you to download and evaluate the latest & greatest hostapd code and see the Wi-Fi 7 (802.11be / EHT) and 6 GHz support for yourself.
However, please note that this will not permanently update hostapd (and hence Hotspot mode) to support 6 GHz. All changes made will be temporary and will not permanently update the WLAN Pi to provide a Wi-Fi 7 or 6 GHz Hotspot capability.
Also note that the WLAN module in your WLAN Pi is a Wi-Fi 6E module and not Wi-Fi 7. hostapd will not broadcast a complete set of 802.11be information elements. See if you can figure out which are missing.
To list out all 6 GHz channels available, run the following command on the Terminal CLI:
wifichannel -6
All channels will be listed, including the designated PSC channels
If you would like to try hostapd with Wi-Fi 7 (802.11be / EHT) and 6 GHz support, please follow the instructions below:
If not already in Hotspot mode, please switch your WLAN Pi into Hotspot mode
Access your WLAN Pi via the Terminal CLI
In the Terminal session, change into your home directory and download a "special" version of hostapd using the commands:
cd ~
wget https://github.com/WLAN-Pi/experimental/raw/main/hostapd_eht.zip
\
This will download the required zip file to your WLAN Pi in the home directory (~/
)\
Extract the hostapd software and the required configuration file as follows:
unzip hostapd_eht.zip
Check that for three files "hostapd
", "5ghz_eht.cfg
", and "6ghz_eht.cfg
" are present using the command "ls -l
" to list all files:\
Before running the new code, edit the "5ghz_eht.cfg
" and "6ghz_eht.cfg
" files using the nano CLI editor (sudo nano 5ghz_eht.cfg
) and configure your own unique SSID for both.
This will help conflicts with other students in the class who fire up their WLAN Pi to do the same lab:\
To run the new instance of hostapd we need to stop the existing, pre-installed instance of hostapd that is used by Hotspot mode. We'll then run up the modified instance of hostapd that we just downloaded, to provide a 6 GHz version of Hotspot mode. Please execute the following commands:
sudo systemctl stop hostapd
sudo ./hostapd 6ghz_eht.cfg
The new Wi-Fi 7 6 GHz-enabled version of hostapd will now be running. Check for the new SSID with a scanner if available, and try to join with a Wi-Fi 6E or Wi-Fi 7 client.\
To stop the hostapd process, press CTRL-C in the Terminal CLI. This will kill the hostapd process, and the 6 GHz SSID will no longer be available.
Optionally, try steps 7-8 with sudo ./hostapd 5ghz_eht.cfg
Once you have completed your testing, flip the WLAN Pi back into Classic mode (via FPMS). The WLAN Pi will return to normal operation. If you flip back into Hotspot mode, note that it will no longer operate in 6 GHz mode, as the standard hostapd binary will be used, rather than the special binary that we used in the lab above.
Well done, you've completed the Hotspot Mode lab!
Please ensure you flip your WLAN Pi back into Classic mode before you move on to the next lab.