2

I am trying to create a wifi repeating Access Point on the Pi 4.

I used this guide to setup the AP using hostapd.

It says here that the hostapd.conf option hw_mode=g should ensure using the 2.4 ghz band.

However, the created AP is 5 Ghz, and since I'm gonna connect to the AP with a Rpi Zero W I need the AP to be 2.4 Ghz.

Any suggestion as to what is going wrong? Or how to force the Pi 4 to use 2.4 Ghz?

Kind regards

Duck Dodgers
  • 189
  • 1
  • 2
  • 15
XenonHawk
  • 29
  • 1
  • 2

2 Answers2

1

I suppose your internet router is using a 5 GHz band. As @jake already noted in his comment there is a limitation of the wifi device on the RasPi. In my tutorial you have used, you will find in section ♦ Details - hostapd (Step 2):

Please set the channel to the same value than wlan0 is connected to the wifi from your router. It is the restriction from the hardware and may avoid confusion with channel setting. hostapd will always set the channel to the same value than from the client connection, no matter what you set here.

You can configure the internet router to use only the 2.4 GHz band. Then the access point on the RasPi will also use the same channel.

If the internet router is using dual band, you can restrict the RasPi client connection for the uplink (wlan0) to only use specific frequencies. In /etc/wpa_supplicant/wpa_supplicant-wlan0.conf add one of these lines just above the network={} block (not inside it):

# for the 2.4 GHz band
freq_list=2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 2467 2472
# for the 5 GHz band
freq_list=5170 5180 5190 5200 5210 5220 5230 5240 5260 5280 5300 5320 5500 5520 5540 5560 5580 5600 5620 5640 5660 5680 5700

If you want to be independent from the uplink then you have to use an additional USB/WiFi dongle. How to use this you can look at Access point as WiFi router/repeater with additional WiFi-dongle.

Ingo
  • 42,961
  • 20
  • 87
  • 207
0

Your problem is likely that the STA connection on your PI is selecting the channel for the wifi adapter. This means the AP you are hosting will have the same channel as the STA (station) (hardware limitation). You can check this with "iw dev". The solution is to force the STA to only connect to 2.4GHz network -> AP will also stay on 2.4GHz. See bellow how to do this.

I was trying to connect to the 2.4GHz bssid of a network, and prevent switching to the 5GHz AP with the same SSID. The following options in wpa_supplicant.conf were not working:

  • bssid (connects to correct one, but then switches to other)
  • freq_list (connects to correct, but then switches to not allowed freq)
  • country code (ignored)
  • bssid_blacklist (switched to blacklisted bssid)

SOLUTION: use wpa_cli, and blacklist the 5GHz BSSID as: wpa_cli -i wlan0 blacklist <bssid>

It is possible to check the current blacklist with the same command, just omit the <bssid> part.

Gorg2331
  • 1
  • 2