Raspberry Pi 4 wifi will not work

/etc/wireless

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

config wifi-iface 'default_radio0'
	option device 'radio0'
	option mode 'ap'
	option key 'xxxxxxxxxx'
	option ifname 'wlan0'
	option ssid 'OpenWrt'
	option encryption 'psk2'
	option network 'lan'

/etc/network

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

config interface 'lan'
	option type 'bridge'
	option device 'eth0'
	option proto 'static'
	option ipaddr '192.168.2.1'
	option netmask '255.255.255.0'
	option gateway '192.168.1.254'
	option ip6assign '60'

config interface 'wan'
	option device 'eth1'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option gateway '192.168.1.254'
	option ip6assign '60

Release is 20.02 RC3with all updates as of today 05/07/2021

My config files are above but no matter what I try that I can find suggested on the forums I cannot get wifi to work. It just sits forever trying to connect and when it does finally connect there is no internet access. I have been through dozens of posts trying the suggestions but it just will not work. The lan and wan work fine with internet access from the lan. Any ideas anyone?

I have found since posting that it only issues an ipv6 address never an ipv4 :frowning:

Who's it?

Same it?

I don't understand what you are asking?

Colin

Neither do I, that's why I was asking :slight_smile:

On my other raspberry pi 4 or my phone they sit there for ages when told to connect to the openwrt wifi trying to get an ip ddress on the network. The lan is 192.168.2.x which is what the wifi is set to in the config.
From the raspberry pi:-

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 169.254.215.56  netmask 255.255.0.0  broadcast 169.254.255.255
        inet6 fe80::5f14:2aba:e6e5:5384  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:ae:a0:7c  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 36  bytes 6112 (5.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

From openwrt.

wlan0     Link encap:Ethernet  HWaddr DC:A6:32:F2:3A:D8  
          inet6 addr: fe80::dea6:32ff:fef2:3ad8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:48 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6412 (6.2 KiB)  TX bytes:3722 (3.6 KiB)

As you can see it does not get an ip from the network and I have tried dozens of fixes found in the forums and nothing will work.

Colin

This is normal, the IP sits on the br-lan.

1 Like

option gateway should appear at most once in any configuration-- in the network that is connected to the Internet, which is wan in this case. Take it out of lan.

Also with a static wan setup you need an option dns in wan to point the router to an upstream DNS server. This is usually the next router (which appears to be 192.168.1.254 here) or it can be a third party on the Internet.

After doing this confirm that basic IPv4 networking works:

  • On the router CLI, you can ping sites by name, and by number.
  • A laptop etc connected to eth0 receives a DHCP IP in 192.168.2.0 and can reach the Internet.

At that point the wifi AP should also work, since it is in the lan bridge along with eth0.

Hi mk24 thanks for the reply. I have done as you said but made the wan use dhcp so it is configured by the router 192.168.1.254 and will gets an ip and gateway from it.

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

config interface 'lan'
        option device 'eth0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.2.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option device 'eth1'
        option proto 'dhcp'
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 552  bytes 51158 (49.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 552  bytes 51158 (49.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5f14:2aba:e6e5:5384  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:ae:a0:7c  txqueuelen 1000  (Ethernet)
        RX packets 38  bytes 12464 (12.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 725  bytes 102435 (100.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
ping www.openwrt.org
PING wiki-01.infra.openwrt.org (139.59.209.225) 56(84) bytes of data.
64 bytes from wiki-01.infra.openwrt.org (139.59.209.225): icmp_seq=1 ttl=51 time=49.7 ms
64 bytes from wiki-01.infra.openwrt.org (139.59.209.225): icmp_seq=2 ttl=51 time=50.4 ms
64 bytes from wiki-01.infra.openwrt.org (139.59.209.225): icmp_seq=3 ttl=51 time=55.1 ms
^C
--- wiki-01.infra.openwrt.org ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 5ms
rtt min/avg/max/mdev = 49.735/51.765/55.149/2.408 ms

As you can see it still does not issue an ip to the wireless interface on my desktop pi but if I connect it via a lan cable it all works fine.

It always did, only the wifi access point did not issue any connecting device an ipv4 address and still doesn't.

Thanks

Colin

whatsup with this? can you point me to a reference?

The network wifi interface on my desktop pi 4 not the openwrt router but the router also has a wlan0

ifconfig
eth0      Link encap:Ethernet  HWaddr DC:A6:32:F2:3A:D7  
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::dea6:32ff:fef2:3ad7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5870 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5791 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1089298 (1.0 MiB)  TX bytes:2770893 (2.6 MiB)

eth1      Link encap:Ethernet  HWaddr F8:E4:3B:08:BD:C7  
          inet addr:192.168.1.38  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::fae4:3bff:fe08:bdc7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5040 errors:4965 dropped:0 overruns:0 frame:4965
          TX packets:3735 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2134218 (2.0 MiB)  TX bytes:857079 (836.9 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1212 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1212 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:104536 (102.0 KiB)  TX bytes:104536 (102.0 KiB)

wlan0     Link encap:Ethernet  HWaddr DC:A6:32:F2:3A:D8  
          inet6 addr: fe80::dea6:32ff:fef2:3ad8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:49 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7015 (6.8 KiB)  TX bytes:1324 (1.2 KiB)

That shouldn't hurt anything but it is rare that you'd want to name a wifi interface rather than let OpenWrt use automatic naming. Which will for the first and only AP usually end up 'wlan0'.

The important thing is the option network in /etc/config/wireless which will connect the AP (whatever it is named) to one of the networks in /etc/config/network. Don't refer to wifi interfaces from the other way (don't mention them in /etc/config/network).

brctl show should show that wlan0 is in br-lan along with eth0. And if you have that, wired and wireless clients should work the same.

If your network is IPv4 only, turn off the IPv6 options on lan in /etc/config/dhcp.

1 Like

mk24

The OS names it as wlan0 on all my raspberry pi's should it be radio0?

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

config wifi-iface 'default_radio0'
        option device 'radio0'
        option mode 'ap'
        option key 'xxxxxxxx'
        option ssid 'OpenWrt'
        option network 'lan'
        option encryption 'psk2+tkip+ccmp'

root@OpenWrt:~# brctl show
root@OpenWrt:~#

it shows nothing :frowning:

I have done that and restarted the unit but still no ip issued.

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5f14:2aba:e6e5:5384  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:ae:a0:7c  txqueuelen 1000  (Ethernet)
        RX packets 38  bytes 12464 (12.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 985  bytes 148733 (145.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Many Thanks for your help
Colin

This should have created a br-lan which would appear in ip, ifconfig and brctl. However it is the old syntax. If you're running a snapshot build you may need the new way to build a bridge, and a network for it separately:

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

config interface 'lan'
    option proto 'static'
    option ipaddr '192.168.2.1/24'
    option device 'br-lan'
    option ip6assign '60'
1 Like

Resolved

mk24

Hooray :smiley: :smiley: :smiley: :smiley: changing things to the above has got wifi working. So happy now many thanks. It wouldn't work at first but came back after eating my meal and it works. :smiley: :smiley: :smiley: :smiley:

Colin

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