[Buildroot] Recommended way to auto-reconnect wifi?

Jeremy Fleischman jeremyfleischman at gmail.com
Wed Sep 22 00:16:55 UTC 2021


I've been happily using buildroot for a growing number of Raspberry PIs at
home. However, I've noticed that whenever our wifi cuts out, they do not
reconnect when it comes back.

I've got them configured using BusyBox init + mdev + ifupdown +
wpa_supplicant. I've skimmed through /etc/inittab, and I think I understand
how everything is wired together:

  - /etc/init.d/S10mdev: mdev starts up, and asynchronously starts
discovering devices.
  - /etc/init.d/S40network: This runs /sbin/ifup -a. I think this runs
while mdev is still discovering devices, which is fine, because there's a
wait-delay configured in /etc/network/interfaces:

# cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp
    hostname thermometer
    pre-up wpa_supplicant -D nl80211 -i wlan0 -c /etc/wpa_supplicant.conf -B
    post-down killall -q wpa_supplicant
    *wait-delay 15*

iface default inet dhcp

As far as I can tell, this all only ever happens at startup, and there
isn't any mechanism that would attempt to reconnect to a wifi network after
a disconnect. I've done some googling, and here's what I've learned:

  - I'm pretty sure that wpa_supplicant is not supposed to handle this.
  - It looks like some people write scripts to handle this for themselves.
See this SO answer <https://raspberrypi.stackexchange.com/a/5121> and
this dweeber/WiFi_Check
repo <https://github.com/dweeber/WiFi_Check>.

Am I correct that this is something I should fix by adding some sort of
background/cron process to do something like the WiFi_Check script above?
Or is this something buildroot does have baked in support for, and I just
haven't found it yet?

Thanks,
Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildroot.org/pipermail/buildroot/attachments/20210921/ef7594a1/attachment.html>


More information about the buildroot mailing list