Edimax Wifi Not Connecting
#1
So I bought an Edimax Wifi dongle with my CM3 kit and thought it would be supported out of the box. I was to be taught otherwise.

I was using the /boot/wifikeyfile.txt method to read a key from the SD card, since I didn't want to bother using a powered USB hub to connect a keyboard AND the dongle.

The dongle was able to scan the networks but not able to actually connect.

The log of wpa_supplicant actually looks like this with the faulty driver:
Code:
$ sudo wpa_supplicant -i wlan1 -c /etc/wpa_supplicant/wpa_supplicant.conf 
Successfully initialized wpa_supplicant
wlan1: Trying to associate with de:ad:be:ef:13:37 (SSID='My Cool Wifiname 2.4GHz' freq=2417 MHz)
wlan1: CTRL-EVENT-DISCONNECTED bssid=de:ad:be:ef:13:37 reason=0
wlan1: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan1: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=DE
wlan1: Trying to associate with de:ad:be:ef:13:37 (SSID='My Cool Wifiname 2.4GHz' freq=2417 MHz)
wlan1: CTRL-EVENT-DISCONNECTED bssid=de:ad:be:ef:13:37 reason=0
wlan1: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan1: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=DE
wlan1: Trying to associate with de:ad:be:ef:13:37 (SSID='My Cool Wifiname 2.4GHz' freq=2417 MHz)
wlan1: CTRL-EVENT-DISCONNECTED bssid=de:ad:be:ef:13:37 reason=0
wlan1: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan1: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=DE
wlan1: Trying to associate with de:ad:be:ef:13:37 (SSID='My Cool Wifiname 2.4GHz' freq=2417 MHz)
wlan1: CTRL-EVENT-DISCONNECTED bssid=de:ad:be:ef:13:37 reason=0
wlan1: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="My Cool Wifiname 2.4GHz" auth_failures=1 duration=10 reason=CONN_FAILED
wlan1: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan1: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=DE


So I connected the freeplay to a hub with a keyboard and have written the password by hand. It actually does not help at all that you can't unhide the password, especially considering the freaking UK default keyboard layout in RetroPie, thanks for that. I'm from Germany and I use a US layout. But most people can at least write on an US layout with a different keybaord, UK not so much. Btw, you can reconfigure the layout like so: https://wiki.debian.org/Keyboard#Keyboard_configuration

This didn't work either so I needed to go deeper.

On my Arch Linux the dongle worked just fine, so my expectations that  Raspbian screwed up intensified.
Even though the dongle is listed as supported in debian:
https://wiki.debian.org/rtl819x#supported-rtl8192cu

The dongle also worked with Arch Linux ARM on the same Rpi3.

I plugged in the SD card with the freeplay image into my pi3 and it worked just fine (besides the shutdown being broken and the terminal resolution being for ants).

The raspberry pi showed the same behavior as the freeplay, so the issue was likely to be in the image.

Code:
$ dmesg | grep usbcore
[    0.061386] usbcore: registered new interface driver usbfs
[    0.061443] usbcore: registered new interface driver hub
[    0.061525] usbcore: registered new device driver usb
[    0.204266] usbcore: registered new interface driver lan78xx
[    0.204320] usbcore: registered new interface driver smsc95xx
[    0.635014] usbcore: registered new interface driver usb-storage
[    0.639055] usbcore: registered new interface driver usbhid
[    3.541939] usbcore: registered new interface driver rtl8192cu
[    3.841311] usbcore: registered new interface driver brcmfmac

Apart from the pi3's onboard wifi, which uses the brcmfmac kernel driver, we have rtl8192cu loaded for the Edimax dongle.

Archlinux is using the same kernel driver, but also loads the more recent and recommended rtl8xxxu. (recommendation source: https://github.com/lwfinger/rtlwifi_new/issues/82)

Code:
[34776.341042] usbcore: registered new interface driver rtl8192cu
[34776.347034] usbcore: registered new interface driver rtl8xxxu

But besides that Arch was also loading a firmware for the dongle:
Code:
$ dmesg | grep firmware
[34776.338324] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin

And this was not the case on the pi3. Even though the firmware was in place! (/lib/firmware/rtlwifi/rtl8192cufw_TMSC.bin on debian)
On Arch the firmware was part of the linux-firmware package, on raspbian / debian it's in the firmware-realtek package.

SO ... something was not loading the firmware. The big WTF moment after a long investigation i found that raspbian is obviously blacklisting rtl8192cu and rtl8xxxu.
Not sure why they do that and why rtl8192cu is loaded anyway but this is the post that decided this
https://github.com/raspberrypi/linux/iss...-283650385

Anyway, removing the blacklist for the drivers I needed made Wifi work just fine without any performance issues. I was able to clone stuff from git and ssh into the freeplay \o/
Maybe this has changed in a kernel update, the freeplay image is using a pretty recent one (4.14.34-v7+) vs 4.9.35-v7+ in stable raspbian.

TL;DR

To fix your Edimax wifi on the freeplay image do the following:
Code:
sudo rm /etc/modprobe.d/blacklist-rtl8192cu.conf
sudo rm /etc/modprobe.d/blacklist-rtl8xxxu.conf
sudo reboot
You are welcome.
Reply
#2
That's VERY interesting. I wonder if something changed in RetroPie 4.4, because I don't recall seeing this before. I will definitely be looking into this. I don't know why the driver would be blacklisted.

Thanks for the groundwork on all of that. I'll be looking into it, because we obviously need to support the WiFi dongle that we recommend!
Card Fighters' Clash 2 English Translation ( http://cfc2english.blogspot.com/ )
Neo Geo Pocket Flash Cart and Linker Project ( http://www.flashmasta.com/ )
Avatar art thanks to Trev-Mun ( http://trevmun.deviantart.com/ )
Reply
#3
I looked into this a bit just now.  On my machine, after I plug in the Eximax USB dongle, I see this if I run 'lsmod.'
 Module                  Size  Used by
 8192cu                589824  0

If I 'cat /etc/modprobe.d/blacklist-rtl8192cu.conf' it shows
 blacklist rtl8192cu
which is a different driver than 8192cu.  I think that '8192cu' is built into the kernel, and '8192cu.ko' is definitely a loadable kernel module object/driver.

I'm not sure why you need rtl8192cu instead of 8192cu.



Instead of the /boot/wifikeyfile.txt method, maybe try the /boot/wpa_supplicant.conf method.  That's what I typically use.
See https://github.com/RetroPie/RetroPie-Set...supplicant
In fact, see: https://raspberrypi.stackexchange.com/qu...eadless-pi

Use this format as a skeleton (replacing everything between the « and »):
Code:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=«your_ISO-3166-1_two-letter_country_code»

network={
   ssid="«your_SSID»"
   psk="«your_PSK»"
   key_mgmt=WPA-PSK
}
Card Fighters' Clash 2 English Translation ( http://cfc2english.blogspot.com/ )
Neo Geo Pocket Flash Cart and Linker Project ( http://www.flashmasta.com/ )
Avatar art thanks to Trev-Mun ( http://trevmun.deviantart.com/ )
Reply
#4
I have a wpa_supplicant.conf in place. It is also created by RetroPie-Setup, and I created it manually with wpa_passphrase. The dongle is able to scan networks but is not able to actually connect.
When I put the blacklist back in place 8192cu is loaded for me as well. But the driver fails to connect.

Here is the critical part of the wpa_supplicant log:

Code:
wlan1: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="My SSID" auth_failures=1 duration=10 reason=CONN_FAILED


Does is load any firmware for you? It does not for me

Code:
$ dmesg | grep firmware

Well I really wonder why the 8192cu apparently works better for the people at raspbian and you, but not for me at all. Are you using Kernel 4.14.34-v7+? I guess you are, since you are using your image.

The modprobe override is also a custom change in behavior. Linux upstream and other distros (Arch) obviously prefer rtl8192cu which also works for me.

Btw I used rpi-update (https://www.raspberrypi.org/documentatio...pdating.md) but since it changes the boot partition it breaks your customization and the controller input is not registered anymore. I wonder if there any instructions on how to apply the freeplay changes on top of RetroPie. Are the scripts in a git repo somewhere?

Edit: Found the repo, you linked it in another post https://github.com/TheFlav/Freeplay-Support

I guess I could try running https://github.com/TheFlav/Freeplay-Supp...install.sh after the rpi-update.
Reply
#5
A few things...

If rtl8192cu works for you, then stick with that. It certainly could be better. We picked that Edimax device, because it just works (for most people I guess) when plugged in, and it draws less power than the cheapo dongles.

I wonder if there could be something about your WiFi network that is different than most. You mentioned that it can scan but not join, and that you used wpa_passphrase to create your key. I've always just created the /boot/wpa_supplicant.conf by hand (with nano or whatever) and put in my plaintext passphrase. I don't know, but I think the most important thing is that it's working and I really appreciate that you've documented it so well. Now if anyone else has issues, they should be able to follow your guide to try rtl8192cu.

I have yet to figure out why the 'dkms' driver for the button input doesn't automatically rebuilt itself when you update to a new kernel. That's part of the point of dkms, but it never seems to work. Rebuilding the controller input driver is pretty simple (if you have a SSH or keyboard console). After a kernel upgrade, reboot to the new kernel and run these...

sudo dkms build -m mk_arcade_joystick_rpi -v 0.1.5.6
sudo dkms install -m mk_arcade_joystick_rpi -v 0.1.5.6

The 0.1.5.6 is the version number of mk_arcade_joystick_rpi that you want to build/install.

There are actually 3 github repositories that go into a Freeplay Zero/CM3 SD image. Each of them has an install.sh script.
https://github.com/TheFlav/rpi-fbcp
https://github.com/TheFlav/mk_arcade_joystick_rpi
https://github.com/TheFlav/Freeplay-Support

There are also these notes/instructions that I use for other config mods.
https://docs.google.com/document/d/1jsMi...5ni83q4rvn
Card Fighters' Clash 2 English Translation ( http://cfc2english.blogspot.com/ )
Neo Geo Pocket Flash Cart and Linker Project ( http://www.flashmasta.com/ )
Avatar art thanks to Trev-Mun ( http://trevmun.deviantart.com/ )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)