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

  • Can you list ifconfig or ip addr? – kuzeyron Jul 26 at 11:00
  • What is your channel in hostapd.conf ? sudo cat /etc/hostapd/hostapd.conf |grep channel, sudo iwlist wlan0 channel – Ephemeral Jul 26 at 12:52
  • from hostapd.conf : # Please note that some drivers do not use this value from hostapd and the # channel will need to be configured separately with iwconfig. – Ephemeral Jul 26 at 13:17
  • To what channel your RPI is connected? 5 Ghz? Did your read the tutorial carefully? »The important part is #{ managed } <= 1, #{ AP } <= 1, but you can also see that this is only possible on one channel.« – jake Jul 26 at 14:26
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.

  • Thank you for the reply @Ingo. The freq_list does not seem to work though. I tried running iwconfig wlan0 channel 1, followed by ifconfig wlan0 down and ifconfig wlan0 up. iwconfig shows the wlan0 interface to be 2.4 ghz for a small amount of time. But as soon as the wifi connects it switches to 5 ghz. The router is dual band, and the Pi3b+ had no problems connecting and creating the hotspot. Do you have any other suggestions? Thank you – XenonHawk Jul 29 at 8:44
  • @XenonHawk What you described is everything as expected, so there seems not to be a general configuration error. My last successful usage with freq_list= was on a RPi 3B+. Maybe it doesn't work on a RPi 4B? But can't believe it because the wifi device on both RasPis hasn't changed. The problem is that you must make the RasPi to connect stable to the 2.4 GHz band from the internet router. I would just disable the access point on RPi 4B for testing and only try to connect it with his client connection on the 2.4 GHz band. – Ingo Jul 30 at 9:21
  • @XenonHawk Are there other devices on your network that are using the 2.4 GHz band from the internet router? – Ingo Jul 30 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.