LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   wpa_cli interactive mode - "automatic" connect try (https://www.linuxquestions.org/questions/linux-newbie-8/wpa_cli-interactive-mode-automatic-connect-try-4175640231/)

Jim232 10-12-2018 09:28 AM

wpa_cli interactive mode - "automatic" connect try
 
After few detours I have managed to actually run wpa_cli in "interactive " mode.

When it runs it always does this:

Code:

pi@pi:~ $ sudo wpa_cli
wpa_cli v2.4
Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.


Selected interface 'p2p-dev-wlan0'

Interactive mode

<3>CTRL-EVENT-SCAN-RESULTS
<3>CTRL-EVENT-SCAN-RESULTS

But at one time only it did this.
Run "automatically " trying to "connect" - three times.
I did expected failure to connect, but it NEVER run this way again.

The question is - I like to find out why.



Code:

pi@pi:/ $ sudo raspi-config
pi@pi:/ $ sudo wpa_cli
wpa_cli v2.4
Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.



Interactive mode

Could not connect to wpa_supplicant: (nil) - re-trying
^Cpi@pi:/ $ sudo reboot
Connection to 10.0.1.39 closed by remote host.
Connection to 10.0.1.39 closed.
os64@os64-desktop:~$ ssh pi@10.0.1.39
pi@10.0.1.39's password:
Linux pi 4.14.70-v7+ #1144 SMP Tue Sep 18 17:34:46 BST 2018 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Oct 11 15:31:40 2018 from 10.0.1.41
pi@pi:~ $ sudo wpa_cli
wpa_cli v2.4
Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.


Selected interface 'wlan0'

Interactive mode

<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SSID-REENABLED id=0 ssid="tseesee"
<3>Trying to associate with 28:cf:da:b0:30:67 (SSID='tseesee' freq=2462 MHz)
<3>Associated with 28:cf:da:b0:30:67
<3>CTRL-EVENT-DISCONNECTED bssid=28:cf:da:b0:30:67 reason=0
<3>WPA: 4-Way Handshake failed - pre-shared key may be incorrect
<3>CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="tseesee" auth_failures=2 duration=20 reason=WRONG_KEY
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SSID-REENABLED id=0 ssid="tseesee"
<3>Trying to associate with 28:cf:da:b0:30:67 (SSID='tseesee' freq=2462 MHz)
<3>Associated with 28:cf:da:b0:30:67
<3>CTRL-EVENT-DISCONNECTED bssid=28:cf:da:b0:30:67 reason=0
<3>WPA: 4-Way Handshake failed - pre-shared key may be incorrect
<3>CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="tseesee" auth_failures=3 duration=30 reason=WRONG_KEY
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-TERMINATING
Connection to wpa_supplicant lost - trying to reconnect
Connection to wpa_supplicant re-established
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SSID-REENABLED id=0 ssid="tseesee"
<3>Trying to associate with 28:cf:da:b0:30:67 (SSID='tseesee' freq=2462 MHz)
<3>Associated with 28:cf:da:b0:30:67
<3>CTRL-EVENT-DISCONNECTED bssid=28:cf:da:b0:30:67 reason=0
<3>WPA: 4-Way Handshake failed - pre-shared key may be incorrect
<3>CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="tseesee" auth_failures=2 duration=20 reason=WRONG_KEY
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SSID-REENABLED id=0 ssid="tseesee"
<3>Trying to associate with 28:cf:da:b0:30:67 (SSID='tseesee' freq=2462 MHz)
<3>Associated with 28:cf:da:b0:30:67
<3>CTRL-EVENT-DISCONNECTED bssid=28:cf:da:b0:30:67 reason=0
<3>WPA: 4-Way Handshake failed - pre-shared key may be incorrect
<3>CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="tseesee" auth_failures=3 duration=30 reason=WRONG_KEY
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SCAN-FAILED ret=-1 retry=1
<3>CTRL-EVENT-TERMINATING
Connection to wpa_supplicant lost - trying to reconnect
> quit
pi@pi:~ $ sudo wpa_cli
wpa_cli v2.4
Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.



Interactive mode

Could not connect to wpa_supplicant: (nil) - re-trying


michaelk 10-13-2018 01:54 PM

Quote:

The question is - I like to find out why.
It may be impossible for anyone to answer that question. Both raspi-config and wpa_cli work on my headless pi but its configuration is basically the same as the original installation. While raspi-config was designed to quickly configure the system after install there is no reason it can't be used whenever but it depends on how you changed its setup.

You have mentioned in your previous threads that you are trying to create a menu to diagnose wifi connections. I don't remember if anyone has asked why but that it might be easier said then done. All I can gather from your post is that it appears that wpa_supplicant has stopped for some reason.

Jim232 10-13-2018 05:57 PM

Quote:

Originally Posted by michaelk (Post 5914404)
It may be impossible for anyone to answer that question. Both raspi-config and wpa_cli work on my headless pi but its configuration is basically the same as the original installation. While raspi-config was designed to quickly configure the system after install there is no reason it can't be used whenever but it depends on how you changed its setup.

You have mentioned in your previous threads that you are trying to create a menu to diagnose wifi connections. I don't remember if anyone has asked why but that it might be easier said then done. All I can gather from your post is that it appears that wpa_supplicant has stopped for some reason.

There are several reasons for me writing my own "raspi-config -DEBUG ".
I was initially looking for single command to activate WiFi.
That turned out to be a pipe dream. There are at least four very basic commands to accomplish that. So it became a pain for slow typist like me to keep at the keyboard. So I used "raspy-config" as a template to create menu driven bash script. Never wrote one before !
Initially I used "read only " status commands. In the process learned few things about writing script.

Then I run into a snag trying to make "interactive" script. While at that I went thru rasip-config "WiFi setup" to discover how "they" use "wpa_cli" and how there are no real feedbacks in setting up WiFi.
That is where "I need to know HOW it works" came from.

At this point I finally got my RPi WiFi cooperating with crosscompling my "real" app.

I am convinced that even advanced "users" have very little knowledge about HOW RPi WiFi is configured and why. They commonly refer to somewhat obsolete "official" procedures and as long as it works they do not care.

Nothing wrong with such "attitude" , as long as they are happy.

I on the other hand appreciate few things I have learned. I do not claim I know it all, but I would say that "wpa_supplicant" appears to be a service , managed by wpa_cli or wpa_gui.

Its starting is defined, its run is temperamental ( case of "3 tries and you are out" I posted, flaky "interactive" etc. ) and its termination non existent - reboot required.

ondoho 10-14-2018 06:00 AM

Quote:

Originally Posted by Jim232 (Post 5914461)
There are at least four very basic commands to accomplish that. So it became a pain for slow typist like me to keep at the keyboard.

you can simply gather those commands in a script.
not as elegant as a "menu driven", but easier nevertheless.

Quote:

I on the other hand appreciate few things I have learned. I do not claim I know it all, but I would say that "wpa_supplicant" appears to be a service , managed by wpa_cli or wpa_gui.

Its starting is defined, its run is temperamental ( case of "3 tries and you are out" I posted, flaky "interactive" etc. ) and its termination non existent - reboot required.
that sure sounds like a bug, or in any case something that should be brought to developers' and maintainers' attention.
if you do, make sure you can back it up with facts.


All times are GMT -5. The time now is 08:43 AM.