AnneCreek
Posts: 35
Joined: Thu Oct 04, 2018 4:51 pm

wpa_cli usage questions

Thu Oct 11, 2018 3:06 pm

I am using raspi-config as a template to learn about wpa.
I am primarily using wpa_cli.
I did try wpa_gui and did not see much improvement from wpa_cli.
Here are some question I like to get some clarification on
1. “wpa_cli” command without options runs wpa_cli in “interactive mode”.
It periodically outputs to terminal , however I cannot find description(s) of these messages
( My OS broke again so I cannot post the real messages, maybe later )
2. “wpa_cli status” just return OK , not sure if it ever returns anything else.
3. “wpa_cli status_return” ( again it may be wrong wordage due to bad OS )
ALWAYS returns what appears to be WiFi devices it can detect.
At this point I have no clue what RPIi WiFi ( wlan0) state is , probably DISCONNECTED.
How does DISCONNECTED Rpi WiFi detects other WiFi devices and their data – frequency , signal strength,. SSID etc .?
4. “wpa_cli” detects “first available WiFi device “ on Rpi board – at wpa_gui it has “wlan0” and “p2p_dev_wlan0”. So why two different designations ?

epoch1970
Posts: 2805
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: wpa_cli usage questions

Fri Oct 12, 2018 8:04 am

3 possibly useful tricks about wpa_cli/wpa_supplicant:
  • You can try the "help" command in wpa_cli
  • In wpa_cli at any point you can hit tab tab for command completion or hints about possible parameters.
  • Some READMEs for wpa_supplicant are here.
The p2p-dev device is used for WiFi Direct.

The capabilities of the built-in wifi interface are reported with command "iw phy0 info":

Code: Select all

Wiphy phy0
	max # scan SSIDs: 10
...
	software interface modes (can always be added):
	valid interface combinations:
		 * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
		   total <= 3, #channels <= 1
		 * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
		   total <= 4, #channels <= 1
	Device supports scan flush.
The 2 last lines say that:
EDIT: obviously I can't read '<='... The theoretical max below is 3 devices in the first case, max. 4 in the second case.
  • the built-in wifi chip can run an interface (wlan0) in client mode (aka managed), and an interface in p2p (WiFi Direct) mode at the same time. Both interfaces must work on the same radio channel.
    or,
  • the built-in chip can run an interface (wlan0 if available or uap0) in AP mode (access point), an interface in client mode (wlan0), and an interface in P2P client mode (=connecting to a P2P GO network; unsure of the difference between "P2P-device" and "P2P-client" reported here) at the same time. All must share the same channel.
The driver of the wifi chip exposes both potential client interfaces by default (wlan0, p2p-dev-wlan0). With "iw" you can add uap0. Normally AP mode is managed with hostapd and not with wpa_supplicant (option "mode=2"), so you would normally not see uap0 through wpa_cli.

In practice uap0 + wlan0 doesn't work so well, I do not know how P2P modes fare on the Pi.

HTH
Last edited by epoch1970 on Mon Oct 15, 2018 11:10 am, edited 1 time in total.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

AnneCreek
Posts: 35
Joined: Thu Oct 04, 2018 4:51 pm

Re: wpa_cli usage questions

Fri Oct 12, 2018 4:41 pm

Thanks for reply.
I am find that the hardest part in setting WiFi is "jumping" between different commands.
I have that partially solved by my own "DEBUG" script.

epoch1970
Posts: 2805
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: wpa_cli usage questions

Fri Oct 12, 2018 5:04 pm

AnneCreek wrote:
Fri Oct 12, 2018 4:41 pm
I am find that the hardest part in setting WiFi is "jumping" between different commands.
I see. Don't go anywhere near bluetooth, then :D
(much, much worse, believe it or not...)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Networking and servers”