This is the file that determines if the wifi location has been set so i wanted to know how to alter it so it checks to see if the wifi-country is not set to enable instead. Any ideas?? So basically work in reverse.

I have tried disabling the service from running that executes this file but no luck.

sudo nano /usr/lib/raspberrypi-sys-mods/wifi-country


if ! /bin/grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[dD][0-9a-fA-F]$' /proc/cpuinfo ; then
        exit 0

if /bin/grep -q "^country=[A-Z][A-Z]" /etc/wpa_supplicant/wpa_supplicant.conf; then
        exit 0

if [ ! -x "/usr/sbin/rfkill" ]; then
        echo "rfkill not installed"
        exit 1
mkdir -p "/var/lib/systemd/rfkill"

address="$(/bin/grep -m 1 /mmc /proc/iomem | /usr/bin/cut -f1 -d-)"
if [ -z "$address" ]; then
        echo "Could not determine WiFi iomem address"
        exit 1

/bin/echo 1 > "$persist_file"
/usr/bin/touch /run/wifi-country-unset
/bin/echo "Wi-Fi is disabled because the country is not set"
  • You want to disable wifi-country.service, right? – Ingo Apr 21 '18 at 10:07
  • Yea I tried disabling the service but still quotes WiFi country not set even after a reboot. – Daza85 Apr 21 '18 at 12:09
  • Have you looked at the link? I have tested it with Raspbian Stretch Light 2018-04-18 on RPi 3B+ and it works. What is the difference to yours? – Ingo Apr 21 '18 at 18:13
  • Yes I tried disabling the service but somehow it still won’t let me connect to a new SSID or wen I forget my home one and try to reconnect no luck. – Daza85 Apr 22 '18 at 19:50
  • What is the difference between your installation and Raspbian Stretch Light 2018-04-18? Have you tried a fresh flashed Raspbian Stretch Light 2018-04-18 for testing? What does you give the command sudo iw dev wlan0 scan (wlan0 resp. your wifi interface) ? Do you find your access point? – Ingo Apr 23 '18 at 5:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.