Start/stop specific wifi interfaces via SSH

Hello,

I’m trying to configure and enable/disable two wifi networks on my RUT956 via a shell script.
I’ve come so far as to set all relevant parameters via UCI but am stuck on the actual enable/disable of the network.

In my case, the steps (so far) are:

        uci set wireless.1.ssid=test_1
        uci set wireless.2.ssid=test_2
        uci set wireless.1.disabled=0
        uci set wireless.2.disabled=0
        uci commit wireless

This was based on some other forum entries i found.

So far it works. I can see the network on/off slider changes when i execute these steps, but the network remains unchanged.

According to the same forum entries, the last step is to restart the Wifi service:

        /etc/init.d/wireless reset

However, init.d has no wireless service listed.
Multi-wifi seemed a logical alternative, but restarting that yields no results.

How do i get the networks to listen to their new configuration?

I’m currently running RUT9M_R_00.07.04.3 on my test system.

On “official” openwrt, which I run on a large fleet of RUT955, you simply would type “wifi down” , “wifi up”. Dunno, whether exists on RutoS. If not available, the big hammer would be “/etc/init.d/network restart” (will disconnect your ssh-session) OR you just type “reboot” :slight_smile:

I did some more digging.

Wifi down/up is available, but controls the radio as 1 object, thus enabling/disabling all wifi connections.

In my case i want to control separate wifi connections.

A solution that works for me at the moment is:

  • enable/disable the appropriate wifi networks via UCI commands
  • commit the new UCI config
  • restart the Wifi service via: /sbin/wifi reload

Hello,

Thanks for reaching out to us!

If you want to enable/disable the Wi-Fi networks, you can use below commands.

uci set wireless.default_radio0.disabled=1
uci commit wireless

Please try and let me know if it works.

Regards,
Caner

Hello Caner,

I tried (in my case) wireless.1.disabled and wireless.2.disabled (2 ap’s that are applicable to me here).
If i disabled these and committed i could see the settings in the gui being updated (AP enable slider went to “off”, but the networks stayed online.
When i pressed “save and apply” in the GUI manually, the networks were disabled according to the new settings.

If i run "/sbin/wifi reload it does apply the changes

I haven’t tried the “default” entries yet, but but doensn’t this control the entire wifi radio at once?
I see if i can quickly test it, but it may need to wait till after the weekend.

This topic was automatically closed after 15 days. New replies are no longer allowed.