thesisPi20
Posts: 11
Joined: Mon Apr 27, 2020 4:10 pm

wpa_cli command not found when using bash

Tue May 05, 2020 5:29 am

Hi,

I am using bash script in order to ssh into RPi from my Linux desktop. I followed steps to do this without a password. For example, I have the bash script, called ssh2Pi.sh. In this file I have:

Code: Select all

ssh pi@raspberry.Pis.IP.address
This works. Then, when I want to use wpa_cli and send p2p_find command, I change the bash script into this:

Code: Select all

ssh pi@raspberry.Pis.IP.address wpa_cli -ip2p-dev-wlan0 p2p_find
I get the following error:

Code: Select all

bash: wpa_cli: command not found
When I ssh into RPi and then use "wpa_cli -ip2p-dev-wlan0 p2p_find", everything is fine, but when I try to do this from bash I get the error I talked about.
A weird note: pwd and ls commands work in the bash script, but ifconfig gives "command not found". I see some inconsistency here.
All in all, my question is: How can I send p2p_find command from Linux computer to RPi using a bash script?

thesisPi20
Posts: 11
Joined: Mon Apr 27, 2020 4:10 pm

Re: wpa_cli command not found when using bash

Tue May 05, 2020 5:05 pm

All I needed was to use sudo in front of wpa_cli commands. Thank you guys.

Return to “Beginners”