I put Orange Pi Zero 3 with DietPi in wireless network with client isolations. I found that every ~12-15 seconds Pi is disconnecting and reconnecting. I tried different things and lastly with AI chat help I found that “problem” is with Wi-Fi monitor script. It does the following:
- Waits 10 seconds.
- Gets the default gateway.
- Tries to ping it.
- Routers firewall blocks the ping.
- DietPi incorrectly concludes Wi-Fi has failed.
- Executes ifdown and ifup.
- DHCP is released, Wi-Fi disconnects, and everything reconnects.
- Repeats.
Solution is to change dietpi-wifi-monitor.sh from testing IP connectivity to testing actual Wi-Fi association. So I edited in script:
elif ! GATEWAY=$(G_GET_NET -i “$ADAPTER” gateway) || ! ping -nqc 1 -w 10 -I “$ADAPTER” “$GATEWAY” &> /dev/null
to
elif ! iw dev “$ADAPTER” link | grep -q '^Connected to ’
and it’s done. Works perfect ![]()