1

This is using the latest Raspbian Stretch release dated 2018-06-27, Linux kernel 4.14 on a RPi 3 B+. I will note that this works perfectly fine on Raspbian Jessie, linux kernel 4.9, on either a RPI 3 B or B+.

I am able to switch Wifi networks using the on-board WiFi by modifying the ssid and psk in wpa_supplicant.conf and then executing wpa_cli reconfigure. When using a USB WiFi dongle though this does not work. Opening up interactive mode on the wpa_cli shows the following message:

<3>CTRL-EVENT-SCAN-STARTED
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>Trying to associate with 2c:fd:a1:63:4d:28 (SSID='my ssid' freq=2457 MHz)
<3>Association request to the driver failed

I have tried multiple USB WiFi dongles but none of them work, though they all seem to use the RTL8192CU chipset so I am guessing that is the issue but it must be specific to the driver used in Raspbian Stretch. I am not very experienced with kernel modules so I have not been able to investigate much further.

Would it possible to use the Jessie driver in Stretch? Or does anyone have any other ideas of what might be causing this or ways to resolve?

My ultimate goal is to be able to disable the interface and then bring it back up when I want to connect to WiFi. So far everything I have tried results in the error message mentioned above, whether the interface is brought up/down with ipconfig, ip, or when restarting services.

EDIT: I was able to get it working by reloading the driver. Not the best solution but its better than nothing I suppose...

rmmod 8192cu
modprobe 8192cu
2
  • I ran into the same issue. On reboot the USB WiFi comes up fine and associates with my network. If I try to switch networks via wpa_cli -i wlan0 select_network <id> I get the same error as you -- Association request to the driver failed. Same thing if I systemctl restart wpa_supplicant@wlan0. Thanks for the modprobe tip... that seems to be working, though I wish there was a better way. Oct 24, 2018 at 23:16
  • You updated the question with your solution. Please make it an answer and accept it after two days. Only accespting an answer will finish the question and it will not pop up again and agian for years.
    – Ingo
    May 30, 2020 at 9:13

1 Answer 1

0

Editing wpa_supplicant.conf seems an unusual way of switching networks; it is possible to have multiple networks defined in wpa_supplicant.conf.

Raspbian Stretch (by default) DOES NOT use the old style wpa_supplicant - dhcpcd has its own hook to call wpa_supplicant.

Try restarting dhcpcd sudo systemctl restart dhcpcd

3
  • This is being used in a mobile project and I'd like to be able to be able to bring down the interface entirely until its needed but running ifconfig wlan1 down && ifconfig wlan1 up results in the same "Association request to the driver failed" error message, as does restarting dhcpcd.
    – Pathead
    Aug 15, 2018 at 16:48
  • 1
    @PatrickDoyle Maybe you should edit your question to explain what you are trying to achieve. ifconfig is deprecated and not used by default in current Raspbian.
    – Milliways
    Aug 15, 2018 at 18:15
  • I updated the question. I tried ip link set wlan1 up/down and encounter the same issue.
    – Pathead
    Aug 15, 2018 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.