Skip to content

Instantly share code, notes, and snippets.

@Jim-Holmstroem
Created April 4, 2017 21:03
Show Gist options
  • Save Jim-Holmstroem/93f525393662f19a7f31d7c56e1c8a16 to your computer and use it in GitHub Desktop.
Save Jim-Holmstroem/93f525393662f19a7f31d7c56e1c8a16 to your computer and use it in GitHub Desktop.
arch linux auto connect to wifi problems (and fix) #rpi #raspberry. Had som issue with that the raspberry pi would not auto connect to the WiFi network, dispite that it worked when I started it manually. The below commands fixed it
sudo pacman -S polkit wpa_actiond
systemctl enable netctl-auto@wlan0.service
@johnyradio
Copy link

johnyradio commented Dec 11, 2019 via email

@Jim-Holmstroem
Copy link
Author

the connection to wlan0 that netctl-auto will use (in the example code) is setup with with wifi-menu (and not with netctl-auto, netctl, or anything else)
as I stated, the interfaces in netctl will conflict with netctl-auto, so I just clearified on which method to use for setup to get it right
it was something I setup almost 3 years ago, so the details are kinda blurry by now

@johnyradio
Copy link

johnyradio commented Dec 12, 2019

"Starting with version 1.20, netctl stopped depending on wpa_actiond for its automatic wireless connecting features" bugs.archlinux.org/task/61934

My recipe, tested on a standard arch install (2019) with systemd:

One-time setup:

  • Ensure the following are installed: dialog, wpa_supplicant, dhcpcd, netctl, wifi-menu.
  • on xfce, add the xfce4-wavelan-plugin. That's just an indicator light which shows when you're connected. It has no other purpose.
  • Ensure all other network managers and services are removed or disabled. https://wiki.archlinux.org/index.php/Netctl#Wireless
  • As you explained, remove any previously created network profiles. https://www.ostechnix.com/fix-job-netctl-service-failed-error-arch-linux/
  • Obtain your WiFi device ID
    basename $(ls -d /sys/class/net/w*)
  • enable netctl-auto service. This is the service that will auto connect.
    systemctl enable netctl-auto@YourWifiDeviceID.service

Connect to a hotspot first time:

  • Run wifi-menu. Requires root.
    pkexec wifi-menu -o
    or
    sudo wifi-menu -o
    Leave off the -o to see network passwords as you type it.
  • Arrow down, pick your desired connection, hit enter, accept connection-name, enter password.
  • Add more hotspots as needed.

netctl-auto will automatically reconnect to the strongest available hotspot thereafter.

@Jim-Holmstroem
Copy link
Author

awesome @johnyradio thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment