I am trying to find a way to check and if needed restart my WiFi since it keeps stalling every couple of days.
Therefore I want to write a shell script that runs on the router and pings a WiFi connected device (ESP8266 that is running 24/7 anyways) every minute and if this fails it should restart the WiFi of the router.
Does anyone know how to restart WiFi with a CLI command?
was discussed recently
Looked over both uci and wifi and I'm confused as to how to programmatically toggle wifi. What I'm trying to do is enable/disable my 2.4GHz band on my R7800 through SSH. All configurations are set and I can enable and disable through LuCi. What I tried to do was:
uci set wireless.radio1.disabled=0 && uci commit wireless && wifi
Doesn't work. I am noticing that the wireless.radio1.disabled key is not there after I enable the radio through LuCi. Do I delete that key entirely to enable and then a…
Cool! That worked! Thanks!
I have three devices that are always connected that I can ping to this should be pretty safe.
That's what worked for my setup with radio1 and a logfile:
if echo $(ping -W 2 -c 1 192.168.8.11) |grep ', 0%' &>/dev/null
elif echo $(ping -W 2 -c 1 192.168.8.10) |grep ', 0%' &>/dev/null
elif echo $(ping -W 2 -c 1 192.168.8.12) |grep ', 0%' &>/dev/null
echo "WiFi down"
nichtda=$((nichtda + 1))
if test $nichtda -gt 2
date +"%D - %T" >> /var/log/wifirestartlog
uci set wireless.radio1.disabled='1'
wifi down radio1
uci set wireless.radio1.disabled='0'
wifi up radio1
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.