Wilink Android
From OMAPpedia
Contents |
[edit] Android
We recommend that you proceed to these steps below after you have done completing the Android build.
[edit] Build WLAN Driver
- Note: uImage must be accessible through the PATH
$ cd $MYDROID/system/wlan/ti/wilink_6_1/platforms/os/linux $ export PATH=:$PATH $ export CROSS_COMPILE=arm-none-linux-gnueabi- $ export ARCH=arm $ export HOST_PLATFORM=zoom2 $ export KERNEL_DIR=$MYDROID/kernel/android-2.6.29 $ make clean $ make
[edit] WLAN in Android file system
Copy the files needed to the root directory.
$ cd $MYDROID/system/wlan/ti/wilink_6_1/platforms/os/linux $ cp tiwlan_drv.ko $MYDROID/out/target/product/zoom2/root/ $ cp sdio.ko $MYDROID/out/target/product/zoom2/root/ $ cp tiwlan.ini $MYDROID/out/target/product/zoom2/root/
[edit] WLAN Firmware
- Firmware.bin is required for enabling WLAN functionality on Zoom2. Download and install from https://gforge.ti.com/gf/project/wilink_drivers/
Placing firmware in Android's file system:
$ cp <$YOUR_DOWNLOAD_PATH>/firmware.bin $MYDROID/out/target/product/zoom2/root/
- Note: YOUR_DOWNLOAD_PATH=where firmware.bin is located
[edit] Bluetooth
BT is available on 2.26.27 kernel and in the latest release.
[edit] BT in Android file system
- Firmware init scripts are required for enabling BT functionality on Zoom2. Download and install from https://gforge.ti.com/gf/project/wilink_drivers/
$ mkdir $MYDROID/out/target/product/zoom2/system/lib/firmware $ cp $YOUR_DOWNLOAD_PATH/BTFM/scripts_for_l25.xx/*.bts $MYDROID/out/target/product/zoom2/system/lib/firmware
- Note: YOUR_DOWNLOAD_PATH=where the BT scripts are located
[edit] BT PAN profile
Zoom2 platform can be used as Network Access Points (NAP) for tethering scenario.
[edit] Prerequisites
- It is assumed that a network connection has already been enabled; you can use Wifi, Modem or Ethernet connection.
- In the tutorial, the PAN user is a PC under Windows XP and a Bluetooth application with PANU support.
- The procedure described below has been tested with the OMAP Android RLS25.12 (Donut).
- The Firmware init scripts for BT have been installed (see above).
- Busybox is installed
[edit] Kernel configuration
To enable NAT, Netfilter configuration shall be updated as below:
- CONFIG_NETFILTER=y
- CONFIG_NETFILTER_ADVANCED=y
- CONFIG_NF_CONNTRACK=y
- CONFIG_NETFILTER_XTABLES=y
- CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
- CONFIG_NF_DEFRAG_IPV4=y
- CONFIG_NF_CONNTRACK_IPV4=y
- CONFIG_IP_NF_IPTABLES=y
- CONFIG_NF_NAT=y
- CONFIG_NF_NAT_NEEDED=y
- CONFIG_IP_NF_TARGET_MASQUERADE=y
[edit] Procedure
[PC] Power-on the BT device.
-
[Zoom2] Enable Bluetooth in Settings > Wireless controls.
- -Check- You should see the computer in Bluetooth settings > Bluetooth devices list.
- Start the BlueZ PAN daemon to act as a Network Access Point (NAP).
$ pand --listen --role NAP
-
- Enable the Discoverable option in Bluetooth settings (you have 120 seconds from now to scan the BT devices from your PC).
[PC] Add this connection, then start it.
- [Zoom2] Check the network connection:
$ busybox ifconfig -a
-
- -Check- You should see a bnep0 interface.
- Enable it:
$ busybox ifconfig bnep0 192.168.0.1 up
[PC] Open the Network Connections (Control Panel).
- -Check- You should see the Bluetooth status as Connected.
-
In Properties > TCP/IP properties, enter the following configuration:
- IP address: 192.168.0.2
- Subnet mask: 255.255.255.0
- Default gateway: 192.168.0.1
- Apply the changes.
- -Check- You can now ping the Zoom2 over the BT connection:
$ ping 192.168.0.1 Pinging 192.168.0.1 with 32 bytes of data: Reply from 192.168.0.1: bytes=32 time=16ms TTL=64 Reply from 192.168.0.1: bytes=32 time=17ms TTL=64 Reply from 192.168.0.1: bytes=32 time=18ms TTL=64 Reply from 192.168.0.1: bytes=32 time=15ms TTL=64 Ping statistics for 192.168.0.1: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 15ms, Maximum = 18ms, Average = 16ms
- [Zoom2] Now we need to configure IP forwarding and Network Address Translation (NAT):
$ echo 1 > /proc/sys/net/ipv4/ip_forward $ iptables –t nat –A POSTROUTING –j MASQUERADE –o
-
-
-
could be tiwlan0, eth0, ppp0, … Check it with ifconfig.
-
-
[PC] -Check- You can now ping a machine via the Zoom2.
- [Zoom2] You need the DNS server assigned to the network connection:
$ getprop [net.gprs.dns1]: [xx.xx.xx.xx] [net.gprs.dns2]: [xx.xx.xx.xx] ... [dhcp.tiwlan0.dns1]: [xx.xx.xx.xx] [dhcp.tiwlan0.dns2]: [xx.xx.xx.xx] ...
[PC] Go back to Properties > TCP/IP properties
- Fill the DNS server addresses with the values displayed by getprop above.
- -Check- Open your web browser and enjoy!
[edit] Installing WLAN and Bluetooth in Android
Once the steps above have been completed continue creating Android's "myfs" directory. All the necessary files needed to run WLAN and Bluetooth will be included.
Refer to Creating Android's File System for more information.