Raspberry pi 4 access point

Hi all !
I'm very new to OpenWRT and Raspberry, so if I look dumb, please forgive me.

So, like the title say, i'm trying to install OpenWRT on a raspi 4 to have a wi-fi access point. I installed the snapshot found here : https://openwrt.org/toh/raspberry_pi_foundation/raspberry_pi
I have enabled the wlan0 by setting the country code (I had to use raspbian, like said on the documentation) and editing the /etc/config/wireless file to set option disable '0'. Then, I restarted the network and now I have this error showing every few seconds :
ieee80211 phy0: brcmf_cfg80211_start_ap: Set Channel failed: chspec=57386, -52
This is my /etc/config/wireless :

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '36'
        option hwmode '11a'
        option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option htmode 'VHT80'
        option disabled '0'
        option country 'FR'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

Plus, I have another question (but maybe I have to do a second post ?) : I have enabled my eth0 to use dhcp and I can access Internet from my pi. I can ping it from another machine in my network but I can't access the web GUI page to activate the access point mode (even though I see option mode 'ap' in my /etc/config/wireless), set the SSID, ...
Did I miss something to enable it ?

Thank you very much

What does iw list say?

For the luci, you need to install it manually. Snapshot versions don't include it.

https://openwrt.org/faq/can_not_connect_via_webbrowser

What does iw list says?
It says this :

Wiphy phy0
        max # scan SSIDs: 10
        max scan IEs length: 2048 bytes
        max # sched scan SSIDs: 16
        max # match sets: 16
        max # scan plans: 1
        max scan plan interval: 508
        max scan plan iterations: 0
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Device supports T-DLS.
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * P2P-client
                 * P2P-GO
                 * P2P-device
        Band 1:
                Capabilities: 0x1022
                        HT20/HT40
                        Static SM Power Save
                        RX HT20 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 16 usec (0x07)
                HT TX/RX MCS rate indexes supported: 0-7
                Frequencies:
                        * 2412 MHz [1] (20.0 dBm)
                        * 2417 MHz [2] (20.0 dBm)
                        * 2422 MHz [3] (20.0 dBm)
                        * 2427 MHz [4] (20.0 dBm)
                        * 2432 MHz [5] (20.0 dBm)
                        * 2437 MHz [6] (20.0 dBm)
                        * 2442 MHz [7] (20.0 dBm)
                        * 2447 MHz [8] (20.0 dBm)
                        * 2452 MHz [9] (20.0 dBm)
                        * 2457 MHz [10] (20.0 dBm)
                        * 2462 MHz [11] (20.0 dBm)
                        * 2467 MHz [12] (20.0 dBm)
                        * 2472 MHz [13] (20.0 dBm)
                        * 2484 MHz [14] (disabled)
        Band 2:
                Capabilities: 0x1062
                        HT20/HT40
                        Static SM Power Save
                        RX HT20 SGI
                        RX HT40 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 16 usec (0x07)
                HT TX/RX MCS rate indexes supported: 0-7
                VHT Capabilities (0x00001020):
                        Max MPDU length: 3895
                        Supported Channel Width: neither 160 nor 80+80
                        short GI (80 MHz)
                        SU Beamformee
                VHT RX MCS set:
                        1 streams: MCS 0-9
                        2 streams: not supported
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT RX highest supported: 0 Mbps
                VHT TX MCS set:
                        1 streams: MCS 0-9
                        2 streams: not supported
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT TX highest supported: 0 Mbps
                Frequencies:
                        * 5170 MHz [34] (20.0 dBm)
                        * 5180 MHz [36] (20.0 dBm)
                        * 5190 MHz [38] (20.0 dBm)
                        * 5200 MHz [40] (20.0 dBm)
                        * 5210 MHz [42] (20.0 dBm)
                        * 5220 MHz [44] (20.0 dBm)
                        * 5230 MHz [46] (20.0 dBm)
                        * 5240 MHz [48] (20.0 dBm)
                        * 5260 MHz [52] (20.0 dBm) (radar detection)
                        * 5280 MHz [56] (20.0 dBm) (radar detection)
                        * 5300 MHz [60] (20.0 dBm) (radar detection)
                        * 5320 MHz [64] (20.0 dBm) (radar detection)
                        * 5500 MHz [100] (20.0 dBm) (radar detection)
                        * 5520 MHz [104] (20.0 dBm) (radar detection)
                        * 5540 MHz [108] (20.0 dBm) (radar detection)
                        * 5560 MHz [112] (20.0 dBm) (radar detection)
                        * 5580 MHz [116] (20.0 dBm) (radar detection)
                        * 5600 MHz [120] (20.0 dBm) (radar detection)
                        * 5620 MHz [124] (20.0 dBm) (radar detection)
                        * 5640 MHz [128] (20.0 dBm) (radar detection)
                        * 5660 MHz [132] (20.0 dBm) (radar detection)
                        * 5680 MHz [136] (20.0 dBm) (radar detection)
                        * 5700 MHz [140] (20.0 dBm) (radar detection)
                        * 5720 MHz [144] (disabled)
                        * 5745 MHz [149] (13.0 dBm)
                        * 5765 MHz [153] (13.0 dBm)
                        * 5785 MHz [157] (13.0 dBm)
                        * 5805 MHz [161] (13.0 dBm)
                        * 5825 MHz [165] (13.0 dBm)
        valid interface combinations:
                 * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
                   total <= 3, #channels <= 2
                 * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
                   total <= 4, #channels <= 1
        Supported extended features:
                * [ DFS_OFFLOAD ]: DFS offload

