Wifi

= Software Configuration =

Debian/ubuntu with NetworkManager
NetworkManager uses its own wpa_supplicant configuration. That is the reason why manually editing /etc/network/interfaces to use wpa_supplicant does not work together with NetworkManager.

You have to disable all interfaces in /etc/network/interfaces e.g. by commenting out each line by inserting "#" as a first character.

You even have to disable Ethernet section to use wifi in network manager. Here is an example # interfaces(5) file used by ifup(8) and ifdown(8) auto lo   iface lo inet loopback #allow-hotplug eth0 #iface eth0 inet dhcp #auto eth0 #iface eth0 inet static #address 192.168.101.50 #netmask 255.255.255.0 #gateway 192.168.101.1 #broadcast 192.168.101.255 #auto wlan0 #iface wlan0 inet dhcp #   wpa-ssid YOUR-NETWORK-NAME #   wpa-key-mgmt WPA-PSK #   wpa-group TKIP CCMP #   wpa-psk YOUR-NETWORK-KEY

At your desktop there should emerge a network icon from NetworkManager in the task bar. You can edit the network setting with the gui dialogs.

Setup with wpa_supplicant and without network manager
There are many tutorials out there on how to do this. Here is a good one.

Disabling networkmanager. Fully.
Even with the common trick of putting the following in /etc/NetworkManager/NetworkManager.conf [ifupdown] managed=true the despotic NetworkManager still will be messing up your careful setup from /etc/network/interfaces, and you might, once again, be left without wifi upon the next reboot.

To stop NetworkManager from running altogether, you can run the following (as root):

echo "manual" > /etc/init/network-manager.override

Now, at least on ubuntu, your wifi driver, wpa_supplicant and ifupdown will not be smacked about anymore.

Simple and dumb WPA setup
Install the following packages, if they are not installed already:

apt-get install wireless-tools wpasupplicant

Edit /etc/network/interfaces and add the following:

auto wlan0 iface wlan0 inet dhcp wpa-ssid YourSSID wpa-psk YourWPASharedKey

This is the most basic, but static, setup possible for wifi. If you need anything more, you need to read up on wpa_supplicant, or run through one of the tutorials referenced above.

=Driver specific information=

Ampak
Ampak combines broadcom wifi and bluetooth chips in single modules.

Espressif
Espressif is a fairly young Chinese company.

esp8089
ESP8089 driver is available from linux-rockchip repository under drivers/net/esp8089. Please note that there are different versions of this driver in various branches.

RDA
RDA Microelectronics is a relatively unknown and new chinese chipmaker.

The RDA5990P is a single chip solution which includes Wifi, Bluetooth and an FM radio. Some code for this wifi chip is available in a Rockchip RK3188 kernel tree, but nobody has tested or ported this code yet.

Driver refuses to load (sunxi-3.4 kernel)
When using the rt5370sta, 8188eu, 8189es or 8192cu drivers, which are all for USB based realtek devices, it might occur that the driver refuses to load:

ERR: script_parser_fetch usb_wifi_usbc_num failed modprobe: can't load module 8188eu (kernel/drivers/net/wireless/rtl8188eu/8188eu.ko): Cannot allocate memory

This is because the usb_wifi_para section is missing from your script.bin:

[usb_wifi_para] usb_wifi_used = 1 usb_wifi_usbc_num = 2

Where usb_wifi_usbc_num is the usbc to which your realtek usb wireless chip is attached.

Edit the .fex file and create the script .bin as explained in our Manual build howto, and  send a patch to sunxi-boards in to our mailinglist.

8188eu
The sunxi-3.4 branch currently has v4.1.2_4787.20120803 available. There's are newer versions available at https://github.com/lwfinger/rtl8188eu/ which are v4.1.4_6773.20130222 and v4.1.8_9499.20131104. There's also a v4.1.8 file available at https://github.com/LazyZhu/myblog/raw/gh-pages/file/RTL8188EUS_RTL8189ES_linux_v4.1.8_9499.20131104.zip which is likely the original from Realtek.

