Wifi does not connect or goes down

Well,
i can't see any mistakes in this. At least LAN seems to work, but i don't understand the problems you have with wifi.
Maybe you can outline this a bit more?
What did you configure (or thought to) with what values, what did you expect and what did you get instead?
Sorry for the dumb questions, but your statement

doesn't really help a lot.

At the moment it seems to be working then say if I reboot the device wifi may not work. For example I could doing opkg update or installing a package when wifi connection suddenly drops and will not restart if I reboot the device.

Just preformed an opkgupdate which worked but then I could not install nano.

root@OpenWrt:~# opkg update
Downloading https://downloads.openwrt.org/releases/22.03.0/targets/mediatek/mt7622/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/releases/22.03.0/targets/mediatek/mt7622/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/telephony/Packages.sig
Signature check passed.
root@OpenWrt:~# opkg install nano
Installing nano (7.1-1) to root...
Downloading https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/packages/nano_7.1-1_aarch64_cortex-a53.ipk
Collected errors:
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.0/packages/aarch64_cortex-a53/packages/nano_7.1-1_aarch64_cortex-a53.ipk, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_install_pkg: Failed to download nano. Perhaps you need to run 'opkg update'?
 * opkg_install_cmd: Cannot install package nano.

Are there any clues in the logs? Can you provide them for the time the issues occur

Your output says you are on OpenWrt 22.03.0. Can you upgrade to the latest version, OpenWrt 22.03.3?

Tried switching to a static ip address:

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 'fd7b:ae4f:9e47::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'

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'

config interface 'wan'
	option device 'wan'
	option proto 'dhcp'

config interface 'wan6'
	option device 'wan'
	option proto 'dhcpv6'

config interface 'wwan'
	option device 'wlan0'
	option proto 'static'
	option ipaddr '10.1.1.4'
	option netmask '255.255.255.0'
	option gateway '10.1.1.1'
	option broadcast '10.1.1.255'
	list dns '10.1.1.1'

However, diagnostic returned:



PING openwrt.org (139.59.209.225): 56 data bytes
64 bytes from 139.59.209.225: seq=0 ttl=47 time=345.246 ms
64 bytes from 139.59.209.225: seq=1 ttl=47 time=345.656 ms
64 bytes from 139.59.209.225: seq=2 ttl=47 time=346.722 ms
64 bytes from 139.59.209.225: seq=3 ttl=47 time=349.147 ms

--- openwrt.org ping statistics ---
5 packets transmitted, 4 packets received, 20% packet loss
round-trip min/avg/max = 345.246/346.692/349.147 ms

I still don't know what you're trying to achieve...or even how you set up your network.
Are you still trying this?

If yes, please state so. Didn't you wrote in that thread that you got it to work?
If you're on something different, please outline it detailed.
My crystal ball just shows foggy thingies, so i can't help you with that little bit of information you're sharing.

1 Like

I am trying to do that but I need to solve the wifi problem first.

I guess, you'll have to do this on your own.
We still don't know, what your problem is.
"Wifi doesn't work (sometimes)" is no help at all.

The network seems causing the problem but I am unsure how to fix it.

  • What does bad ping address mean? (I've only seen this error when the user entered an invalid address - simply enter a valid address to ping)
    • Can you just paste the results?

I don't see what you're referring to.

Here:

Show where?

I don't see a WiFi connection.

Wait, are you saying that your device doesn't get an IP from the upstream AP?

  • Have you checked the the AP
  • What channel is the upstream AP set to? (:spiral_notepad: it shouldn't use auto nor DFS channels)
  • Verify settings in /etc/config/wireless

You made a thread about this already: Wireless network scan goes down

What was the WWAN configuration when opkg update worked?

This network config has wifi but somehow the lan interface got stuffed up.


 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 'fd7b:ae4f:9e47::/48'
 
 config interface 'wan'
 	option device 'wan'
 	option proto 'dhcp'
 
 config interface 'wan6'
 	option device 'wan'
 	option proto 'dhcpv6'
 
 config interface 'wwan'
 	option proto 'static'
 	option device 'wlan0'
 	option ipaddr '10.1.1.4'
 	option netmask '255.255.255.0'
 	option gateway '10.1.1.1'
 	option broadcast '10.1.1.255'
        list dns '10.1.1.1'
 
 config interface 'lan'
 	option proto 'static'
 	option ipaddr '192.168.1.1'
 	option netmask '255.255.255.0'
 	option device 'br-lan'
 
 config device
 	option type 'bridge'
 	option name 'br-lan'
 	list ports 'lan1'
 	list ports 'lan2'
 	list ports 'lan3'
 	list ports 'lan4'
 
 config switch
         option name 'switch0'
         option reset '1'
         option enable_vlan '1'
  
 config switch_vlan
         option device 'switch0'
         option vlan '1'
         option ports '1 2 3 4 5t'
  
 config switch_vlan
         option device 'switch0'
         option vlan '2'
         option ports '0 5t'

Typically, the wifi device (wlan0 in this case) does not belong in the /etc/config/network file. This line should be removed. The wwan network should be associated with the sta mode wifi config in the /etc/config/wireless file.

Let's also take a look at your other config files, while we are at it:

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Although, I think it gets added in the network file but luci? I will have a closer look next time. As stated in the posted above yours I now have the wifi working but have encountered another problem.

This is related to the screenshot that says "connection failed"?
How is that computer connected to the router (wired or wireless)? Does it have a link? What about an IP address?

If you actually post all of the key config files, we may be able to spot the problems (so the 3 I mentioned and the network config, if anything has changed since post 16)..

1 Like

Well, yes! It was the lan interface which has the 4 ports bridged. One port connected via ether cable to my laptop and another connected via ethernet to my desktop machine.

Well, this problem is moot now since I managed to lock myself out of OpenWrt while trying to confirm your statement about wifi interface suppose to be in wireless file.

Sorry you are locked out. What did you change? The lan (especially the Ethernet ports) should not be affected by a change to the wan/wwan or the WiFi radio configuration, so it sounds like something else might be going on.

1 Like

I tried scanning for a network to connect to but while I was connected to said network. I was connected via wireless because of this issue with the lan settings.

Here is the default interfaces file, which works:


config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'

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'

config interface 'wan'
	option device 'wan'
	option proto 'dhcp'

config interface 'wan6'
	option device 'wan'
	option proto 'dhcpv6'

Default wifi

config interface 'wwan'
	option proto 'dhcp'

in the interfaces file

Please post the complete config files (the full contents of all 4 of the requested files). There isn’t enough information here to help you.

1 Like