Solved Enable/Disable guest network on schedule (crontab)

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

mvadu

Regular Contributor
I have few Tasmota IOT devices running on ESP8266 chips. They have some compatibility problem with Asus AiMesh they keep going in loop trying to connect and failing to connect (no error in Asus side, but device thinks it couldn't find the access point.
wlceventd_proc_event(491): wl0.2: Deauth_ind 98:F4:AB:EA:CA:6F, status: 0, reason: Deauthenticated because sending station is leaving (or has left) IBSS or ESS (3), rssi:0
wlceventd_proc_event(527): wl0.2: Auth 98:F4:AB:EA:BB:AA, status: Successful (0), rssi:0

What I have noticed is if I stop and start the access point, they connect just fine. So I moved them to a guest network so its very easy for me to disable/enable the guest network. Now I want to try doing that every day at a specific time (proactively instead of doing it reactively after seeing the device failures). SO I started looking if there a command I can run in the shell (so it can be added to crontab) which is equivalent of GuestNetwork->Remove/Enable?

Looking at github code, its calling a en_dis_guest_unit (https://github.com/RMerl/asuswrt-me...release/src/router/www/Guest_network.asp#L903). Which is updating some qos based on the guest network number (e.g. second guest network is wl0.2). But my reverse engineering skills aren't deep enough to figure how dis_qos_enable function is actually dealing with interfaces.

Is it ultimately as simple as toggling that interface?

Code:
[email protected]:/tmp/home/root# ifconfig | grep wl
wl0.1     Link encap:Ethernet  HWaddr 0C:9D:92:AA:DD:B1
wl0.2     Link encap:Ethernet  HWaddr 0C:9D:92:AA:DD:B2
[email protected]:/tmp/home/root# ifconfig wl0.2 down
[email protected]:/tmp/home/root# ifconfig | grep wl
wl0.1     Link encap:Ethernet  HWaddr 0C:9D:92:AA:DD:B1
[email protected]:/tmp/home/root# ifconfig wl0.2 up
[email protected]:/tmp/home/root# ifconfig | grep wl
wl0.1     Link encap:Ethernet  HWaddr 0C:9D:92:AA:DD:B1
wl0.2     Link encap:Ethernet  HWaddr 0C:9D:92:AA:DD:B2
[email protected]:/tmp/home/root#
 

ColinTaylor

Part of the Furniture
Use the commands shown towards the end of the thread you were linked to earlier.
 

mvadu

Regular Contributor
#!/bin/bash
## /jffs/scripts/reset_guest_wifi.sh
# echo cru a vpnon "0 7 * * * /jffs/scripts/reset_guest_wifi.sh" >> services-start
## Script to restart guest networks
guest1=$(nvram get wl0.1_bss_enabled)
guest2=$(nvram get wl0.2_bss_enabled)
guest3=$(nvram get wl0.3_bss_enabled)

nvram set wl0.1_bss_enabled=0
nvram set wl0.2_bss_enabled=0
nvram set wl0.3_bss_enabled=0
nvram commit
service restart_wireless
nvram set wl0.1_bss_enabled=$guest1
nvram set wl0.2_bss_enabled=$guest2
nvram set wl0.3_bss_enabled=$guest3
nvram commit
service restart_wireless
## -----------------------------------------------------------------------------
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top