run "setprop ctrl.start wpa_supplicant" manually
https://groups.google.com/forum/#!topic/android-porting/Cgv-rGMJwX0
Richard Zhao |
08/12/10
|
{
char supp_status[PROPERTY_VALUE_MAX] = {'\0'};
const char *ctrl_prop = (startIt ? "ctl.start" : "ctl.stop");
const char *desired_status = (startIt ? "running" : "stopped");
int count = 20; /* wait at most 20 seconds for completion */
if (property_get(SUPP_PROP_NAME, supp_status, NULL)
&& strcmp(supp_status, desired_status) == 0) {
return 0; /* supplicant already running */
}
property_set(ctrl_prop, SUPPLICANT_NAME);
while (count-- > 0) {
usleep(1000000);
if (property_get(SUPP_PROP_NAME, supp_status, NULL)) {
if (strcmp(supp_status, desired_status) == 0)
return 0;
}
}
return -1;
}
Do you know which line is to start wpa_supplicant?
Thanks
Richard
2008/12/9 Jithu Jance <jithu...@gmail.com>:
> Thanks a lot Richard. This is really a good pointer..
>
>>> Jithu Jance.
>
>
> On Tue, Dec 9, 2008 at 12:50 PM, Richard Zhao <linu...@gmail.com> wrote:
>>
>> I think it's :
>> GUI -> libhardware -> wpa_supplicant -> wext -> wifi driver
>> Your driver is using wireless externsion, right?
>>
>> libhardware is now using Ti wlan driver. Maybe we must modify
>> hardware/libhardware/wifi/wifi.c
>>
>> Thanks
>> Richard
>>
>> 2008/12/9 Jithu Jance <jithu...@gmail.com>:
>> > Hi Richard,
>> >
>> > You r welcome.. btw I am also stuck up there.. How did u manage to hook
>> > wpa_supplicant to GUI??? I saw Wifi Manager framework folder. I am
>> > confused
>> > how we could hook our wifi driver to the GUI.
>> >
>> > From your mail, i understand GUI talks to the wpa_supplicant which
>> > inturn
>> > talks to the wlandriver. But I didnt see anything in the wpa_supplican
>> > that
>> > is using the wifi manager framework. or is it some service like
>> > wifimanager
>> > which actually talks to the supplicant???
>> >
>> > GUI - wpa_supplicant - wlandriver
>> >
>> > if you have any idea on the above query pls help me out.
>> >
>> > What I did try was to connect using hyperterminal to the eval board and
>> > invoke supplicant through commandline. It worked but doesn't make sense
>> > as
>> > its not connected to the GUI. I want to use GUI for controlling my wifi
>> > driver
>> >
>> >
>> > Thanks..
>> >
>> >>> Jithu
>> >
>> >
>> > On Tue, Dec 9, 2008 at 7:32 AM, Richard Zhao <linu...@gmail.com> wrote:
>> >>
>> >> Hi Jithu,
>> >>
>> >> Thanks very much!
>> >> Now I compiled out wpa_supplicant, but the GUI always says
>> >> wpa_supplicant load failed.
>> >>
>> >> Thanks
>> >> Richard
>> >>
>> >> 2008/12/7 Jithu Jance <jithu...@gmail.com>:
>> >> > I saw ur question on wpa_supplicant for android
>> >> >
>> >> > I also got stuck at the same problem.. then i modified Android.mk
>> >> > file
>> >> > in
>> >> > wpa_supplicant dir and changed BUILD_SUPPLICANT :=true. Make sure u
>> >> > edit
>> >> > .config file to include WEXT. and then build android again.. You can
>> >> > find
>> >> > wpa_supplicant in system/bin directory..
>> >> >
>> >> >>> Jithu Jance.
>> >> >
>> >
>> >
>
>
Richard Zhao |
08/12/10
|
wpa_supplicant service.
I tried to run "setprop ctrl.start wpa_supplicant" manually, but
wpa_supplicant is not run.
I've added something in init.rc:
service wpa_supplicant /system/bin/wpa_supplicant -Dwext -i eth1
-C/data/misc/wifi/sockets -c/system/etc/wifi/wpa_supplicant.conf
user bluetooth
group bluetooth net_bt_admin
disabled
What's wrong?
Thanks
Richard
2008/12/10 Richard Zhao <linu...@gmail.com>:
nagamatu |
08/12/10
|
properties.c
this api will send property information for init process through
socket.
with the latest init source code, init shows error message when fails
to start service.
check existance of /dev/socket/property_service and update init with
the latest one.
--
nagamatu
On 12月10日, 午後3:40, "Richard Zhao" <linux...@gmail.com> wrote:
> I see "property_set(ctrl_prop, SUPPLICANT_NAME)" is starting the
> wpa_supplicant service.
> I tried to run "setprop ctrl.start wpa_supplicant" manually, but
> wpa_supplicant is not run.
> I've added something in init.rc:
> service wpa_supplicant /system/bin/wpa_supplicant -Dwext -i eth1
> -C/data/misc/wifi/sockets -c/system/etc/wifi/wpa_supplicant.conf
> user bluetooth
> group bluetooth net_bt_admin
> disabled
>
> What's wrong?
>
> Thanks
> Richard
>
> > static int control_supplicant(int startIt)
> > {
> > char supp_status[PROPERTY_VALUE_MAX] = {'\0'};
> > const char *ctrl_prop = (startIt ? "ctl.start" : "ctl.stop");
> > const char *desired_status = (startIt ? "running" : "stopped");
> > int count = 20; /* wait at most 20 seconds for completion */
>
> > if (property_get(SUPP_PROP_NAME, supp_status, NULL)
> > && strcmp(supp_status, desired_status) == 0) {
> > return 0; /* supplicant already running */
> > }
> > property_set(ctrl_prop, SUPPLICANT_NAME);
>
> > while (count-- > 0) {
> > usleep(1000000);
> > if (property_get(SUPP_PROP_NAME, supp_status, NULL)) {
> > if (strcmp(supp_status, desired_status) == 0)
> > return 0;
> > }
> > }
> > return -1;
> > }
>
> > Do you know which line is to start wpa_supplicant?
>
> > Thanks
> > Richard
>
>
> >>>> Jithu Jance.
>
>
> >>> I think it's :
> >>> GUI -> libhardware -> wpa_supplicant -> wext -> wifi driver
> >>> Your driver is using wireless externsion, right?
>
> >>> libhardware is now using Ti wlan driver. Maybe we must modify
> >>> hardware/libhardware/wifi/wifi.c
>
> >>> Thanks
> >>> Richard
>
>
> >>> > You r welcome.. btw I am also stuck up there.. How did u manage to hook
> >>> > wpa_supplicant to GUI??? I saw Wifi Manager framework folder. I am
> >>> > confused
> >>> > how we could hook our wifi driver to the GUI.
>
> >>> > From your mail, i understand GUI talks to the wpa_supplicant which
> >>> > inturn
> >>> > talks to the wlandriver. But I didnt see anything in the wpa_supplican
> >>> > that
> >>> > is using the wifi manager framework. or is it some service like
> >>> > wifimanager
> >>> > which actually talks to the supplicant???
>
> >>> > GUI - wpa_supplicant - wlandriver
>
> >>> > if you have any idea on the above query pls help me out.
>
> >>> > What I did try was to connect using hyperterminal to the eval board and
> >>> > invoke supplicant through commandline. It worked but doesn't make sense
> >>> > as
> >>> > its not connected to the GUI. I want to use GUI for controlling my wifi
> >>> > driver
>
> >>> > Thanks..
>
> >>> >>> Jithu
>
>
> >>> >> Hi Jithu,
>
> >>> >> Thanks very much!
> >>> >> Now I compiled out wpa_supplicant, but the GUI always says
> >>> >> wpa_supplicant load failed.
>
> >>> >> Thanks
> >>> >> Richard
>
Richard Zhao |
08/12/10
|
/dev/socket/property_service
I can't see any error message.
init I'm using is compiled out from android 1.0 source.
Thanks
Richard
2008/12/10 nagamatu <naga...@gmail.com>:
nagamatu |
08/12/10
|
# start wpa_supplicant
This start command just do property_set("ctl.start", service_name)
And get the system property of "init.svc.wpa_supplicant".
--
nagamatu
On 12月10日, 午後4:57, "Richard Zhao" <linux...@gmail.com> wrote:
> # ls /dev/socket/property_service
> /dev/socket/property_service
>
> I can't see any error message.
> init I'm using is compiled out from android 1.0 source.
>
> Thanks
> Richard
>
Richard Zhao |
08/12/11
|
2008/12/10 nagamatu <naga...@gmail.com>:
>
> Can you start wpa_supplicant by start command like:
> # start wpa_supplicant
> This start command just do property_set("ctl.start", service_name)
>
> And get the system property of "init.svc.wpa_supplicant".
>
> --
> nagamatu
>
> On 12月10日, 午後4:57, "Richard Zhao" <linux...@gmail.com> wrote:
Sean McNeil |
08/12/11
|
command from the shell?
Richard Zhao |
08/12/12
|
After "start wpa_supplicant", "getprop init.svc.wpa_supplicant" show
"restarting".
Thanks
Rihard
2008/12/11 Sean McNeil <seanm...@gmail.com>:
nagamatu |
08/12/13
|
init.svc.wpa_supplicant" shows "running".
In case of termination of service execution, status becomes "stopped".
And when service is not oneshot
mode, init will try to restart this service again.
First debug your wpa_supplicant by executing it from debugger or
strace.
--
nagamatu
On 12月12日, 午前9:20, "Richard Zhao" <linux...@gmail.com> wrote:
> Sure I can run it from console.
> After "start wpa_supplicant", "getprop init.svc.wpa_supplicant" show
> "restarting".
>
> Thanks
> Rihard
>
>
>
> > Are you even certain you have the wpa_supplicant binary? Can you run the
> > command from the shell?
>
> > Richard Zhao wrote:
> >> It still don't work.
>
xiaope...@windriver.com |
08/12/15
|
have the right permission for wpa_supplicant to read and write.
Xiaopeng