Thank you trendy and tmomas for your answers on LuCI :slight_smile:

Try to delete and recreate the wireless config file:
rm /etc/config/wireless; wifi config; sed -i '/disabled/ s/1/0/g' /etc/config/wireless; wifi up

OK, if I do this, I do not have the error message again.
But there is no wifi network from my pi. I also tried to connect my pi to an existing wifi network from LuCI but the scan does not show any network (but there is at least one : my phone and my computer are connected to it :wink: ).

What does wifi status report?

This replies this :

{
        "radio0": {
                "up": true,
                "pending": false,
                "autostart": true,
                "disabled": false,
                "retry_setup_failed": false,
                "config": {
                        "channel": "36",
                        "hwmode": "11a",
                        "path": "platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1",
                        "htmode": "VHT80",
                        "disabled": false
                },
                "interfaces": [
                        {
                                "section": "default_radio0",
                                "ifname": "wlan0",
                                "config": {
                                        "mode": "ap",
                                        "ssid": "OpenWrt",
                                        "encryption": "none",
                                        "network": [
                                                "lan"
                                        ],
                                        "mode": "ap"
                                }
                        }
                ]
        }
}

I keeped on searching but found nothing yet.
Any clue, someone ?

Thank you very much by advance

I am out of ideas :frowning:

What does iw dev show?

If the AP is fully set up you'll see lines for SSID and channel.

I don't think the Pi hardware can do AP and STA at the same time. Configure only one interface the AP on the radio.

I have tried this with multiple USB devices and the Pi hardware and can not get the AP mode to load and start at all with OpenWRT

No problem, you've already helped me very much, thanks :wink:

I don't want AP and STA at the same time, I just want AP...
iw dev says this :

root@OpenWrt:/# iw dev
phy#0
        Interface wlan0
                ifindex 3
                wdev 0x1
                addr dc:a6:32:3b:1a:db
                type AP
                channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
                txpower 31.00 dBm

@Coddigtion : I don't understand your message, I'm sorry

I have a PI 4 and no matter the configuration or the adapter I can not get it to have an AP mode.

I was under the impression that the adapter is 5GHz only. Weird that the wifi config didn't detect the 2,4GHz radio.

This also looks too much for 2,4GHz. For 5GHz it's okayish, although it conflicts with what iw list says.

Maybe we have to wait a stable release ?

@trendy : I'm not good enough in network to understand all what you said, I totally trust you on this ^^

I use this settings on the PI 4, on 5GHz:

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '36'
	option hwmode '11a'
	option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
	option legacy_rates '0'
	option country 'US'
	option htmode 'VHT20'

on 2,4GHz :

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
	option legacy_rates '0'
	option country 'US'
	option hwmode '11g'
	option channel '7'

or

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
	option legacy_rates '0'
	option country 'US'
	option hwmode '11g'
	option channel '7'
	option htmode 'HT20'
	option short_gi_40 '0'
1 Like

This works ! :heart_eyes:

thank you very much !

3 Likes

Weird that 11a (5 GHz) does not work but 11g (2,4 GHz does)... Maybe the available drivers don't support 5 GHz? A lot of Broadcom stuff has footnotes like that.

What wireless hardware is this exactly? I'm not familiar with the RPi4. Out of curiosity.

I first thinked : "maybe it worked in 5 GHz but I think I don't have a device that supports wifi 5 GHz, so I didn't saw it worked".
But then I searched on the Internet the compatibility for my phone (OnePlus 6) and it seems that it is compatible with 5GHz wifi.

I didn't even tried jeff1's configuration for 5GHz, so maybe I had a problem in my conf...