Edimax USB WiFi - Looses connection in Raspian Desktop


5 posts
by gobstopper » Sun Jun 30, 2013 9:28 am
Hello.

This is my first post so I am hoping I have put it in the correct section.

I bought my first Pi (a 512MB model B) about 10 months ago, it very quickly became my media player (running RaspBMC) so it wasn't until a few days ago, when I purchased a second unit, that I've had the opportunity to try out some other things. My RaspBMC unit has been successfully running with an Edimax EW-7811Un WiFi dongle (which I had noted had been recommended by other Pi users) so when I bought my second Pi I naturally opted for the same WiFi adapter. I am using a Logitech K400r wireless keyboard/trackpad on this new Pi and both units are powered by 1A rated HTC power adapters. My RaspBMC unit has barely missed a beat in the time it has been running, but I have encountered an oddity on the new set-up which has baffled me somewhat.

When I first ran the Raspian distro (downloading the latest build from the web site) and loaded the desktop I used the WiFi application to configure the Edimax adapter. I connected to my access point (sitting no more than 5 feet away) and I was then able to connect to the outside world. About 5 minutes later this stopped being the case. Nothing suggested the Pi was malfunctioning but, when I ran a terminal session a looked at the output of "ifconfig" I could see that the wlan0 interface no longer had an IP address associated. Moreover the WiFi app no longer appeared to recognize the device.

So I re-booted the Pi. Immediately after logging in I ran "ifconfig" again and was able to confirm that wlan0 was once again running with a live IP address. I could run ping and DNS tests to confirm that all was well. I then loaded the desktop again and was able to load Midori and browse the web - for a few minutes. Again after looking at a couple of web pages all my requests began to fail. Once again, a quick visit to the terminal highlighted that wlan0 was, again, lacking an IP address. Another re-boot, and it was the same all over again - from the CLI all was well, when the desktop first loaded, all was still well and then 3-5 minutes later nothing.

I re-booted again before going to bed and left it running overnight.

12 hours later with the Pi still in CLI mode, I am still able to ping its IP address and (because I had enabled it in raspi-config) access the SSH server.

Can anyone offer any explanation as to why I lose WiFi connectivity a few minutes after loading the desktop, or offer any suggestions as to what I can look for to see what may be happening so that I may pursue it further with the community?

Many thanks in anticipation.
-Phil.
Posts: 9
Joined: Sun Jun 30, 2013 9:08 am
Location: Essex - UK
by texy » Sun Jun 30, 2013 9:36 am
Hi and welcome to the forum.
Couple of things to try -
1..swap over the edimax dongles between your Pi's, to eliminate the possibility that the new one is dodgy.
2..I would change the PSU. Although it states 1 Amp, it may not be up to it, so to rule it out, try another. This is the most likely fix, but also try another usb lead if you have one as some will have a greater amount of voltage drop down them and be borderline acceptable.
3..also try a powered hub

Hope this helps,
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2480
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by gobstopper » Sun Jun 30, 2013 10:36 am
Texy - thanks so much for the prompt reply.

I acknowledge what you are saying regarding the power supply. When I was first working with my RaspBMC unit, I would power it directly from my PCs USB port (as early builds didn't natively support WiFi and I'd have to configure this manually before moving it into the room where I wanted to use it) and would encounter random hangs. Switching to the HTC power supply fixed that problem. Given the stability of this unit, I naturally assumed my new set-up would be just as compliant.

I hadn't thought about swapping the WiFi adapters. Won't do any harm. On that score, I could also swap the power supplies.

I have recently got a new mobile phone (Galaxy S4) which has been supplied with a 2A-rated power supply so will give that a try. Even if it isn't a true 2A, it should be quite a bit more than the HTC PSU I am currently using.

I will report my findings.

-Phil.
Posts: 9
Joined: Sun Jun 30, 2013 9:08 am
Location: Essex - UK
by gobstopper » Mon Jul 01, 2013 7:58 am
Well, I think I can rule the Edimax WiFi adapter out.

I swapped it out with the adapter (of the same make/model) in my RaspBMC Pi unit and it has been happily working through Sunday. Unfortunately the remainder of my Sunday was occupied with other tasks so I was not able to re-test the other WiFi adapter in my new Pi. I have, however, connected my 2A-rated power adapter in preparation.

More to come...

-Phil.
Posts: 9
Joined: Sun Jun 30, 2013 9:08 am
Location: Essex - UK
by gobstopper » Fri Jul 05, 2013 6:24 pm
Have been reading through the various online resources and and finding out new things every day.

Getting to the bottom of this problem, so far, hasn't been one of them. I'm working with a fresh Raspian installation and the Pi is now running off a 2A-rated power supply (Samsung Galaxy S4 charger). I can use the WiFi tool to connect to my access point. Following a re-boot it re-connects without any complaint and I can leave it running the CLI for hours on end. I spent most of today connected to it using SSH. No issue at all.

Launch the desktop and within 5 mins, connectivity is lost. Using some of my acquired knowledge over the past couple of days I run a terminal session and run "sudo ifdown wlan0" followed by "sudo ifup wlan0". When running the latter command the following errors appear:-

sudo ifup wlan0
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument

If I resort to another re-boot all is well again, but I am going round in circles with this gremlin.

Next step is a powered USB hub, but if anyone can explain these errors that would be great.

Thanks again.

-Phil.
Posts: 9
Joined: Sun Jun 30, 2013 9:08 am
Location: Essex - UK