Guest Wi-Fi: WIFI_DEV="$(uci get wireless.@wifi-iface[0].device)" uci: Entry not found

Hi,

what have I done wrong?

root@OpenWrt:~# WIFI_DEV="$(uci get wireless.@wifi-iface[0].device)"
uci: Entry not found

 -----------------------------------------------------
 OpenWrt 24.10.1, r28597-0425664679
 -----------------------------------------------------
root@OpenWrt:~# # Configure network
root@OpenWrt:~# uci -q delete network.guest_dev
root@OpenWrt:~# uci set network.guest_dev="device"
root@OpenWrt:~# uci set network.guest_dev.type="bridge"
root@OpenWrt:~# uci set network.guest_dev.name="br-guest"
root@OpenWrt:~# uci -q delete network.guest
root@OpenWrt:~# uci set network.guest="interface"
root@OpenWrt:~# uci set network.guest.proto="static"
root@OpenWrt:~# uci set network.guest.device="br-guest"
root@OpenWrt:~# uci set network.guest.ipaddr="192.168.3.1/24"
root@OpenWrt:~# uci commit network
root@OpenWrt:~# service network restart
root@OpenWrt:~# # Configure wireless
root@OpenWrt:~# WIFI_DEV="$(uci get wireless.@wifi-iface[0].device)"
uci: Entry not found
root@OpenWrt:~# uci -q delete wireless.guest
root@OpenWrt:~# uci set wireless.guest="wifi-iface"
root@OpenWrt:~# uci set wireless.guest.device="${WIFI_DEV}"
root@OpenWrt:~# uci set wireless.guest.mode="ap"
root@OpenWrt:~# uci set wireless.guest.network="guest"
root@OpenWrt:~# uci set wireless.guest.ssid="guest"
root@OpenWrt:~# uci set wireless.guest.encryption="none"
root@OpenWrt:~# uci commit wireless
root@OpenWrt:~# wifi reload
root@OpenWrt:~#

Thanks for your assistance!

Are you following instructions or a tutorial? Are you able to link to it?

Do you have any other wireless networks configured before you did this? The error maybe implies you don’t.
If you post your /etc/config/wireless contents someone can offer additional advice to change the commands to suit your setup.
Make sure you redact any passwords.

I follow these instructions: https://openwrt.org/docs/guide-user/network/wifi/guestwifi/guest-wlan

Because I have previously created interfaces and wireless networks manually, I suspect that these standard instructions did not work for me.

But I didn't realize that there was such a config file. I cleaned it up because it contained outdated entries, although these were no longer visible in the frontend (Luci).

Now everything works!

Thanks :slight_smile:

You can ignore the "WIFI_DEV" variable and just use uci set wireless.guest.device="radio0" or uci set wireless.guest.device="radio1" in its place, depending on whether you have wifi on 2 frequencies and which one you want to use (e.g. 2.4 GHz or 5 GHz).