The DietPi Wi-Fi monitor is incompatible with client isolation

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:

  1. Waits 10 seconds.
  2. Gets the default gateway.
  3. Tries to ping it.
  4. Routers firewall blocks the ping.
  5. DietPi incorrectly concludes Wi-Fi has failed.
  6. Executes ifdown and ifup.
  7. DHCP is released, Wi-Fi disconnects, and everything reconnects.
  8. 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 :slight_smile: