WiFi does not turn on automatically on startup

Hello team,

I am facing an issue where every time I reboot my OpenWRT, the WiFi does not turn on automatically. I have to manually enter wifi in the CLI to make it appear again. What can be done so that I don't have to do this on every reboot of the OpenWRT?

Below is my WiFi config

root@openwrt-wifi-radios:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:10.0'
        option channel '36'
        option band '5g'
        option htmode 'HE80'
        option cell_density '0'
        option country 'US'

config wifi-iface 'wifinet1'
        option device 'radio0'
        option mode 'ap'
        option ssid '1 2 3 GO'
        option encryption 'psk2'
        option key 'password'
        option network 'lan'
        option disabled '0'

config wifi-iface 'wifinet2'
        option device 'radio0'
        option mode 'sta'
        option network 'wwan'
        option ssid 'Mom Click Here For Wifi'
        option encryption 'psk2'
        option key 'password'

root@openwrt-wifi-radios:~#

Thank you for any insight!

This is probably the issue... when you run a sta mode configuration on a single radio device, this connection must be established first before the wifi AP can come up. This is because the channel selection is dependent on the upstream AP.

With that in mind, you should set your radio configuration to use auto for the channel, and you should consider installing travelmate to help resolve issues if/when the upstream connection cannot be established.

Also, you didn't mention what device and OpenWrt version you're using:

ubus call system board
1 Like

ubus call system board

root@openwrt-wifi-radios:~# ubus call system board
{
        "kernel": "5.15.137",
        "hostname": "openwrt-wifi-radios",
        "system": "Intel(R) N100",
        "model": "QEMU Standard PC (i440FX + PIIX, 1996)",
        "board_name": "qemu-standard-pc-i440fx-piix-1996",
        "rootfs_type": "ext4",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.2",
                "revision": "r23630-842932a63d",
                "target": "x86/64",
                "description": "OpenWrt 23.05.2 r23630-842932a63d"
        }
}
root@openwrt-wifi-radios:~#

Thank you for your response. It makes perfect sense to me. I will check out the travelmate packages.

Thanks!

I have installed/enabled travelmate and also removed the STA configuration. However, the WiFi still does not start automatically. What else can I check? Thanks!

Below is the updated config files:

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:10.0'
        option channel 'auto'
        option band '5g'
        option htmode 'HE80'
        option cell_density '0'
        option country 'US'

config wifi-iface 'wifinet1'
        option device 'radio0'
        option mode 'ap'
        option ssid '1 2 3 GO'
        option encryption 'psk2'
        option key 'password'
        option network 'lan'
        option disabled '0'

root@openwrt-wifi-radios:~# cat /etc/config/travelmate

config travelmate 'global'
        option trm_enabled '1'
        option trm_captive '1'
        option trm_proactive '1'
        option trm_netcheck '0'
        option trm_autoadd '0'
        option trm_mail '0'
        option trm_debug '1'
        option trm_iface 'wwan'
        option trm_vpn '0'
        option trm_randomize '0'
        option trm_radio 'radio0'
        option trm_captiveurl 'http://detectportal.firefox.com'
        option trm_useragent 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0'

root@openwrt-wifi-radios:~#

let's see the /etc/config/network configuration file.

root@openwrt-wifi-radios:~# cat /etc/config/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 'fd4b:0686:757d::/48'

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

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '10.12.10.6'
        option netmask '255.255.255.0'
        option ip6assign '60'
        list dns '10.12.10.12'
        list dns '8.8.8.8'

config interface 'wwan'
        option proto 'dhcp'
        option metric '100'

config device
        option type 'bridge'
        option name 'br-pfsense-wan'
        option ipv6 '0'
        list ports 'eth1'

config interface 'pfsense_wan'
        option proto 'static'
        option device 'br-pfsense-wan'
        option ipaddr '192.168.237.1'
        option netmask '255.255.255.0'

config interface 'wwan6'
        option device '@wwan'
        option proto 'dhcpv6'

root@openwrt-wifi-radios:~#

While not conventionally configured, I'm not seeing anything here that would stop the radio from coming up.

You might be best served by trying a default configuration -- reset to defaults and see if you can get the radio to start up as expected upon boot.

thank you!
I have also found a workaround by adding the following to /etc/rc.local file:

sleep 10
wifi

I think this is another variation of this known bug: