WiFi and WPA_SUPPLICANT - Android Q&A, Help & Troubleshooting

Hi Guys,
I am stumped on this. I am trying to build in WiFi support for a Freescale IMX6 board running Android 4.2.2 via a RALINK USB WiFi Module. I was able to build the RALINK drivers from my kernel source and the device loads up just fine. I can bring the adpater "up" in netcfg and I can use the iwlist binary to see access points near me.
However, I cannot get Settings.apk to bring up the adapter. When I go to turn WiFi on, logcat shows the following:
E/WifiStateMachine( 2879): Failed to load driver!
E/WifiStateMachine( 2879): DriverFailedState
I can get WPA_SUPPLICANT started manually by running the following command:
wpa_supplicant -dd -Dnl80211 -iwlan0 -c /data/misc/wifi/wpa_supplicant.conf
where /data/misc/wifi/wpa_supplicant has only two lines:
ctrl_interface=wlan0
update_config=1
I also set the following the props just to be sure:
setprop wifi.interface wlan0
setprop wlan.driver.status "ok"
I am stumped, because I am loading the driver manually first, I do not want wpa_supplicant or settings (whatever method it uses) to load any driver. I have rebuild WPA_SUPPLICANT binary with what I think are the correct board settings, but I always get the same error.
Can anyone help?
Since WifiStateMachine is giving the error, do I need to recompile and replace the Java framework on the device?
Is this a sign of WPA_SUPPLICANT not being built correctly?
Is there some other component I am missing??
Thank you!!!

Related

use USB WiFi dongle on TF201

