Not exactly the fanciest dress for company, but it does make it all the easier to comment out after updates to test if the issue still exists.
Posts by mediamogul
-
-
The problem here was needing to set the wireless country code, but it appears as though others are looking to solve a similar problem with the pi4 and wifi connectivity found in what seems to be all distros based off libreelec. I can't speak to the actual cause of the problem, but fortunately, once a connection is established, it's solid and will hold until disconnected.
Below is a script that can be added to an autostart.sh. On boot it'll test to see if the system was able to connect on its own and if not it will try to reconnect and test again up to three more times. Altogether, the script runs for 60 seconds so as not to interfere with manual use any more than it needs to.
Bash#!/bin/bash { sleep 18; N=0; WLANSTAT="$(ping -q -w 1 -c 1 4.2.2.1 >/dev/null 2>&1 && echo 1 || echo 0)"; until [ "$N" = "3" ] || [ "$WLANSTAT" = "1" ]; do ifconfig wlan0 down; rfkill unblock all; ifconfig wlan0 up; sleep 14; WLANSTAT="$(ping -q -w 1 -c 1 4.2.2.1 >/dev/null 2>&1 && echo 1 || echo 0)"; N=$(( N + 1 )); done } &
Between the various distros based on libreelec, there are quite a few other posts out there regarding this issue, but they generally seem to be obfuscated by other problems found with the Pi4's built-in wifi. I hope this workaround is helpful until a better solution to the problem can be found.