Help Needed: Toggling only 2.4GHz Radio via WPS Button with wifitoggle Package

Hi everyone,

I'm running OpenWrt on a Linksys WRT1200AC. Radio0 (5GHz) functions as an access point, and Radio1 (2.4GHz) acts as a client. I'm seeking assistance in using the wifitoggle package to toggle only the 2.4GHz radio on/off when pressing the WPS button.

Appreciate any guidance you can offer!

Thanks,
Mutwa

I'm not familiar with wifitoggle, but a simple script placed in /etc/rc.button/wps can do what you need.

#!/bin/sh

[ "$ACTION" = "released" -a "$BUTTON" = "wps" ] || exit 0

{
    disabled="$(uci -q get wireless.<wifi-iface-name>.disabled)"
    [ "${disabled}" = "1" ] \
        && uci set wireless.<wifi-iface-name>.disabled='0' \
        || uci set wireless.<wifi-iface-name>.disabled='1'
    #uci commit wireless
    wifi reload
}

exit 0

Make sure option disabled exists in the wifi-iface section (no matter what the value is, 0 or 1).
Replace <wifi-iface-name> with the actual interface name.
Uncomment uci commit wireless if you want to save the latest state to nvram every time the button is pressed.

1 Like

Dear pavelgl,

Thank you so much. Let me give it a try and will give you feedback.

Regards.