Automatically Reconnect/Retry Wi-Fi?

Evening guys,

Just wondered if there is a way to make CE reconnect/retry connection to the saved Wi-Fi network after failure?

Sometimes after say a reboot of my AP’s or when they carry out channel optimisation CE will not reconnect back to the said network. It’s status will show failure and requires selecting to connect again.

Any help would be appreciated.

Cheers

[ 5895.752520@0]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DISASSOC_IND
[ 5895.752536@1]  [dhd-wlan0] wl_iw_event : disconnected with c2:25:2f:7f:ec:a3, event 12, reason 1
[ 5895.752549@0]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DISASSOC_IND
[ 5895.752556@0]  [dhd] CFG80211-ERROR) wl_notify_connect_status : link down--clearing disconnect IEs
[ 5895.752586@1]  [dhd-wlan0] wl_ext_iapsta_event : [S] Link down with c2:25:2f:7f:ec:a3, WLC_E_DISASSOC_IND                                                                                                                                                 (12), reason 1
[ 5895.758323@1]  [dhd] dhd_dbg_stop_pkt_monitor, 1859
[ 5895.759565@1]  [dhd-wlan0] wl_iw_event : Link Down with c2:25:2f:7f:ec:a3, reason=2
[ 5895.759609@1]  [dhd-wlan0] wl_ext_iapsta_event : [S] Link down with c2:25:2f:7f:ec:a3, WLC_E_LINK(16), re                                                                                                                                                 ason 2
[ 5895.761501@1]  [dhd] CFG80211-ERROR) wl_cfg80211_del_key : WLC_SET_KEY error (-8)
[ 5895.762096@1]  [dhd-wlan0] wl_iw_event : [0 times] disconnected with c2:25:2f:7f:ec:a3, event 5, reason 7
[ 5895.762118@1]  [dhd-wlan0] wl_ext_iapsta_event : [S] Link down with c2:25:2f:7f:ec:a3, WLC_E_DEAUTH(5), r                                                                                                                                                 eason 7
[ 5895.762310@1]  [dhd-wlan0] wl_ext_iapsta_event : [S] Link down with c2:25:2f:7f:ec:a3, WLC_E_DEAUTH(5), r                                                                                                                                                 eason 7
[ 5895.762507@1]  [dhd-wlan0] wl_ext_iapsta_event : [S] Link down with c2:25:2f:7f:ec:a3, WLC_E_DEAUTH(5), r                                                                                                                                                 eason 7
[ 5895.762679@1]  [dhd] CFG80211-ERROR) wl_cfg80211_del_key : WLC_SET_KEY error (-8)
[ 5895.762765@1]  [dhd-wlan0] wl_ext_iapsta_event : [S] Link down with c2:25:2f:7f:ec:a3, WLC_E_DEAUTH(5), r                                                                                                                                                 eason 7
[ 5895.763024@1]  [dhd-wlan0] wl_ext_iapsta_event : [S] Link down with c2:25:2f:7f:ec:a3, WLC_E_DEAUTH(5), r                                                                                                                                                 eason 7
[ 5895.763238@1]  [dhd-wlan0] wl_ext_iapsta_event : [S] Link down with c2:25:2f:7f:ec:a3, WLC_E_DEAUTH(5), r                                                                                                                                                 eason 7
[ 5895.763480@1]  [dhd-wlan0] wl_ext_iapsta_event : [S] Link down with c2:25:2f:7f:ec:a3, WLC_E_DEAUTH(5), r                                                                                                                                                 eason 7
[ 5895.763752@1]  [dhd-wlan0] wl_ext_iapsta_event : [S] Link down with c2:25:2f:7f:ec:a3, WLC_E_DEAUTH(5), r                                                                                                                                                 eason 7
[ 5895.763927@1]  [dhd-wlan0] wl_ext_iapsta_event : [S] Link down with c2:25:2f:7f:ec:a3, WLC_E_DEAUTH(5), r                                                                                                                                                 eason 7
[ 5895.817502@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_LINK
[ 5895.817520@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_LINK
[ 5895.817529@1]  [dhd] CFG80211-ERROR) wl_notify_connect_status : link down--clearing disconnect IEs
[ 5895.817545@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817552@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817560@1]  [dhd] CFG80211-ERROR) wl_notify_connect_status : link down--clearing disconnect IEs
[ 5895.817571@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817577@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817583@1]  [dhd] CFG80211-ERROR) wl_notify_connect_status : link down--clearing disconnect IEs
[ 5895.817594@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817601@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817607@1]  [dhd] CFG80211-ERROR) wl_notify_connect_status : link down--clearing disconnect IEs
[ 5895.817615@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817621@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817625@1]  [dhd] CFG80211-ERROR) wl_notify_connect_status : link down--clearing disconnect IEs
[ 5895.817634@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817641@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817646@1]  [dhd] CFG80211-ERROR) wl_notify_connect_status : link down--clearing disconnect IEs
[ 5895.817654@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817661@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817666@1]  [dhd] CFG80211-ERROR) wl_notify_connect_status : link down--clearing disconnect IEs
[ 5895.817675@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817680@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817685@1]  [dhd] CFG80211-ERROR) wl_notify_connect_status : link down--clearing disconnect IEs
[ 5895.817695@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817702@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817709@1]  [dhd] CFG80211-ERROR) wl_notify_connect_status : link down--clearing disconnect IEs
[ 5895.817720@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817727@1]  [dhd] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_DEAUTH
[ 5895.817732@1]  [dhd] CFG80211-ERROR) wl_notify_connect_status : link down--clearing disconnect IEs
[ 5895.868517@1]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 1, bssidx: 0
[ 5900.216651@0]  [dhd] CFG80211-ERROR) wl_set_wsec_info_algos : wsec_info error (-23)
[ 5900.218479@0]  [dhd-wlan0] wl_cfg80211_connect : Connecting with 02:eb:d8:79:d2:fe ssid "SSIDREMOVED",                                                                                                                                                  len (14), sec=wpa2psk/mfpn/aes, channel=40
[ 5900.218479@0]
[ 5900.219135@0]  [dhd] dhd_dbg_start_pkt_monitor, 1621
[ 5900.277854@1]  [dhd-wlan0] wl_ext_iapsta_event : connect failed event=0, reason=0, status=1
[ 5900.277898@1]  [dhd] CFG80211-ERROR) wl_notify_connect_status : connect failed event=0 e->status 1 e->rea                                                                                                                                                 son 0
[ 5900.277909@1]  [dhd] CFG80211-ERROR) wl_cfg80211_check_in4way : WPA failed at 13
[ 5900.283202@1]  [dhd-wlan0] wl_bss_connect_done : Report connect result - connection failed
[ 5904.011551@1]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 2, bssidx: 0
[ 5913.011455@1]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 3, bssidx: 0
[ 5940.011445@1]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 4, bssidx: 0
[ 6021.082207@1]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 5, bssidx: 0
[ 6264.039981@0]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 6, bssidx: 0
[ 6564.079170@2]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 7, bssidx: 0
[ 6864.108618@1]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 8, bssidx: 0
[ 7164.108449@0]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 9, bssidx: 0
[ 7464.109002@3]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 10, bssidx: 0
[ 7764.108971@3]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 11, bssidx: 0
[ 8064.108888@0]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 12, bssidx: 0
[ 8364.076778@1]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 13, bssidx: 0
[ 8664.108768@1]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 14, bssidx: 0
[ 8964.108568@3]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 15, bssidx: 0
[ 9264.084235@3]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 16, bssidx: 0
[ 9564.108994@1]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 17, bssidx: 0
[ 9864.108147@1]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 18, bssidx: 0
[10164.100380@2]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 19, bssidx: 0
[10464.108805@1]  [dhd-wlan0] wl_run_escan : LEGACY_SCAN sync ID: 20, bssidx: 0
1 Like

