Raspberry Pi 4B restart, the wireless cannot connect

I'm using openwrt 23.05.2 ext4 on Raspberry Pi 4B.

I noticed that when I power off and then restart the device, the wireless network cannot connect properly. In my android phone, the wireless cannot connect. In my laptop. I can connect the wireless, but I can't visit any other devices. I tried both DHCP and static IP on my laptop, but neither can access the OpenWRT gateway or other devices.

Here are my settings:
I created a PPPoE interface for dialing and a LAN interface bound to the AP 5G.
network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd92:62d7:a8cb::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config interface 'lan'
        option device 'phy0-ap0'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option proto 'pppoe'
        option device 'eth0'
        option username '***'
        option password '***'
        option ipv6 'auto'

wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option channel '36'
        option band '5g'
        option htmode 'VHT80'
        option country 'CN'
        option disabled '0'
        option cell_density '0'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'Immortal'
        option encryption 'psk2'
        option key '***'

Edit br-lan so that it looks like this (remove eth0):

config device
        option name 'br-lan'
        option type 'bridge'
        option bridge_empty '1'

And edit the lan to use br-lan instead of the current device:

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

Reboot and try again.

Also, FWIW, the pi's wifi is terrible in every respect. If this is a travel router or similar, that's not necessarily a big deal. But if this is your main AP, you should consider getting a proper wifi access point because you'll have much better performance even with something that might be a bit older.

I really appreciate your answer, it really worked. It seems you just removed the eth0 interface from the bridge device. Why does that work?

Btw, I also noticed that the Pi's WiFi isn't great. I'm using it because I'm temporarily living in a new place for a few months without any network devices. Is there any guide or documentation to help me learn this OS? Both this router OS and the official documents are complex.

There were two issues...

  1. The bridge device was using eth0 as was the wan interface. The ethernet port cannot be used twice in this situation (it can with VLANs, but that's probably not relevant here). So I removed it from the bridge since it no longer belonged there.
  2. The lan interface had the wifi radio specified. The radio should only be listed in the wireless file, and the connection to the network is made using the option network 'lan' line that is found in the SSID config stanza. My guess is that the radio didn't come up in time for the lan interface, and that is what caused the issue. By using the bridge, the network interface can be established and the radio can connect to the interface via the bridge, thus preventing any time-sensitive issues.

https://openwrt.org/docs/guide-quick-start/start

Thank for your reply.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.