projectbuendia / buendia

Main project repository (see the Wiki for details)
Apache License 2.0
117 stars 36 forks source link

Fix Wi-Fi watchdog behavior on NUC. #217

Closed schuyler closed 5 years ago

schuyler commented 5 years ago

Currently buendia-wifi-watchdog uses wpa_cli status to check the status of the wireless link; however, for unknown reasons, this command never reports that the Wi-Fi is connected on the NUC, even when it definitely is.

The consequence of this behavior was buendia-networking was causing the wireless connection to drop on the NUC for about 7-8 seconds out of every minute.

This PR changes buendia-wifi-watchdog under the hood to perform two checks each time it runs:

  1. Run iwconfig and see if the NETWORKING_WIFI_INTERFACE is associated to an access point
  2. If so, find the broadcast address for that interface, and ping it to see if any other hosts respond

If either of these checks fails, then buendia-wifi-watchdog will reconfigure the networking stack, which should cause the network to come back. I have tested both conditions manually on the NUC and both times the Wi-Fi came back online within 70 seconds as anticipated. Otherwise, when operating normally, the aforementioned network dropouts disappear as expected.

zestyping commented 5 years ago

I discovered and fixed this yesterday.

schuyler commented 5 years ago

🤷‍♂