Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

OMAP Wireless Connectivity NLCP WLAN IW commands

From Texas Instruments Wiki
Jump to: navigation, search

IW commands

IW commands are Linux based commands that are used as configuration utility for wireless devices.
IW commands also provide connection to WLAN devices however it is not supported advance security modes (supports Non secured networks and WEP only) therefore we normaly use that option for debug mode only while working without WPA supplicant.

Command description Example
iw wlan0 scan Scan for WiFi networks iw wlan0 scan
iw wlan0 connect <Access Point SSID> connect to specifc Access point (by its SSID) iw wlan0 connect TI_ECS
iw wlan0 disconnect disconnect from the Access point that the Station is connected too iw wlan0 disconnect
iw wlan0 link Verify Link Status iw wlan0 link
iw dev wlan0 set power_save off Disable WLAN Power save mode iw dev wlan0 set power_save off
iw dev wlan0 set type managed Switch the interface from AP to station mode
* The interface has to be down when issuing this command
* hostapd should be stopped
ifconfig wlan0 down
iw dev wlan0 set type managed
ifconfig wlan0 up


wlan ifconfig commands


Command description Example
ifconfig wlan0 down turn WLAN driver OFF ifconfig wlan0 down
ifconfig wlan0 <Station WLAN IP address> up turn WLAN driver UP, and set its IP address ifconfig wlan0 192.168.1.100 up
ifconfig wlan0 hw ether <Station WLAN MAC address> set Station WLAN MAC address ifconfig wlan0 hw ether 00:22:33:90:64:44

External Link

for more detailed information please access the following links:


Example: how to use the IW commands

This section will demonstrate how to use the IW commands for connection, were the 2 options are as follows:

  • connect to non secured WiFi network
  • connect to WEP secured WiFi network


Connect to non secured WiFi network


Bring up the WLAN port

root@am37x-evm:/# ifconfig wlan0 10.1.7.220 netmask 255.255.255.0 up
[   79.959808] wl1271: firmware booted (Rev 6.1.5.50.69)
root@am37x-evm:/# ifconfig eth0 20.1.1.20 netmask 255.255.255.0 up
root@am37x-evm:/# cd /usr/sbin/

perform Scan for WiFi networks

root@am37x-evm:/usr/sbin# iw wlan0 scan

In order to see reduced Scan results that contains SSID only

root@am37x-evm:/usr/sbin# iw wlan0 scan | grep SSID

following is the Scan results

BSS 00:19:a9:cd:c6:80 (on wlan0)
	TSF: 2984923701 usec (0d, 00:49:44)
	freq: 2412
	beacon interval: 100
	capability: ESS ShortPreamble ShortSlotTime (0x0421)
	signal: -45.00 dBm
	last seen: 429 ms ago
	SSID: Cisco1240
	Supported rates: 1.0* 2.0* 5.5* 6.0 9.0 11.0* 12.0 18.0 
	DS Parameter set: channel 1
	ERP: <no flags>
	Extended supported rates: 24.0 36.0 48.0 54.0 
	WMM:	 * Parameter version 1
		 * u-APSD
		 * BE: CW 15-1023, AIFSN 3
		 * BK: CW 15-1023, AIFSN 7
		 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
		 * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
BSS d0:d0:fd:69:ca:70 (on wlan0)
	TSF: 2968648942 usec (0d, 00:49:28)
	freq: 2462
	beacon interval: 102
	capability: ESS ShortPreamble ShortSlotTime (0x0421)
	signal: -70.00 dBm
	last seen: 328 ms ago
	SSID: Cisco1250
	Supported rates: 1.0* 2.0* 5.5* 6.0 9.0 11.0* 12.0 18.0 
	DS Parameter set: channel 11
	ERP: <no flags>
	Extended supported rates: 24.0 36.0 48.0 54.0 
	WMM:	 * Parameter version 1
		 * u-APSD
		 * BE: CW 15-1023, AIFSN 3
		 * BK: CW 15-1023, AIFSN 7
		 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
		 * VO: acm CW 3-7, AIFSN 2, TXOP 1504 usec

Connect to Access point with SSID Cisco1250

 
root@am37x-evm:/usr/sbin# iw wlan0 connect -w Cisco1250
wlan0 (phy #0): [  117.134643] wl1271: Association completed.
connected to d0:d0:fd:69:ca:70

Verify the connection

root@am37x-evm:/usr/sbin# iw wlan0 link
Connected to d0:d0:fd:69:ca:70 (on wlan0)
	SSID: Cisco1250
	freq: 2462
	RX: 2080 bytes (23 packets)
	TX: 344 bytes (4 packets)
	signal: -70 dBm
	tx bitrate: 54.0 MBit/s
root@am37x-evm:/usr/sbin#

Connect to secured WiFi network (WEP) - using IW command

Bring up the WLAN port

root@am37x-evm:~# cd /
root@am37x-evm:/# ifconfig wlan0 10.1.7.220 netmask 255.255.255.0 up
[  377.055969] wl1271: firmware booted (Rev 6.1.5.50.69)
root@am37x-evm:/# ifconfig eth0 20.1.1.20 netmask 255.255.255.0 up

Perform Scan for WiFi networks

root@am37x-evm:/# cd /usr/sbin/
root@am37x-evm:/usr/sbin# iw wlan0 scan
BSS 00:19:a9:cd:c6:80 (on wlan0)
        TSF: 1224147169 usec (0d, 00:20:24)
        freq: 2412
        beacon interval: 100
        capability: ESS Privacy ShortPreamble ShortSlotTime (0x0431)
        signal: -45.00 dBm
        last seen: 406 ms ago
        SSID: Cisco
        Supported rates: 1.0* 2.0* 5.5* 6.0 9.0 11.0* 12.0 18.0
        DS Parameter set: channel 1
        ERP: <no flags>
        Extended supported rates: 24.0 36.0 48.0 54.0
        WMM:     * Parameter version 1
                 * u-APSD
                 * BE: CW 15-1023, AIFSN 3
                 * BK: CW 15-1023, AIFSN 7
                 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
                 * VO: CW 3-7, AIFSN 2, TXOP 1504 usec

Connect to Access Point

root@am37x-evm:/usr/sbin# iw wlan0 connect -w Cisco key 0:1234567890




HomepageIcon.jpgHOME