wpa_cli cannot connect to wpa_supplicant.

Discussion in 'Linux Networking' started by unruh, May 8, 2013.

  1. unruh

    unruh Guest

    When I run wpa_cli status or wpa_cli -i wlan0 status, I get an error
    which says
    Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory

    wpa supplicant is running

    root 1142 0.0 0.0 6064 3176 ? S May07 0:01 /usr/sbin/wpa_supplicant -c /etc/wpa_supplicant.conf -u -P /var/run/wpa_supplicant.pid -f /var/log/wpa_supplicant.log -t


    No /var/run/wpa_supplicant.pid however exists. I created one with the
    correct pid of wpa_supplicant in it ( 1142) but that did not help.

    Any suggestions?

    (Note that the documentation on wpa_supplicant and wpa_cli is pretty
    poor. as an example wpa_cli man page does not contain many of the
    commands that wpa_cli actually understands)
     
    unruh, May 8, 2013
    #1
    1. Advertisements

  2. unruh

    Jerry Peters Guest

    wpa-cli is trying to open the control socket so it can pass commands
    to wpa-supplicant.

    Look in the wpa-supplicant config file to see where the control socket
    is being created. -c /etc/wpa_supplicant.conf names the config file.
    You're looking for ctrl_interface=

    Jerry
     
    Jerry Peters, May 8, 2013
    #2
    1. Advertisements

  3. unruh

    unruh Guest

    ctrl_interface=/var/run/wpa_supplicant

    but no such file or directory does exist, so wpa_supplicant is apparently not creating
    it. If I create the directory and make it rwx all,
    wpa_cli status
    Failed to connect to wpa_supplicant - wpa_ctrl_open: Success
    wpa_cli -i wlan0 status
    Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory



    So, it neither creates the pid file nor the ctrl_interface.
     
    unruh, May 8, 2013
    #3
  4. unruh

    Jerry Peters Guest

    I just used the default when I used cli to control the supplicant --
    it worked. See if there's an option to turn off the socket interface.
    The other possiblity is that you have to create the directory
    /var/run/wpa_supplicant before starting wpa-supplicant. I've got
    /var/run/wpa_supplicant/wlan0 as the socket, nothing else in the
    directory. IIRC you also need to specify the interface name (&
    probably the directory) to cli.

    Jerry
     
    Jerry Peters, May 9, 2013
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.