Up to now I have been using an Edimax EW-7812UAn V2 USB WiFi Dongle. This has been very reliable and reasonably simple to install and configure. The only problem is that it operates on the 2.4 GHz frequency band, which means it will interfere with the majority of modern radio control systems. Up to now I have been using a 35 MHz RC system which was fine as long as I was flying on my own. However, I’d like to fly with others who will be using 2.4 GHz systems.
There are now a number of Dual Band Wifi Dongles that operate in the 5 GHz band as well as at 2.4 GHz. This provides a solution so long as they work with the Raspberry Pi. A couple of candidates were obtained, configured and tested on my Model B Raspberry Pi. For an extra comparison I also ran a test over the wired LAN interface.
The results were interesting in that there was no clear winner in the speed stakes, there was however a clear loser. What is clear is that useable 5 Ghz WiFi is possible but for now it’s not plug and play.
For these tests I used the following network devices.
- Raspberry Pi Model B Ethernet (100 Mbit/s)
- Tenga W522U Dual Band (2.4 GHz & 5 GHz)
- Edimax EW-7612UAn V2 (2.4 GHz)
- Edimax AC600 Dual Band (2.4 GHz & 5 GHz)
I setup my Model B, with the latest release of Raspbian (2015-01-31) and the current scripts.
5 GHz WiFi Prerequisites
To get 5GHz WiFi working you need to install the Central Regulatory Domain Agent (crda). Basically, the 5 GHz band is more tightly regulated worldwide and you need to specify your regulatory domain so that hostapd knows which channels are available.
To install the necessary packages use:
sudo apt-get install hostapd crda iw
Then edit /etc/default/crda and set the REGDOMAIN variable to match your region. Examples are US, JP, EU and in my case UK.
The amount of work needed to setup networking varied by device. I’m not going to give a detailed description of configuring each device. I’ll do that in separate posts.
This simply required plugging the Pi and the Laptop into a switch and running ipconfig on the receiving device to get its IP address. This was then used in remote.conf to direct the UDP stream.
2. Tenga W522U
The W522U is nl80211 compatible. This means it works with a standard install of hostapd. No special configuration is needed.
3. Edimax EW-7612UAn V2 (2.4 GHz)
The EW-7612UAn V2 uses the RTL8191SU chipset. The kernel supports this chipset for client networking, but not for AP mode. However, Realtek provide a custom version of hostapd that needs to be downloaded, compiled and installed which does work.
4. Edimax AC600 Dual Band (2.4 GHz & 5 GHz)
The AC600 is not supported by the latest kernel. All is not lost, it just takes a little more work. You need to download the kernel source code and the code for a Realtek 8812U driver. Then you need to install the latest version of GCC from the Jessie repository. This lets you build the kernel module. Finally you need the same hostapd build as for the Edimax EW-7612UAn V2 device.
There are four combinations of hostapd.conf depending on the driver and band. I’ve set them out in the table below.
|Hostapd Version||2.4 GHz||5 GHz|
interface=wlan0 driver=nl80211 ssid=Pi_AP hw_mode=g channel=13 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=Raspberry wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
interface=wlan0 driver=nl80211 ssid=Pi_AP hw_mode=a channel=44 ht_capab=[HT40+] ieee80211n=1 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=Raspberry wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
interface=wlan0 driver=rtl871xdrv ctrl_interface=/var/run/hostapd ssid=Pi_AP channel=13 beacon_int=100 hw_mode=g ieee80211n=1 wme_enabled=1 wpa=2 wpa_passphrase=Raspberry wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP max_num_sta=8 wpa_group_rekey=86400
interface=wlan0 driver=rtl871xdrv ctrl_interface=/var/run/hostapd ssid=Pi_AP channel=44 beacon_int=100 hw_mode=a ieee80211n=1 wme_enabled=1 ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+] wpa=2 wpa_passphrase=Raspberry wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP max_num_sta=8 wpa_group_rekey=86400
These tests were a straight comparison between the four devices using the same settings and the same testing methodology as previously. The resolution was 1280 x 720 pixels with a 6Mbps bit rate.
The table below shows the resulting latency by device.
|Edimax EW-7612UAn V2 – 2.4 Ghz||132 ms|
|Tenga W522U – 2.4 GHz & 5 GHz||> 10 s|
|Edimax AC600 – 2.4 GHz||122 ms|
|Edimax AC600 – 5 GHz||126 ms|
Here they are as a graph.
The big surprise is how bad the Tenga W522U adapter was. The latency was not just two or three times higher, it was two order of magnitudes higher. There are a number of threads on various forums where other people have found similar issues, although not to this extent, but then they are probably not swamping the feed with a continuous video stream. Whether this is just a compatibility issue with the Pi remains to be seen.
The Edimax AC600 was 10 ms faster than the previously used Edimax 7612UAn V2 at 2.4 GHz. At 5GHz it was still faster, but only by 6ms. Interestingly, the LAN connection was not any faster than the AC600. On the Pi the LAN connection is 100 MBit/s as is the USB bus, so although the AC600 is theoretically capable of 433 Mbit/s it is never going to manage more than 100.
What we can take away from this test is that there is a limit to how much the latency can be reduced by changing the WiFi adapter. It is a shame that to get a 5 GHz WiFi link requires a lot of compiling and configuration. Hopefully this will improve with time. For now we have another small reduction in the video latency to add to the current optimisations.
Just as these tests were being done, the new Raspberry Pi 2 was released promising a x1.5 to x6 speed increase. As I had used the latest release of Raspbian, I swapped the microSD card from from the Model B to the Model 2B. What I found was that the Edimax AC600 was no longer detected and I couldn’t find a way to compile the module so that it would. So that’s my next task. I may run a quick comparison of the B versus the 2B with the Edimax 7612UAn V2 to see how much improvement the new processor has made.