Need to get edimax EW7811 wifi usb working on BBB with Angstrom

I got two different Realtek based dongles working on the Beaglebone Black, the Edimax EW-7811Un (RTL8188CUS) and the GMYLE WFUS11N06203V1 (RTL8191US).

I did a little write-up on it here: http://nordicgroup.us/bbb/wireless/

Thanks, that works very well and is (at least for me) quite stable. The only remaining problem is to get WLAN to connect automatically at power-up since I want to build the Beaglebone into a wireless robot (headless and no UTP cable :wink: ). I have configured it using “test-connman autoconnect” to automatically connect and it tries to, but times out on authorization, see the relevant dmesg output below:

[ 25.432333] wlan0: authenticate with c0:25:06:ce:c1:3f
[ 25.451398] wlan0: send auth to c0:25:06:ce:c1:3f (try 1/3)
[ 25.650886] wlan0: send auth to c0:25:06:ce:c1:3f (try 2/3)
[ 25.852058] wlan0: send auth to c0:25:06:ce:c1:3f (try 3/3)
[ 26.053217] wlan0: authentication with c0:25:06:ce:c1:3f timed out

When I then try to connect through the windows interface as described in your write-up it works flawlessly. Alternatively, doing a “test-connman connect” with the appropriate configutation directory also works. It just fails at boot. I have looked around but can’t find a description of this problem or of a way to configure the time-out (maybe my router is just too slow). DO you have any suggestions? Thanks!

Best regards,

Peter

It seems there is a problem with the Edimax reliably picking up a medium or low strength WiFi router signal. I’ve put the Edimax dongle directly into the USB port, where it usually doesn’t pick up my router (even though the laptop next to it shows a 4-bar signal strength from the same router). When I hold my finger against the plastic part of the dongle (where I assume the antenna is located) it responds reliably to pings. If I remove my finger, it doesn’t respond at all. Interestingly, when I connect the UTP Lan cable (connected to the same router) the reception improves and becomes reliable again.

That is apparently what happened during boot: the UTP cable was not connected (since I read in several posts in this group that connman doesn’t seem to connect to WiFi if eth0 is connected) and I did not hold my finger against the plastic of the dongle. Therefore, no response to the auth request was received. When I connect the UTP cable to see what’s going on I can manually connect to the router without problems since the reception has apparently improved. When I boot holding my finger against the antenna then WiFi will be connected even without the UTP cable.

Does anybody else have similar experiences? I read in other posts that the Edimax is unreliable in setting up and maintaining a connection, could this have the same cause?

I will now try a few things:

  1. Connect the dongle through a USB cable. It could be that the small antenna in the dongle (which cannot be a typical 1/4 wavelength monopole or 1/2 wavelength dipole because that would be 3cm resp. 6cm) is rather sensitive to having an appropriate ground plane around. The shield of the USB cable might change (and even improve) that, although this is of course just guessing.
  2. Connect the dongle to my laptop to find out whether the dongle is much less sensitive than the built-in WLAN receiver of my laptop.

If something interesting comes out of these experiments I will of course let you know.

Best regards,

Peter

I did a little write-up on it here: http://nordicgroup.us/bbb/wireless/

The only remaining problem is to get WLAN to connect automatically at power-up

It seems there is a problem with the Edimax reliably picking up a medium or low strength WiFi router signal.

The wlan0 auth problem at boot disappears when I connect the WiFi dongle (Edimax) through a USB extension cable rather than directly to the BeagleBone. After some experiments it seems that the connection gets worse when I hold the dongle close to the BeagleBone, even though the reported signal strength remains more or less constant (reported by iwconfig between -50dBm and -60dBm). Maybe the dongle is picking up some interference from the board?

If somebody is interested I could do some measurements to determine interference levels from the BeagleBone, but for now I’m glad that I can continue working on my project.

Anyway, I hope this message will help some of you who were also experiencing startup/reliability problems with WiFi on the beaglebone.

Best regards,

Peter

If something interesting comes out of these experiments I will of course let you know.

Is the HDMI active in your configuration?

Gerald

I haven’t anything connected to HDMI but I suppose it is active - I’m running Angstrom and didn’t make any modifications to the display part (other than running x11vnc). Do you think that might cause interference? Should I try switching it off (and how do I do that easiest)?

Best regards,

Peter

