Skip to content

Instantly share code, notes, and snippets.

@pcolazurdo
Created March 17, 2020 12:58
Show Gist options
  • Save pcolazurdo/ebd5731166c7009b85736234b7581079 to your computer and use it in GitHub Desktop.
Save pcolazurdo/ebd5731166c7009b85736234b7581079 to your computer and use it in GitHub Desktop.
Setting WiFi Access on Respbian Jessie

Fixing WiFi connectivity in Raspbian GNU/Linux 8 (jessie)

Based lousely on https://unix.stackexchange.com/questions/173781/how-can-i-enable-wpa-supplicant-on-boot

First, learn some useful commands such us:

iw wlan0 link # to find if your Wireless Device is UP or DOWN
iw wlan0 scan # To find information about the Access Points available to your device
ip addr # to find if the interface is getting IP address

Once you know your AP SSID you can use wpa_passphrase to create the configuration file needed For example:

# this will overwrite any previous wpa_supplicant.conf file so be careful
wpa_passphrase eir27228402-2.4G > /etc/wpa_supplicant/wpa_supplicant.conf

Once this is done you can try to see if your device is able to connect using wpa_supplicant like this: Note: You may need to kill running wpa_supplicant processes before trying again

wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

By default wpa_supplicant should start at boot time, but if that doesn't work you can try this to create the systemd configuration

  1. Create a systemd unit file /etc/systemd/system/[email protected]
[Unit]
Description=Wireless network connectivity (%i)
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device

[Service]
Type=oneshot
RemainAfterExit=yes

ExecStart=/sbin/ip link set dev %i up
ExecStart=/sbin/wpa_supplicant -B -D wext -i %i -c /etc/wpa_supplicant/wpa_supplicant.conf

ExecStop=/sbin/ip link set dev %i down

[Install]
WantedBy=multi-user.target
  1. Create a link into the corresponding directory
ln -s /etc/systemd/system/network-wireless\@.service /etc/systemd/system/multi-user.target.wants/network-wireless\@wlan0.service
  1. Try restarting the services
systemctl enable [email protected]
systemctl daemon-reload
systemctl start [email protected]
  1. Voilá!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment