Temat: Dwa Xiaomi AX3600 w Mesh - harmonogram WiFi w Cron
Hej,
Xiaomi AX3600 posiada opcję wyłączenia WiFi o określonych godzinach. Niestety jedynie z poziomu aplikacji mobilnej. Dodatkowo jeśli router pracuje w trybie mesh to tracimy tę funkcjonalność zupełnie. Ja mam właśnie dwa ax3600 spięte w mesh.
Oryginalny firmware oparty jest na OpenWrt co skłoniło mnie do szukania w jaki sposób można by to spróbować zrobić przez Cron.
Bardzo prosiłbym o pomoc bo na starym routerze robiłem to w prosty sposób przez Luci.
Skonfigurowałem już sobie wszystko i nie chciałbym też już czegoś popsuć????
1. Zacząłem od znalezienia wireless iface name na obu routerach i tak:
Router główny:
wireless.wifi0
wireless.wifi1
wireless.wifi2
oraz
wireless.@wifi-iface[0]-5Ghz
wireless.@wifi-iface[1]-2.4GHz
wireless.@wifi-iface[2]-nie wiem
wireless.@wifi-iface[3]-mesh
Router pełniący funkcje satelity:
wireless.wifi0
wireless.wifi1
wireless.wifi2
oraz
wireless.@wifi-iface[0]-5Ghz
wireless.@wifi-iface[1]-2.4GHz
wireless.@wifi-iface[2]-nie wiem
wireless.@wifi-iface[3]-mesh
wireless.@wifi-iface[4]-mesh
Czy prawidłowa komenda w SSH dla routera głównego to będzie?:
"cat /etc/crontabs/root
30 0 * * * uci set wireless.@wifi-iface[0].disabled=1 && uci commit wireless && wifi
30 0 * * * uci set wireless.@wifi-iface[1].disabled=1 && uci commit wireless && wifi
30 0 * * * uci set wireless.@wifi-iface[2].disabled=1 && uci commit wireless && wifi
30 0 * * * uci set wireless.@wifi-iface[3].disabled=1 && uci commit wireless && wifi
30 6 * * * uci set wireless.@wifi-iface[0].disabled=0 && uci commit wireless && wifi
30 6 * * * uci set wireless.@wifi-iface[1].disabled=0 && uci commit wireless && wifi
30 6 * * * uci set wireless.@wifi-iface[2].disabled=0 && uci commit wireless && wifi
30 6 * * * uci set wireless.@wifi-iface[3].disabled=0 && uci commit wireless && wifi"
A dla routera dodatkowego:
"cat /etc/crontabs/root
30 0 * * * uci set wireless.@wifi-iface[0].disabled=1 && uci commit wireless && wifi
30 0 * * * uci set wireless.@wifi-iface[1].disabled=1 && uci commit wireless && wifi
30 0 * * * uci set wireless.@wifi-iface[2].disabled=1 && uci commit wireless && wifi
30 0 * * * uci set wireless.@wifi-iface[3].disabled=1 && uci commit wireless && wifi
30 0 * * * uci set wireless.@wifi-iface[4].disabled=1 && uci commit wireless && wifi
30 6 * * * uci set wireless.@wifi-iface[0].disabled=0 && uci commit wireless && wifi
30 6 * * * uci set wireless.@wifi-iface[1].disabled=0 && uci commit wireless && wifi
30 6 * * * uci set wireless.@wifi-iface[2].disabled=0 && uci commit wireless && wifi
30 6 * * * uci set wireless.@wifi-iface[3].disabled=0 && uci commit wireless && wifi
30 6 * * * uci set wireless.@wifi-iface[4].disabled=0 && uci commit wireless && wifi"
Po wpisaniu: „cat /etc/crontabs/root” mam taka informacje jak poniżej więc chyba cron jest obsługiwany?
*/15 * * * * /usr/sbin/ntpsetclock 60 log >/dev/null 2>&1
* * * * * /usr/sbin/startscene_crontab.lua `/bin/date "+%u %H:%M"`
48 3,4,5 * * * /usr/sbin/otapredownload >/dev/null 2>&1
0 3 * * * /usr/sbin/rmportscanresult.sh >/dev/null 2>&1
Na forach znalazłem również informację, że można to zrobić taką komendą jak poniżej. Czy będzie lepiej niż tą powyżej w moim przypadku?
"crontab -e
0 24 * * * /sbin/wifi down
0 08 * * * /sbin/wifi restart"