What's new

schedule Wireless on and off with option device is connected

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

schranzc

Occasional Visitor
Hello,

I want to implement to schedule wifi on and off with the option to check if any devices are
currently connected before turning it off. I know this feature from my Fritz!Box and it would be great to get the same function in my ASUS-Merlin Router :) Can anybody help me to realize this project?

Schedule Wifi:
if(devices.connected() == true):
do nothing;
check again in 10 minutes;
else:
TurnWifiOff();

Thank you so much!!
 
Use "wl" to check the list of associated clients.

Code:
wl -i eth1 assoclist
wl -i eth2 assoclist
 
Thank you so much!!

wl -i eth1 assoclist #works!!! (2.4GHz)
wl -i eth2 assoclist #wl: wl driver adapter not found

The name of the 5GHz-adapter must be a different - i tried eth0 and eth3 but nothing works (wl: wl driver adapter not found). I have a ASUS-RTAC87U Router with the latest Merlin-Firmware! Do you know what the name of the 5GHz adapter is? Thank you again!!
 
Thank you so much!!

wl -i eth1 assoclist #works!!! (2.4GHz)
wl -i eth2 assoclist #wl: wl driver adapter not found

The name of the 5GHz-adapter must be a different - i tried eth0 and eth3 but nothing works (wl: wl driver adapter not found). I have a ASUS-RTAC87U Router with the latest Merlin-Firmware! Do you know what the name of the 5GHz adapter is? Thank you again!!

The 5 GHz radio on the RT-AC87U is from Quantenna, not from Broadcom. The API is completely different.

You will have to dig through the libqcsapi source code to figure out the correct function call to send using qcsapi_sockrpc. I know it was posted on the forums a year ago or so, but I can't remember the exact function.
 
Thank you!

this is the right one to check how many devices are connected (5GHz):
qcsapi_sockrpc get_count_assoc wifi0

disable wifi (5GHz):
qcsapi_sockrpc rfenable 0 wifi0

enable wifi (5GHz):
qcsapi_sockrpc rfenable 1 wifi0

everything works!! = HAPPY :)

now I check if devices are connected with 2.4GHz WiFi like this:
CD=$(wl -i eth1 assoclist) #CD ... connected devices
logger "Devices 2.4GHz: assoclist XX:XX:XX:XX:XX:XX "
if [ "${CD:0:9}" != "assoclist" ]

how can I check "if empty"?
CD=$(wl -i eth1 assoclist) #CD ... connected devices
logger "Devices 2.4GHz: "
if [ $CD == """empty"""" ]

Thanks
 
ASUS RT-AC87U

2.4GHz
Code:
wl -i eth1 assoclist
returns a list of connected clients (assoclist XX:XX:XX:XX:XX:XX assoclist XY:XX:XX:XX:XX:XX ......)

and
5GHz
Code:
qcsapi_sockrpc get_count_assoc wifi0
returns a count-number of the connected clients (0, 1, 2, 3, ...)

is there a way (command) to get the count number (instead of the assoclist with MAC-address) for the 2.4GHz devices too?
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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