Hi folks!
one user ask if there is a method for using USB WiFi dongle on TF201, I've a working WG111v3 [RTL8187] which i use for connect when signal is weak, sniffing wifi packets , dump WPA handshakes and make some love ;P.
however i get all this working on TF201 by compile the kernel modules.
because not all users have a chroot with a stock kernel tree, i think to realease a package with all these modules inside.
so, for extract the modules from the package :
tar xzf wifi_ko.tar.gz -C path/to/
or
tar xjf wifi_ko.tar.bz2 -C path/to/
and all you have to do for use the wifi dongle is:
1) open termianl emulator
2) su
3) insmod path/to/module.ko
4) ifconfig wlan1 up
5) wpa_supplicant -i wlan1 -c /path/to/wpa_supplicant.conf -B
6) dhcpcd wlan1
i suppose that the new device is wlan1.
the step 5 and 6 is for connecting to a wireless Access Point, but if you use the dongle for other purposes just skip these.
I make these modules with debug information, so, if you have some problem look at `dmesg | grep "$module" ' output.
for a working wpa_supplicant.conf file take the /data/misc/wifi/wpa_supplicant.conf and remove extra information such as device-id and other android stuff.
Here you are the packages: ( if someone want to upload to another hoster will be better )
https://docs.google.com/open?id=0B0RHupHzEorHWkRheUMxNjRPTGc
https://docs.google.com/open?id=0B0RHupHzEorHZ21NZ3dTNzNHYTQ
Hope this help.
Regeards.
( sorry for my doggish english , i will update it soon )
tux_mind said:
Hi folks!
one user ask if there is a method for using USB WiFi dongle on TF201, I've a working WG111v3 [RTL8187] which i use for connect when signal is weak, sniffing wifi packets , dump WPA handshakes and make some love ;P.
however i get all this working on TF201 by compile the kernel modules.
because not all users have a chroot with a stock kernel tree, i think to realease a package with all these modules inside.
so, for extract the modules from the package :
tar xzf wifi_ko.tar.gz -C path/to/
or
tar xjf wifi_ko.tar.bz2 -C path/to/
and all you have to do for use the wifi dongle is:
1) open termianl emulator
2) su
3) insmod path/to/module.ko
4) ifconfig wlan1 up
5) wpa_supplicant -i wlan1 -c /path/to/wpa_supplicant.conf -B
6) dhcpcd wlan1
i suppose that the new device is wlan1.
the step 5 and 6 is for connecting to a wireless Access Point, but if you use the dongle for other purposes just skip these.
I make these modules with debug information, so, if you have some problem look at `dmesg | grep "$module" ' output.
for a working wpa_supplicant.conf file take the /data/misc/wifi/wpa_supplicant.conf and remove extra information such as device-id and other android stuff.
Click to expand...
Click to collapse
is it possible to use this on Aurora 2??? thanks for the post!
This is great.. But have a question
tux_mind said:
Hi folks!
one user ask if there is a method for using USB WiFi dongle on TF201, I've a working WG111v3 [RTL8187] which i use for connect when signal is weak, sniffing wifi packets , dump WPA handshakes and make some love ;P.
however i get all this working on TF201 by compile the kernel modules.
because not all users have a chroot with a stock kernel tree, i think to realease a package with all these modules inside.
so, for extract the modules from the package :
tar xzf wifi_ko.tar.gz -C path/to/
or
tar xjf wifi_ko.tar.bz2 -C path/to/
and all you have to do for use the wifi dongle is:
1) open termianl emulator
2) su
3) insmod path/to/module.ko
4) ifconfig wlan1 up
5) wpa_supplicant -i wlan1 -c /path/to/wpa_supplicant.conf -B
6) dhcpcd wlan1
i suppose that the new device is wlan1.
the step 5 and 6 is for connecting to a wireless Access Point, but if you use the dongle for other purposes just skip these.
I make these modules with debug information, so, if you have some problem look at `dmesg | grep "$module" ' output.
for a working wpa_supplicant.conf file take the /data/misc/wifi/wpa_supplicant.conf and remove extra information such as device-id and other android stuff.
Hope this help.
Regeards.
( sorry for my doggish english , i will update it soon )
Click to expand...
Click to collapse
What kernel did you use to compile these drivers on?
Cannot insmod
Hello,
could you please answer what kernel version is this working with? Any chance you could re-compile with newest kernel? When trying to ismod, I'm getting error:
insmod: init_module '...path...' failed (No such file or directory)
Before you ask - yes, the path is correct, just init_module returns non-zero.
Thanks for any help,
Martin
Is it possible to have a Atheros AR9271 driver?
I tried all athXX.ko, but "init_module '...path...' failed (No such file or directory)"always happened.
tux_mind said:
Hi folks!
one user ask if there is a method for using USB WiFi dongle on TF201, I've a working WG111v3 [RTL8187] which i use for connect when signal is weak, sniffing wifi packets , dump WPA handshakes and make some love ;P.
however i get all this working on TF201 by compile the kernel modules.
because not all users have a chroot with a stock kernel tree, i think to realease a package with all these modules inside.
Click to expand...
Click to collapse
tennyleaz said:
Is it possible to have a Atheros AR9271 driver?
I tried all athXX.ko, but "init_module '...path...' failed (No such file or directory)"always happened.
Click to expand...
Click to collapse
if i remember fine you need the ath9k or the ath9k_htc module.
btw the main trouble is that the module fails to load the device firmware.
it is probably due to wrong path.
module was probably compiled with "/system/lib/firmware/htc_9271.fw" but you have "/lib/firmware/htc_9271.fw".
please check dmesg immediately after the modprobe, you will see the path used by the module.
i solved by doing a symlink from /system/lib to /lib.
sorry for late replies but i never comes on XDA.
i read now all the previous questions.
the kernel i use is this: https://github.com/tux-mind/tf201-kernel
insmod
Like a previous post I am getting: init_module rtl8192ce.ko failed (no such file or directory)
1) I could not find a path/to so I just made one on the MicroSD and extracted the files.
2) I am executing insmod rtl8192ce.ko from the path/to/ directory
3) To me the issue is that the insmod is trying to write to a location that does not exist.
4) Per a previous post I added a directory "firmware" under system/lib still no luck.
Any help would be appreciated.

[Q] Hardware Wifi Failure?

Hello, I was given a Gtablet by a friend. Everything is in proper working order except for the wifi. The wifi will endlessly scan, never pulling up any SSIDs. Here's what I've done to troubleshoot:
Ascertained flight mode was off (it was)
Enabled wifi through the developer options (Did nothing)
Manually enter SSID/Security information (Claims that SSID is not in range)
Reloaded the OS (He had VEGAn Tab on there. I reloaded the 5.1 Beta. I don't know what version he had on there, oops.)
After a clean install I have the exact same issue, which leads me to believe it is a hardware issue rather than a software issue. Is this common? Am I forgetting something? Would loading an entirely different ROM be of any use or do they also use the same driver?
My apologies if this has been answered previously, but in all my searching I can only find people who have this problem temporarily; a reboot fixes it for them. I haven't been able to find someone who has had this as a persistent issue.
JungleWallace said:
Hello, I was given a Gtablet by a friend. Everything is in proper working order except for the wifi. The wifi will endlessly scan, never pulling up any SSIDs.
Click to expand...
Click to collapse
I'll have to look at some logs to ascertain what your WiFi problem is.
Run the commands in this post (after rebooting the tablet) and then post the text files that're created.
rajeevvp said:
I'll have to look at some logs to ascertain what your WiFi problem is.
Click to expand...
Click to collapse
Thanks, see attached are the logs as per request. As a side note, now that I have the terminal emulator on there I tried a few commands I dug up on the internet after I looked over the logs.
Code:
$ su
# ifconfig tiwlan0 up
# ifconfig eth0 up
Both gave an error message
Code:
error: SIOCGIFFLAGS (No such device)
Also
Code:
# svc wifi enable
did not solve my issues. Oh well.
FYI:
JungleWallace said:
...I tried a few commands I dug up on the internet after I looked over the logs.
Code:
$ su
# ifconfig tiwlan0 up
# ifconfig eth0 up
Both gave an error message
Code:
error: SIOCGIFFLAGS (No such device)
Click to expand...
Click to collapse
The wireless LAN interface name on the gTab is wlan0. Hence your error messages: "No such device" for the ifnames tiwlan0 and eth0. (The latter would work for the ethernet I/F on the dock--if you had one connected.)
Also
Code:
# svc wifi enable
did not solve my issues. Oh well.
Click to expand...
Click to collapse
1. You have to look at the Android system logs (using logcat) to see the result of that svc command.
2. Your Android logs indicate that your WiFi interface is a) disabled at startup and b) then not enabled thereafter:
Code:
01-07 23:21:10.429 V/ConnectivityService( 990): Starting Wifi Service.
01-07 23:21:10.429 I/WifiService( 990): WifiService starting up with Wi-Fi [B]disabled[/B]
Suggestions:
Since this now looks like a ROM problem (ie. not HW):
1. See this thread. Run the script to disable Airplane Mode which might be causing your problem. If that doesn't work, try step 2:
2. Boot into CWM and then a) Format /cache and b) Repartition the Internal SD card (take the external one out first).
You'll lose all your current apps and data with this step, essentially reverting to a "fresh" install of your ROM.
Re-setup WiFi, time & date and other things again.
If step 2. doesn't work, report back next year, and I'll give you more commands to run then.
rajeevvp said:
If step 2. doesn't work, report back next year, and I'll give you more commands to run then.
Click to expand...
Click to collapse
Negative. Ran the airplane fix script, nothing. Reset cache/re-partitioned, still nothing. It's still endlessly scanning/shutting off/scanning.
JungleWallace said:
Negative. Ran the airplane fix script, nothing. Reset cache/re-partitioned, still nothing.
Click to expand...
Click to collapse
OK. Not one of the common simple problems, then.
It's still endlessly scanning/shutting off/scanning.
Click to expand...
Click to collapse
This is puzzling because from your last logs, it doesn't look like the wlan kernel driver was even loaded, so no AP scanning should be possible. A little background will clarify what I mean.
On all the 2.6.32.x kernels for the gTablet, the wlan driver is not compiled into the kernel. Instead, it is built as a separate kernel module which is loaded and unloaded as needed by Android (from the files in /system/lib/hw/wlan/). When the wlan driver is loaded both the kernel (dmesg) and Android (logcat) will show some characteristic messages and until the driver is inserted into the kernel no AP scanning, or other wireless functions, should be possible. And, no wlan driver-related messages in your logs tells me that the driver was likely not loaded. (Also, only after the wlan driver is loaded does it check and initialize the wireless HW. So, only after its been loaded, strictly speaking, can we rule out a HW problem.)
Sometimes the Android logs are not complete, so I want to you setup ADB on your PC, enable USB debugging on the gTablet (Setting > Applications > Development) and collect the Android logs like this from now on:
1. Power off gTab; attach the USB cable to it.
2. Open a CMD.exe window on the PC, then run this command (and keep the window minimized):
Code:
C:\> [B]adb logcat -v time > logcat.txt[/B]
After all the tests/commands have been done, restore this window and press Ctrl-C to kill ADB and terminate Android log collection.
3. Power on the gTablet. The ADB command will wait for the gTablet and keep collecting logs on the PC.
Post also the output of these commands:
Code:
C:\> [B]adb shell dmesg > dmesg.txt[/B]
C:\> [B]adb shell lsmod > lsmod.txt[/B]
C:\> [B]adb shell "cd /; find system -type f -print0 | xargs -0 sha1sum" > sha1sum.txt[/B]
Is this the ROM you currently have?
Have you applied the VEGAn 1.00 beta 5.1.1 supplement also?
rajeevvp said:
OK. Not one of the common simple problems, then.
.........
Is this the ROM you currently have?
Have you applied the VEGAn 1.00 beta 5.1.1 supplement also?
Click to expand...
Click to collapse
That was the current ROM I was using. I had not applied the supplement yet, but now I have. Still the same issue. Here are the logs.
JungleWallace said:
That was the current ROM I was using. I had not applied the supplement yet, but now I have. Still the same issue. Here are the logs.
Click to expand...
Click to collapse
In this one I can see the kernel WiFi driver being loaded, and the driver is not reporting any HW chip, SDIO bus, or other errors:
Code:
<4>[ 23.485281] sdio_reset_comm():
<4>[ 23.503617] DHD: dongle ram size is set to 294912(orig 294912)
<4>[ 23.676913] Firmware version = wl0: May 17 2010 22:38:50 version 4.218.223.1
<4>[ 23.887647] wlan0: Broadcom Dongle Host Driver mac=e0:2a:82:08:3e:81
<4>[ 23.894047] Enter wl_control_wl_start
<4>[ 23.897864] Exited wl_control_wl_start
<4>[ 23.907103]
<4>[ 23.907109] Dongle Host Driver, version 4.218.223.1
As far as the kernel driver is concrned, everything looks OK, but the Android logs still don't show any SSID associations.
What're the exact outputs of these commands? (You can post a screenshot. Mask the psk= value from the 1st output, if present)
Code:
C:\> [B]adb shell "fgrep -v '#' /data/misc/wifi/wpa_supplicant.conf | tr -s '\n'"[/B]
ctrl_interface=wlan0
update_config=1
...
C:\> [B]adb shell wpa_cli -i wlan0 driver rssi[/B]
...
C:\> [B]adb shell wpa_cli -i wlan0 driver linkspeed[/B]
LinkSpeed [I]nn[/I]
C:\> [B]adb shell wpa_cli -i wlan0 scan[/B]
OK
C:\> [B]adb shell wpa_cli -i wlan0 scan_results[/B]
bssid / frequency / signal level / flags / ssid
aa:bb:cc:dd:ee:ff 2452 185 [WPA2-PSK-CCMP] [I]YourSSID[/I]
Collect also the dmesg and logcat outputs as before.
[/FONT]
rajeevvp said:
What're the exact outputs of these commands? (You can post a screenshot. Mask the psk= value from the 1st output, if present) [...] Collect also the dmesg and logcat outputs as before.
Click to expand...
Click to collapse
See attached. Ignore my syntax errors that I underlined. I was typing wlan instead of wlan0.
JungleWallace said:
Ignore my syntax errors that I underlined. I was typing wlan instead of wlan0.
Click to expand...
Click to collapse
Those are OK since you've corrected them. But, these commands you'll have to redo:
1. In the first command (fgrep ... | tr), you've typed a '/' (forward slash) instead of what I've given in the example, which is a '\' (back-slash) character.
The correct character will remove all those blank lines. But, this is a minor typo compared to:
2. The last 2 commands (wpa_cli scan* ...), which you'll have to redo. This time without the extraneous driver argument (again, see the example)--which turns it into a completely different (and non-existent) command. This is why the output doesn't look like what I've shown.
Instead of typing the commands in manually, select and copy the command lines from the browser and paste them into the shell window.
You might also want to increase the no. of columns that CMD.exe displays: Right-click on the title-bar; choose Properties; select Layout; increase the no. of Columns to, let's say, 150.
3. That dmesg.txt file is not very useful because you've not rebooted the tablet before issuing that command.
The kernel has a fixed-size message buffer, so all the HW initialization messages printed only at system boot will be overwritten by later, and irrelevent, messages as time passes. From the timestamps, it looks like your tablet's been on for a couple of weeks, at least--I can't see any of the earlier boot-up messages.

XT1527 Lollipop: Wifi/Cell at same time? Or, maybe downgrade to 4.4.4?

We have an application that needs to connect to a GoPro private Wifi network (non-routable), and at the same time, connect to the Internet over cellular.
On Android 4.4.4 and earlier, we were able to achieve this with a rooted device, and then execution of these commands:
svc wifi disable
svc data enable
insmod /system/lib/modules/wlan.ko
netcfg wlan0 up
wpa_supplicant -B -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf
dhcpcd wlan0
On the Moto E 4G (XT1527), rooted and running Lollipop, these commands no longer work -- dhcpcd seems to get stuck and never finishes running.
Does anyone know of an alternate method of bringing both networks up?
Or, does anyone know if it's possible to downgrade the XT1527 back to Android 4.4.4?
Thank you!

WiFi and WPA_SUPPLICANT

Hi Guys,
I am stumped on this. I am trying to build in WiFi support for a Freescale IMX6 board running Android 4.2.2 via a RALINK USB WiFi Module. I was able to build the RALINK drivers from my kernel source and the device loads up just fine. I can bring the adpater "up" in netcfg and I can use the iwlist binary to see access points near me.
However, I cannot get Settings.apk to bring up the adapter. When I go to turn WiFi on, logcat shows the following:
E/WifiStateMachine( 2879): Failed to load driver!
E/WifiStateMachine( 2879): DriverFailedState
I can get WPA_SUPPLICANT started manually by running the following command:
wpa_supplicant -dd -Dnl80211 -iwlan0 -c /data/misc/wifi/wpa_supplicant.conf
where /data/misc/wifi/wpa_supplicant has only two lines:
ctrl_interface=wlan0
update_config=1
I also set the following the props just to be sure:
setprop wifi.interface wlan0
setprop wlan.driver.status "ok"
I am stumped, because I am loading the driver manually first, I do not want wpa_supplicant or settings (whatever method it uses) to load any driver. I have rebuild WPA_SUPPLICANT binary with what I think are the correct board settings, but I always get the same error.
Can anyone help?
Since WifiStateMachine is giving the error, do I need to recompile and replace the Java framework on the device?
Is this a sign of WPA_SUPPLICANT not being built correctly?
Is there some other component I am missing??
Thank you!!!
Anyone?

Configure WLAN manually in Android 8.1

Hi all,
In order to keep both WiFi and LTE connections working, I tried to start WiFi connections manually. I found following commands working successfully on a Nexus 4 with Android 4.3 (rooted, with busybox):
netcfg wlan0 up
cd /data/misc/wifi/.
wpa_supplicant -B -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf
dhcpcd wlan0
However, I met problems when attempting to apply the same methods on a Nexus 6P with Android 8.1 (rooted, with busybox). I run ifconfig instead of netcfg, but I am not sure about following steps.
Should I still use wpa_supplicant? I found it in /system/bin/hw rather than /system/bin. Besides, the configuration file wpa_supplicant.conf has a different format from Android 4.3 (no longer containing ssid and passwords). What is the correct way to assign wlan0 an ssid?
dhcpcd is not available as well. How should I request an IP address for wlan0?
Thanks!

Categories

Resources