[Solved]Unable to setup wifi on openwrt 4.19.01 raspberry pi 4[Solved]

Hello,
Appreciate if some one can help me with wifi on raspberry pi. Its not working.
Here are my settings:

/etc/config/network

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

config globals 'globals'
        option ula_prefix 'fd1e:04b0:3594::/48'

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

config interface 'wan'
        option ifname 'wlan0'
        option proto 'dhcp'

/etc/config/wireless

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

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

Is the wifi bridged to the lan or the only member of wan? (hint: it's both)
What are you trying to achieve there?

1 Like

Thanks for the reply, what I am trying is to have wifi enabled and ip should be dynamic.
what change would you suggest?

Regards.

I mean is the wifi supposed to be a client to some other access point? Or an access point itself? Or both?

Let me be clear, i have wifi in the house, three devices already using this wifi. Now this raspberry pi also need to connect to this wifi, so that I can connect to internet and install software. This is all my first focus.
Hope i explained.
Regards.

So it is the first option?

Thanks, yes is the first option.
Regards

Then remove the ifname wlan0 from wan interface, create a new ssid in station mode, add the details of the access point and assign it to wan interface.

1 Like

I made this change in /etc/config/network

config interface 'wan'
        option proto 'dhcp'
        option mode 'sta'
        option ssid 'myid'
        option key 'mykey'

I did execute: wifi down; sleep 4; wifi up
But when I do : ping www.google.com does not work ?
Regards.

Apologies, is that's what I am supposed to make the change?
Regards

No, this is not how it is done.
The wireless settings go to the wireless config file. In network config file you should only remove the ifname wlan0 from wan.
Better do the changes in the Luci webgui to avoid locking yourself outside.

I dont have luci installed, it is a raspberry pi image that does not have GUI interface.
Regards.

Now, the looks like this. But still wifi connection does not seem to work ? appreciate help so for.

/etc/config/network

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

config globals 'globals'
        option ula_prefix 'fd1e:04b0:3594::/48'

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

config interface 'wan'
        option proto 'dhcp'

/etc/config/wireless

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

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'sta'
        option ssid 'XX5G'
        option key 'XXX'
        option encryption 'psk2'
1 Like

Wow, it works now!! I made a small change in wireless, to use wan instead of lan.
Lot of thanks to you, for your help!
Regards

1 Like

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

Thanks, just marked it as Solved.
Regards.

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