Here's how to compile the latest version from Realtek:

Extract the driver/rtl8188EUS_rtl8189ES_linux_v4.1.8_9499.20131104.tar.gz from the RTL8188EUS_RTL8189ES_linux_v4.1.8_9499.20131104.zip file and extract it. These instructions assume your  directory is in the same directory as your   directory. It's also assumed that you've configured the kernel to include the 8188eu driver that's part of linux-sunxi.

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C ../linux-sunxi/ M=`pwd` modules

copy the  file over to the device and then install it into your kernel with the following commands (on the device as root):

modprobe -r 8188eu rm -rf /lib/modules/`uname -r`/kernel/drivers/net/wireless/rtl8188eu install -p -m 644 8188eu.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/ /sbin/depmod modprobe 8188eu

There are two changes you may want to make in :

1. The default is to output a LOT of logging and you can disable that by commenting out the following line:
 * 1) define CONFIG_DEBUG /* DBG_871X, etc... */

2. The default is to disable the activity LED on the wifi device which you may want to see to know that it's working. You can change that by un-commenting the following line: //#define CONFIG_LED

8188eu for mainline kernel
This driver requires firmware not available in the mainline kernel tree or standard realtek firmware packages.

Please fetch rtl8188eufw.bin and put it in /lib/firmware/rtlwifi/

8192cu
Workaround for dropping connection because power save.

[ 1139.170000] rtl8192c_dm_RF_Saving: RF_Normal [ 1139.170000] rtl8192c_set_FwPwrMode_cmd: Mode = 1, SmartPS = 2 [ 1139.850000] rtw_set_ps_mode: Busy Traffic, Leave 802.11 power save.. [ 1139.850000] rtl8192c_set_FwPwrMode_cmd: Mode = 0, SmartPS = 0 [ 1141.170000] rtl8192c_dm_RF_Saving: RF_Save [ 1145.170000] rtw_set_ps_mode: Enter 802.11 power save mode...

To fix the problem create a file /etc/modprobe.d/8192cu.conf with the following contents: options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

8723au
This device has no driver included in the kernel, but you can install it separately. It also supports Bluetooth 4.0 functionality.

Wifi
check out the RTL8723AU driver from https://github.com/lwfinger/rtl8723au.git and compile with the following command:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C ../linux-sunxi/ M=`pwd` modules

NOTE: This command assumes that you checked out the rtl8723au repo into the same directory as the linux-sunxi repo (note the  points to where your local kernel repository is)

copy the  file over to the device and then install it into your kernel with the following commands (on the device as root):

install -p -m 644 8723au.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/ /sbin/depmod modprobe 8723au

You should now see a new wireless device if you run.

Bluetooth
The Bluetooth functionality is included in the hardware that does the wifi, so you may need to have the wifi drivers described above working to also have this working. However, don't expect it to work particularly well as there appear to be numerous bugs (in either the driver or the hardware or both). There seems to also be an issue where using both wifi and bluetooth at the same time cause severe interference to the point where connections are dropped (this has been seen in the stock Android firmware as well).

check out the code from https://github.com/lwfinger/rtl8723au_bt.git and compile with the following command:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C ../linux-sunxi/ M=`pwd` modules

NOTE: This command assumes that you checked out the rtl8723au_bt repo into the same directory as the linux-sunxi repo (note the  points to where your local kernel repository is)

copy the *.bin and *.ko files over to the device and run the following on the device (as root) where you have your files:

mkdir -p /lib/firmware/rtk_bt cp rlt8723a_chip_b_cut_bt40_fw_asic_rom_patch-svn8511-0x0020342E-20121105-LINUX_USB.bin /lib/firmware/rtk_bt/rtk8723a.bin install -p -m 644 rtk_btusb.ko /lib/modules/`uname -r`/kernel/drivers/bluetooth/ /sbin/depmod modprobe rtk_btusb