Record Events happening in Supplicant Module in a log file inside the phone with Timing Information

Cainikov, Andrej Andrej.Cainikov
Thu Oct 13 12:25:57 PDT 2011


I don't know what you are trying to achieve, but you can redirect wpa_supplicant log to a file. Have a look into src/utils/wpa_debug.*.
This should be achievable by swapping CONFIG_ANDROID_LOG to CONFIG_DEBUG_FILE in .config file, and executing wpa_supplicant with "-f /data/wpa_supplicant.log".
Then just add any additional printout's you need by using wpa_supplicant logging functions (wpa_printf and friends) - all the logging will fall in a single log file, ready to be processed by your handy scripts.

Andrejs Cainikovs.

From: Nithyananthan Poosamani [mailto:nithy.psg at]
Sent: den 13 oktober 2011 19:44
To: Cainikov, Andrej
Cc: hostap at
Subject: Re: Record Events happening in Supplicant Module in a log file inside the phone with Timing Information


Thank you for the quick reply. I tried your solution and also added filter to filter the tags which I want instead of logging everything from the circular buffer. Currently, this should work fine for me and I am planning to add these commands to init.rc file so that they can start upon phone boot.
I identified the place where the logging daemon service is started in init.rc file. Below you can see part of init.rc file where the shell process is spawned.

## Daemon processes to be run by init.
service ueventd /sbin/ueventd

service console /system/bin/sh
    user shell
    group log

I have 2 questions:
1) Do you want me to add the logcat commands in any specific place in init.rc file?
2) For my next steps, I am planning to read and write some information like SSID name, freq etc in a file other then wpa_supplicant.conf file from within the wpa_supplicant daemon service. That's the reason I asked to log events directly form wpa_supplicant in my first email.

thanks all !


On Wed, Oct 12, 2011 at 12:36 PM, Cainikov, Andrej <Andrej.Cainikov at<mailto:Andrej.Cainikov at>> wrote:
Hi Nithy,

What are you asking for has nothing to do with the wpa_supplicant itself, but rather to Android specifics.

Collecting the logs on Android phone without USB cable normally is achieved via:
$ adb wait-for-device shell
$ logcat -v threadtime > /data/logcat.log &

Andrejs Cainikovs.

From: hostap-bounces at<mailto:hostap-bounces at> [mailto:hostap-bounces at<mailto:hostap-bounces at>] On Behalf Of Nithyananthan Poosamani
Sent: den 12 oktober 2011 18:12
To: hostap at<mailto:hostap at>
Subject: Record Events happening in Supplicant Module in a log file inside the phone with Timing Information

Dear All,

I am working to record some of the events happening in wpa_supplicant module like how many times the configuration file is read by supplicant to populate it's data structures, what time it happened, number of scans performed and their timing information etc.

I have a rooted Nexus One phone which uses the wext driver. Currently, I would kill the wpa_supplicant process and start it with advanced log level to see all these information. The command I used is

wpa_supplicant -Dwext -ieth0 -c/data/misc/wifi/wpa_supplicant.conf -dd

But I was able to see all these logs ONLY when I am connected to ADB interface through Eclipse. What I want is that I need to see all the logs even when the phone is not connected to ADB. I would like to store all these log information as a file inside the smartphone which I can later retrieve. Example the file could be logged in /data/misc/wifi/supplicant_log.txt. I shall later parse this log file and gather some information.

Please guide me in achieving this. Thank you all for your time and patience !

Networking Research Laboratory (NRL)
NC State University.

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Hostap mailing list