Well, it is an unterminated cable, but my understanding is that it should be off if nothing is plugged in. If something is plugged in, the connector is close to the USB connector, so that is why I asked.

Gerald

Not to muddy the waters by introducing a different person by the same first name, but…

I have been having what appear to be very similar problems with the Edimax. I have not yet tried a USB extension cable to avoid possible interference, but I plan to.

My own experience is that, if connected via Ethernet, I can run the /usr/lib/connman/test/test-connman connect command as you suggest, and that will make the service go from “idle” to “ready.” Disconnecting the Ethernet cable will sometimes cause the wireless connection to come up.

Note: I had trouble figuring out what the was supposed to be. Apparently it’s the last portion of the item in brackets output by connman/test/get-services, e.g., /net/connman/service/wifi_801f02b6cbb8_5361786f6e7920616e642049206b6e6f77206974_managed_psk.

Still, I am also finding that the wireless connection is intermittent and will shut down easily even if connected. The “strength” of the service, as reported by get-services, has been anywhere from 58 to 80. I am not sure how to cause connman to rescan for a different strength reading (though it does seem to self-update periodically?), nor have I noted any specific reasons for higher or lower values.

See my post to the other thread:

https://groups.google.com/d/msg/beagleboard/Fbb3LqbSjc0/cB6lZeTPozkJ

Even when I can get mine to connect, it isn’t stable enough to do a “opkg update”, if I ping the router, you can see the wide variance in ping times as well as many dropped packets (50% loss):

`
root@beaglebone:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=6910 ms
64 bytes from 192.168.1.1: icmp_req=2 ttl=64 time=5910 ms
64 bytes from 192.168.1.1: icmp_req=4 ttl=64 time=3913 ms
64 bytes from 192.168.1.1: icmp_req=5 ttl=64 time=3538 ms
64 bytes from 192.168.1.1: icmp_req=6 ttl=64 time=2790 ms
64 bytes from 192.168.1.1: icmp_req=7 ttl=64 time=1799 ms
64 bytes from 192.168.1.1: icmp_req=8 ttl=64 time=799 ms
64 bytes from 192.168.1.1: icmp_req=9 ttl=64 time=90.5 ms
64 bytes from 192.168.1.1: icmp_req=10 ttl=64 time=22.3 ms
64 bytes from 192.168.1.1: icmp_req=11 ttl=64 time=54.3 ms
64 bytes from 192.168.1.1: icmp_req=12 ttl=64 time=65.2 ms
64 bytes from 192.168.1.1: icmp_req=14 ttl=64 time=1250 ms
64 bytes from 192.168.1.1: icmp_req=16 ttl=64 time=32.8 ms
64 bytes from 192.168.1.1: icmp_req=19 ttl=64 time=1072 ms
64 bytes from 192.168.1.1: icmp_req=20 ttl=64 time=894 ms
64 bytes from 192.168.1.1: icmp_req=21 ttl=64 time=40.8 ms
64 bytes from 192.168.1.1: icmp_req=26 ttl=64 time=1729 ms
64 bytes from 192.168.1.1: icmp_req=27 ttl=64 time=737 ms
^C
— 192.168.1.1 ping statistics —
36 packets transmitted, 18 received, 50% packet loss, time 35017ms
rtt min/avg/max/mdev = 22.315/1758.606/6910.572/2022.076 ms, pipe 7

`

Frustrating!

Winston,

I have definitely noticed that providing a “body ground” for the entire board seems to help. What I mean is, just hold the BeagleBone in your hand, and you may find that your pings suddenly start returning more reliably. What’s more, sometimes having done this will positively affect the board for the foreseeable future - last night I connected my Bone to a wireless network and was dropping most of the packets. I picked it up and held it for a minute or so - long enough to watch the pings start returning consistently and quickly - and then set it back down. It then ran for 3 hours, only dropping 0.4 percent of the pings from that point on. I imagine it would have stayed connected indefinitely.

For some reason, it just seems that there are a lot of strange interference or subtle electrical grounding issues with this wireless device. I have two Bones and two of the Edimax dongles, and both of them exhibit this behavior to some extent or another. Nevertheless, if all it takes is providing an additional ground of some sort, I think I can manage to make that work.

You know. That would explain why in some cases using the extender cable makes it work. When down on a table, the area below the dongle is blocked and has a trouble getting the RF out.

You might try putting standoffs on the board to raise it up off the table.

Gerald