I have the same problem (TOX3 s905x4)

Just bumping this in the hope for some help, had the wife shouting at me this morning because the setup in the bedroom didn’t work.

1 Like

Just bumping this again in the hope for some help.

1 Like

OK so I think I might have put a workaround/fix in place for this, may not particularly be the best way, or the most elegent, but it does appear to work.

I recalled that I had a “WAN Watchdog” script in place on my OpenWRT router that ran every 5 minutes that would ping an external IP address, if there was no response, then the network interface would be restarted. This was because my ISP used DHCP to connect to the cable network and sometimes if the session died, the router wouldn’t refresh the IP address.

Anyhow, I thought I could use a similar principle here after finding the two services that appear to handle networking connectivity within CoreELEC.

I modified the script and it looks like this:


#!/bin/sh

tries=0
while [[ $tries -lt 5 ]]
do
	if ping -c 1 x.x.x.x >/dev/null
	then
		exit 0
	fi
	tries=$((tries+1))
done

systemctl restart connman.service
sleep 2
systemctl restart wpa_supplicant.service

Obviously “if ping -c 1 x.x.x.x” is the IP address of the device to ping, so in this case I just used my main router IP.

I saved this as wifi-watchdog.sh within /storage/.config (don’t know if this is the best location?) and then within SSH made this executable: chmod +x /storage/.config/wifi-watchdog.sh

Then added this to my crontab to run every 5 minutes:

crontab -e
*/5 * * * * /storage/.config/wifi-watchdog.sh

Have tested it by blocking both of my clients on Wi-FI and then observing “failure” within CoreELEC Configuration, unblocking the client and allowing the cron to run and then seeing the client reconnect.

Any feedback would be greatly appreciated.

1 Like

@vassemm, did you manage to try this out?

Yes. I just tried it out yesterday. At first glance everything works great. Thanks a lot.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.