msolters/rpi-softap

WiFi Drops

Closed this issue · 3 comments

The wlan0 interface seems to lose its inet addr (ipv4) after several hours. Further, it seems that wpa_supplicant dies.

This may or may not be due to wpa_supplicant being launched as a child of stdbuf.

We must either fix wpa_supplicant or respawn it.

  1. Run wpa_supplicant as a -B background process inside a self-restarting systemd service wrapper so that it will never permanently die.
  2. We can use -f logfile.txt argument to redirect wpa_supplicant logging to an external file, and then
  3. Use https://github.com/lucagrulla/node-tail to analyze this file's output.

The wpa-tail branch definitely works as a drop-in for the previous solution, and it also offers us the capability to listen for more lines -- such as CTRL-EVENT-DISCONNECT to trigger a "disconnected" state (change LED colour etc)

The last couple sections of this article have some ideas regarding general keep-alive traffic (but not withstanding fatal death of the wpa_supplicant daemon)