Wifi Fix for OctoPi + Raspberry Pi 2 + RTL8192SU (DWA-131)
Problem Description: After setting the network information in /boot/octopi-wpa-supplicant.txt, the wlan0 card was up, but not connected.
Environment:
Troubleshooting:
Since the interface was up for me, it was hard to tell what the problem was other than not being able to see (or manipulate) the interface (wlan0) from ifconfig (no IPV4 address, ifdown fails, ifup fails)
1) Take down the interface with the ip command
# ip link set wlan0 down
2) Observe the messages from the following command
# wpa_supplicant -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
In my case, I was getting an authentication error.
Solution:
This is what worked for me, AMMV. There probably is a better way as this seems like somewhat of a hackjob, but I'm betting on Cunningham's law to find a more efficient solution. I suspect the issue was with my password complexity (long and contained an @) but I wasn't willing to do more than theory craft.
It appeared that the Pi was getting rejected for an authentication failure. The easiest way to generate a proper PSK is to use the wpa_passphrase command.
1) Use the wpa_passphrase command to generate a valid PSK for the wireless network
Syntax:
# wpa_passphrase [NetworkSSID] [NetworkPassword]
Example:
# wpa_passphrase SecretNetwork SecretPassword
network={
ssid="SecretNetwork"
#psk="SecretPassword"
psk=63f777e80e6a058faf8d14b6dac1396aad81c4cb28e0f7c1e64f186b0ee1ae0d
}
2) Add the output of the wpa_passphrase command to the /boot/octopi-wpa-supplicant.txt (which is a symlink for /etc/wpa_supplicant/wpa_supplicant.conf)
network={
ssid="SecretNetwork"
#psk="SecretPassword"
psk=63f777e80e6a058faf8d14b6dac1396aad81c4cb28e0f7c1e64f186b0ee1ae0d
}
For some reason, the network wasn't coming online by itself even with the correct PSK, however, because of a lack of logging (or, me finding that logging) I decided to add it the rc.local file (this is the hackjob part I was talking about at the start)
In the /etc/rc.local file
# Take the broken interface down
ip link set wlan0 down
# Bring the interface up properly
wpa_supplicant -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -D wext -c /etc/wpa_supplicant/wpa_supplicant.conf &
Environment:
- Raspberry Pi 2 Model B Rev 1.1
- D-Link System DWA-131 802.11n Wireless N Nano Adapter(rev.A1) [Realtek RTL8192SU]
- Octoprint version of OctoPi
Troubleshooting:
Since the interface was up for me, it was hard to tell what the problem was other than not being able to see (or manipulate) the interface (wlan0) from ifconfig (no IPV4 address, ifdown fails, ifup fails)
1) Take down the interface with the ip command
# ip link set wlan0 down
2) Observe the messages from the following command
# wpa_supplicant -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
In my case, I was getting an authentication error.
Solution:
This is what worked for me, AMMV. There probably is a better way as this seems like somewhat of a hackjob, but I'm betting on Cunningham's law to find a more efficient solution. I suspect the issue was with my password complexity (long and contained an @) but I wasn't willing to do more than theory craft.
It appeared that the Pi was getting rejected for an authentication failure. The easiest way to generate a proper PSK is to use the wpa_passphrase command.
1) Use the wpa_passphrase command to generate a valid PSK for the wireless network
Syntax:
# wpa_passphrase [NetworkSSID] [NetworkPassword]
Example:
# wpa_passphrase SecretNetwork SecretPassword
network={
ssid="SecretNetwork"
#psk="SecretPassword"
psk=63f777e80e6a058faf8d14b6dac1396aad81c4cb28e0f7c1e64f186b0ee1ae0d
}
network={
ssid="SecretNetwork"
#psk="SecretPassword"
psk=63f777e80e6a058faf8d14b6dac1396aad81c4cb28e0f7c1e64f186b0ee1ae0d
}
In the /etc/rc.local file
# Take the broken interface down
ip link set wlan0 down
# Bring the interface up properly
wpa_supplicant -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -D wext -c /etc/wpa_supplicant/wpa_supplicant.conf &
# Wait for the interface to connect to the network for the next
# command (might need tuning)
# command (might need tuning)
sleep 5
Comments