Auto-reconnect WiFi on Hestia Classic


#1

So since my Hestia Classic is now installed, I’ve noticed that it doesn’t seem too happy with my flaky WiFi - if my WiFi dies, Hestia won’t reconnect to it. Instead I have to reset the power to it in order for it to reconnect.

Obviously I can hack in a cronjob to handle this, but before I do, i thought I’d ask if anyone else has seen this, or has better solutions?


#2

This should be pre-setup in the downloadable image.
Is it not?


#3

Can’t tell, it’s not connected to the wifi at the moment :wink: - but since it’s not on the wifi, I assume it’s not working correctly.

I had a period of the wifi going up/down repeatedly, and then coming back stable after an hour or so. I wonder if it got confused… I’ll go reset it and take a look later on.


#4

any update? I have tested thoroughly the linked script and seemed very robust.


#5

Rebooted the Pi, so I can log back in. There’s certainly something in that directory, hard to tell if it’s what is supposed to be there :stuck_out_tongue:

I’ll test it manually by messing with the wifi later, but for now I can only assume it’s correct. My theory is that either the script timed out (wifi down for ages) or perhaps it tried to reconnect exactly as the AP was bringing the wifi back up and failed to authenticate. Hard to be sure, I’ll try to test.

I may hack up a */15 min cronjob that checks for a default gateway and attempts to ping it - if it fails it restarts the networking service. That should be a belt’n’braces backup in case ifupdown fails.


#6

Interested in the results if you find something. My mate had similar issues with his downstairs WiFi router so I came up with the linked solution above and since then he is fine. Thanks for the update :wink:


#7

Not had time to debug it much, but I saw it drop off the network again yesterday, and this time there wasn’t a drop in the wifi elsewhere in the house. Might be range based I guess? The router is quite far…

Anyway, just for belt’n’braces I added this to /etc/crontab, running every 5 mins:

root@raspberrypi:~# cat /usr/local/bin/wificheck 
#!/bin/bash

# Script to restart wifi if the connection has died
# Currently hard coded to my network params.

# License - GPL v3
# Copyright - Greg Sutcliffe 2017

CHECK_HOST='172.20.10.1'
LOGFILE='/var/log/wificheck.log'

if ! ping -q -n -c1 $CHECK_HOST 2>&1 >/dev/null
then
  echo "WiFi drop detected at `date`" >> $LOGFILE
  /etc/init.d/networking restart 2>&1 >> $LOGFILE
fi

Brute force but should at least allow me to log back in after the wifi dies to look at log files etc…


#8

Do you usually get decent reception?


#9

Hard to say, I don’t have any other devices in that area of the house - but it is a fair distance from the router. Currently seeing 60/100 on iwconfig which is a bit low. Will monitor the logfile above and see if I get any more drops.