Wifi ssid enable by default

i want to build a custom firmware where after factory reset, default ssid will automatically be enabled. so that i dont have to press the wifi button on back of the router to enable ssid. how can i do that?

according to your wifi setup, try to modify the file:


		uci -q batch <<-EOF
			set wireless.${name}=wifi-device
			set wireless.${name}.type=mac80211
			set wireless.${name}.channel=${channel}
			set wireless.${name}.band=${mode_band}
			set wireless.${name}.htmode=$htmode
			set wireless.${name}.disabled=1

			set wireless.default_${name}=wifi-iface
			set wireless.default_${name}.device=${name}
			set wireless.default_${name}.network=lan
			set wireless.default_${name}.mode=ap
			set wireless.default_${name}.ssid=OpenWrt
			set wireless.default_${name}.encryption=none
		uci -q commit wireless
1 Like

Consider using the UCI defaults facility, which is designed specifically for this purpose. That way the OpenWrt base files can be kept intact and your changes can easily be carried between OpenWrt versions.


in openwrt firmware selector page, i changed the uci scripts for first boot. but it did not worked.
can you tell me which lines i should modify or change please?

I think you change:

set wireless.${name}.disabled=0

It should enable the wifi master mode when first root.

I was changed the ssid line to capture the part of MAC address into wifi ssid name:

set wireless.default_radio${devidx}.ssid=Xiaomi_$(cat /sys/class/ieee80211/${dev}/macaddress|awk -F ":" '{print $5""$6 }'| tr a-z A-Z)

maybe you have to do this mods before your first build/make, so if no effective, please clone a new copy--> modify --> make.

good method, I'll use this next time.

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