Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - UNKNOWN COMMAND as reply from wpa_ctrl_request(cntrl,"SCAN"): (5 Items)
   
UNKNOWN COMMAND as reply from wpa_ctrl_request(cntrl,"SCAN")  
Hi All,

I am new to QNX and WIFI. I am trying to open interface for wpa_supplicant and SCAN for APs.

I am able to open interface with  wpa supplicant through wpa_ctrl_open("/var/run/wpa_supplicant") successfully.
I sent "PING" command to WPA supplicant using wpa_ctrl_request() I got PONG as reply(I assume WPA supplicant is up and 
parsing commands).

But when I sent "SCAN" command reply was "UNKNOWN COMMAND".
can any one suggest what might be the problem?

Thanks in advance
Darshan

Re: UNKNOWN COMMAND as reply from wpa_ctrl_request(cntrl,"SCAN")  
Which interface you opened against?  UNKNOWN_COMMAND means just that, but there are two parsing contexts, the regular 
control interface (which contains scan) and the global interface (which doesn't contain scan).

Have you tried just running with the command line tools?

Re: UNKNOWN COMMAND as reply from wpa_ctrl_request(cntrl,"SCAN")  
Thanks Chris for reply,

I am opening  global interface.
command i use to start supplicant:
wpa_supplicant_xxxxx -g/var/run/wpa_supplicant-global & 

How to open a regular Interface?when i remove -g from above command it does not work(Help menu opens)
I don't see any option to open regular interface.

Thanks
Re: UNKNOWN COMMAND as reply from wpa_ctrl_request(cntrl,"SCAN")  
yes remove the -g 

I generally specify -D -i -c  along with -ddt for debugging

The only time I have used -g is for specifying a new p2p interface.
Re: UNKNOWN COMMAND as reply from wpa_ctrl_request(cntrl,"SCAN")  
Hi Chris,

I tried with below command with g removed,it did not create wpa_supplicant in /var/run folder. Program failed to open 
interface, wpa_ctrl_open() returned NULL.
Cmd : wpa_supplicant_xxxxx /var/run/wpa_supplicant -Dxxxx -ista0 -ddt -C/var/run/wpa_supplicant &  

Below command did create wpa_supplicant in var/run/ folder but now i am not able to open control interface. 
wpa_ctrl_open(“/var/run/wpa_supplicant”) returned NULL!!!!!!!
Cmd :  wpa_supplicant_xxxxx -Dxxxx -ista0 -ddt -C/var/run/wpa_supplicant &

I tried to start command line tool (Wpa_cli_xxxxx) with above non global wpa_supplicant
I got error: Failed to connect to Non-global ctrl-ifname

Wpa_cli_xxxxx works with global interface that I created previously. I was able to scan as well as connect to AP through
 commands. 

NOTE: xxxxx is third party name who supplied wpa_suppicant. 

Thanks