WIFI on BeagleBone
I bought the RTL8188cus/RTL8192cu-based WIFI adaptor from Adafruit and followed the Adafruit WIFI BeagleBone Tutorial. I had a similar experience as almost everyone else: it didn't work. After beating my head against the wall and trying many things here's what I found:
The mainlined kernel driver for the adaptor's chipset (aka rtlwifi) does not work well.
I was able to get it to work, but it was unreliable, especially when changing access points.
Connman, the connection manager used by Angstrom linux, only seems to want one network adaptor in use at a time. It prefers Ethernet, so if you have an Ethernet cable plugged into your BeagleBone it will cause WIFI not to work.
The Realtek-supplied drivers work great.
Pre-requisites
These instructions are for Angstrom Linux, the distribution that ships with the BeagleBone. Make sure you are running the latest system image on your BeagleBone.
These instructions assume you are cross-compiling the driver on another machine (not the beaglebone) and they assume you have the BeagleBone 3.8 Linux kernel building in that environment. Use these instructions if you want to compile on the BeagleBone.
Go to the directory you have the kernel and run this to ensure it's ready to build modules
make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm scripts prepare
Steps
Get a binary of the Realtek drivers
Install the driver
Configure your WIFI settings
1) Build the RTL8192 Driver
Note: You can get the pre-patched source code here and a pre-built binary of the driver here. These may or may not work though, so I would recommend building it yourself.
Download the Unix/Linux driver from the Realtek web site - It will be called something like RTL8192xC_USB_linux_v3.4.4_4749.20121105.zip
Unzip the file and then unpack the driver source which is driver/tl8188C_8192C_usb_linux_v3.4.4_4749.20121105.tar.gz in the zip file
cp rtl8188C_8192C_usb_linux_v3.4.4_4749.20121105.tar.gz ~/ tar xvfz rtl8188C_8192C_usb_linux_v3.4.4_4749.20121105.tar.gz cd rtl8188C_8192C_usb_linux_v3.4.4_4749.20121105
Download this patch to add BB config and to fix building on linux 3.8 into the driver directory and apply it
wget https://raw.github.com/cmicali/rtl8192cu_beaglebone/master/util/rtl-8192-beaglebone-linux-3.8.patch patch -p1 < rtl-8192-beaglebone-linux-3.8.patch
Build the driver - Replace your_kernel_dir with the root of your BeagleBone 3.8 kernel source (mine is ~/projects/beaglebone_kernel/kernel)
make KSRC=your_kernel_dir
2) Install the RTL8192 Driver
Copy the driver (8192cu.ko) to your beaglebone and then log into it (note: change BeagleBoneBlack2 to the IP/hostname of your beaglebone)
scp 8192cu.ko root@BeagleBoneBlack2:~/ ssh root@BeagleBoneBlack2
Install the driver
mv 8192cu.ko /lib/modules/$(uname -r) depmod -a cd /etc/modules-load.d echo "8192cu" >rtl8192cu-vendor.conf
Blacklist the old rtlwifi drivers
cd /etc/modprobe.d echo "install rtl8192cu /bin/false" >wifi_blacklist.conf echo "install rtl8192c_common /bin/false" >>wifi_blacklist.conf echo "install rtlwifi /bin/false" >>wifi_blacklist.conf
3) Configure your Access Point
Edit /var/lib/connman/settings and enable WIFI
[global] OfflineMode=false [Wired] Enable=true Tethering=false [WiFi] Enable=true Tethering=false
Encrypt your passphrase
wpa_passphrase YourSSID YourPassphrase
Edit /var/lib/connman/wifi.config and set it to the following
[service_home] Type=wifi Name=YourSSID Passphrase=YourEncryptedPassphrase
Plug in your WIFI adaptor and reboot
shutdown -r 0
Closing Notes
These instructions assume you are using WPA security on your WIFI network
Connman appears to pick up changes to wifi.config almost immediately, so you can usually change WIFI AP/password without rebooting
Optional: I installed the latest version of connman(1.15) - I don't think it's required, but in case you want to install it this how I built it:
./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --sysconfdir=/etc --sharedstatedir=/com --localstatedir=/var --libdir=/usr/lib --includedir=/usr/include --oldincludedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man make make install
Optional: I also installed the latest version of wpa_supplicant (1.1) - here is the config file i used. Also libnl3-dev needs to be installed to build it
opkg install libnl-3-dev













