This is a documentation to HTML5:
Demorou, mas finalmente a Anatel deixou claro o que já estava previsto na lei, mas não estava escrito em letras garrafais:
Driver’s binary firmware is a dedicated issue to Linux. In fact even open source drivers usually load its firmware to internal chip and it drives some puritan GNU people to become crazy.
Unfortunately you don’t have much option because these firmware are necessary to get your device working.
When developing an embedded system you could face a “Chicken and Egg” dilemma related to firmware loading. For example, you could need to mount a root file system through NFS over wireless, but your wireless interface needs a firmware which is in the rootfs (at /lib/firmware).
Hopefully you have some approaches to solve this dilemma:
1) Create an initrd (initramfs) with needed firmware inside;
2) Include your driver built-in into the kernel.
To include the needed firmware into the kernel just select this option:
Device Drivers ---> Generic Driver Options ---> -*- Userspace firmware loading support [*] Include in-kernel firmware blobs in kernel binary
Also you could specify an external firmware path at:
(/home/user/newfirmware.bin) External firmware blobs to build into the kernel binary
I’m configuring Android to add support to wireless adapter. Unfortunately it is not easy as it is on Linux. Let walk through the process:
I started compiling Linux kernel with support to my wireless adapter RT73, basically my kernel has:
CONFIG_WLAN_80211=y CONFIG_RT2X00=y CONFIG_RT73USB=y CONFIG_RT2X00_LIB_USB=y CONFIG_RT2X00_LIB=y CONFIG_RT2X00_LIB_FIRMWARE=y CONFIG_RT2X00_LIB_CRYPTO=y CONFIG_RT2X00_LIB_RFKILL=y CONFIG_RT2X00_LIB_LEDS=y
Other big mistake was the firmware path, in Linux kernel it is placed at /lib/firmware. I lost some time to figure out the right place it /etc/firmware:
$ adb push rt73.bin /etc/firmware/
After than I try to start-up wifi on Android shell this way:
# netcfg wlan0 up
Arggg, “no donuts for you”
Finally I found more some nice tips here:
Again, more issues, wpa_supplicant binary doesn’t exist. After a little more researches I found the problem: I need to inform to it be build: Edit external/wpa_supplicant/Android.mk and modify:
WPA_BUILD_SUPPLICANT := true
Compile Android again.
Create a wpa_supplicant.conf (in fact just modify the ti_wlan0 one) adding your wireless interface (wlan0 in my case):
Connect in your AP:
# wpa_cli ... set_network 0 ssid "your_ap_name" #wpa_cli ... set_network 0 key_mgmt WPA-PSK #wpa_cli ... set_network 0 pairwise CCMP TKIP #wpa_cli ... set_network 0 psk "makemeveryverysecret"
Configure route and DNS:
# route add default gw 192.168.0.254 dev wlan0 # setprop net.dns1 18.104.22.168
An useful thread about this topic is here:
When trying to turn Wi-Fi ON using Android setting, I was getting this error message:
"unable to start Wi-Fi"
Then using “adb logcat” I can see the error:
"E/WifiService( 1935): Failed to load Wi-Fi driver"
Then I figured out the issue, Android wants loads the driver by itself, because I place the driver built-in into kernel, it will work at console, but will not work on graphic mode.
I saw some people suggesting adding it on init.rc:
setprop wlan.driver.status "ok" setprop init.svc.wpa_supplicant "running"
Unfortunately it didn’t worked to me.
Then I changed the wifi driver to module on Linux kernel and modified “hardware/libhardware_legacy/wifi/wifi.c” to load that driver for me:
#ifndef WIFI_DRIVER_MODULE_PATH #define WIFI_DRIVER_MODULE_PATH "/system/lib/modules/rt73usb.ko" #endif #ifndef WIFI_DRIVER_MODULE_NAME #define WIFI_DRIVER_MODULE_NAME "rt73usb" #endif
Also I copied the modules files (rt2x00lib.ko, rt2x00usb.ko, rt73usb.ko) to “/system/lib/modules” and called insmod to them in init.rc
UPDATE: Nicu Pavel created a great tutorial explaining more about Wireless on Android:
My friend Sergio Berlotto send me the link to this nice stroboscope clock:
This is different from other stroboscope clock which just turn on/off LEDs to form numeric digits.
You know: it is not easy to find an external WiFi USB dongle which works with aircrack. Happily some dongles powered by Ralink RT73 will work fine.
I’m using TP-Link TL-WN321G and got it working with kismet.
I just edited /etc/kismet/kismet.conf and replaced the “source” line:
Tricks to get better binary to debug with GDB:
I used this command to “mount” my initramfs file:
gzip -dc /boot/initrd-2.6.x | cpio -id
In this site you can find main internal chips used on many (old) cell phones:
This guy (Cris Paget) ported OpenBTS to run on Android:
I wish to have a USRP in order to test OpenBTS, but I think it still a little bit expansive.
BTW, great work Cris, great work!