Default [Help] How can I connect to wifi using terminal??

Hi guys,

I need to connect to wifi using command in terminal.

First, I checked that wifi interface is turned on.

----------------------------------------------------

root@hammerhead:/ # netcfg
netcfg
rev_rmnet8 DOWN 0.0.0.0/0 0x00001002 52:a7:d
0:3a:d4:a7
rev_rmnet4 DOWN 0.0.0.0/0 0x00001002 fe:b3:6
2:3a:7b:95
rev_rmnet2 DOWN 0.0.0.0/0 0x00001002 8a:0e:2
2:7f:ee:3a
rev_rmnet3 DOWN 0.0.0.0/0 0x00001002 26:9d:a
1:00:a4:05
rev_rmnet7 DOWN 0.0.0.0/0 0x00001002 46:3e:3
c:ed:66:17
rev_rmnet5 DOWN 0.0.0.0/0 0x00001002 aa:0f:6
a:8b:33:89
rev_rmnet6 DOWN 0.0.0.0/0 0x00001002 3a:30:b
6:e9:45:91
rev_rmnet1 DOWN 0.0.0.0/0 0x00001002 d6:fd:0
3:6f:66:a7
rev_rmnet0 DOWN 0.0.0.0/0 0x00001002 7e:3d:3
1:ab:d8:c9
rmnet4 DOWN 0.0.0.0/0 0x00000000 00:00:00:
00:00:00
rmnet2 DOWN 0.0.0.0/0 0x00000000 00:00:00:
00:00:00
rmnet3 DOWN 0.0.0.0/0 0x00000000 00:00:00:
00:00:00
rmnet7 DOWN 0.0.0.0/0 0x00000000 00:00:00:
00:00:00
rmnet5 DOWN 0.0.0.0/0 0x00000000 00:00:00:
00:00:00
rmnet6 DOWN 0.0.0.0/0 0x00000000 00:00:00:
00:00:00
rmnet1 DOWN 0.0.0.0/0 0x00000000 00:00:00:
00:00:00
rmnet0 DOWN 0.0.0.0/0 0x00000000 00:00:00:
00:00:00
p2p0 UP 0.0.0.0/0 0x00001003 ce:fa:00:
c5:ec:79
sit0 DOWN 0.0.0.0/0 0x00000080 00:00:00:
00:00:00
lo UP 127.0.0.1/8 0x00000049 00:00:00:
00:00:00
wlan0 UP 0.0.0.0/0 0x00001003 cc:fa:00:
c5:ec:79

root@hammerhead:/ #

----------------------------------------------------------------------------------------------------------------------------


And I tried this below..


> iwconfig wlan0 essid testap # testap is a ssid of my open wifi


wlan0 IEEE 802.11abgn ESSID:"testap"
Mode:Managed Access Point: Not-Associated Tx-Power=1496 dBm
Retry long limit:7 RTS thrff Fragment thrff
Encryption keyff
Power Managementn

> wpa_supplicant -B -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf

wlan0 IEEE 802.11abgn ESSID:"testap"
Mode:Managed Access Point: Not-Associated Tx-Power=1496 dBm
Retry long limit:7 RTS thrff Fragment thrff
Encryption keyff
Power Managementn

---------------------------------------------------------------------------


As you can see, I couldn't connect to wifi.

Is there any problem?

.