Help with wpa_cli not executing a "kill -usr1" action

David Linares dlinares.linux
Tue Apr 30 10:24:49 PDT 2013


Hi all,

I am currently working on a project using the open embedded classic
framework which pulls the wpa-supplicant v0.7.3.
The dev I am looking at at the moment is to do a kind of roaming
between 2 networks configured in a wpa_supplicant.conf file.

Here is the content of /tmp/wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant
network={
  ssid="connection1"
  psk="1234"
  priority=10
}

network={
  ssid="connection2"
  psk="5678"
  priority=1
}

And here is the content of my /tmp/wpa_cli-action.sh script that I
pass to wpa_cli:

#!/bin/sh

case $2 in
CONNECTED)
        echo "CONNECTED"
        PIDOF_UDHCPC=`pidof udhcpc`
        if [[ "$PIDOF_UDHCPC" != "" ]]; then
                echo "Sending SIGUSR1 to process $PIDOF_UDHCPC"
                kill -usr1 $PIDOF_UDHCPC
        fi
;;
DISCONNECTED)
        echo "DISCONNECTED"
;;
*)
;;
esac


Now here is the test I am doing on my environment:
1/ Create "connection1" SSID
2/ Create "connection2" SSID
3/ Associate to connection1 by doing:
- wpa_supplicant -iuplink -Dnl80211 -c/tmp/wpa_supplicant.conf -B
- wait till the association is done
- get an IP address:  udhcpc -i uplink -s /tmp/udhcpc.script -C
4/ Verify I am getting an IP address: ex: 192.168.1.100
5/ Launch    wpa_cli -a /tmp/wpa_cli-action.sh from command line (will
be launched as a background daemon when it works)
6/ Disable the connection1 SSID




More information about the Hostap mailing list