Wireless Tools

Wireless Tools can be used for basic interactive Wi-Fi management, directly from the command line. This section will show examples of how to perform the following operations using Wireless Tools.

All the steps and expected output is provided in detail below. See the end of this section for a complete list of supported commands. For complete documentation on Wireless Tools, see http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html.

Enable the owl network interface

This will enable the owl device and firmware will be downloaded.

$ ifconfig owl0 up

Use ifconfig to see the interface information.

$ ifconfig owl0
owl0    Link encap:Ethernet HWaddr 7A:C4:0E:A1:DD:9C
        UP BROADCAST MULTICAST MTU:1500 Metric:1
        RX packets:0 errors:0 dropped:0 overruns:0 frame:0
        TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 
        collisions:0 txqueuelen:1000
        RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Scan for networks

Scan for neighbouring networks. A list of networks with information on e.g. ssid, encryption mode
and signal levels will be shown when the scan is completed.

$ iwlist owl0 scan
owl0 Scan completed :
Cell 01 - Address: 68:7F:74:10:5B:4C
          ESSID:"hdwireless"
          Mode:Managed
          Encryption key:off
          Frequency:2.422 GHz (Channel 3)
          Quality:21/30 Signal level:-29 dBm Noise level:-50 dBm
          Extra:Beacon period: 100 Kusec
          Extra:DTIM period: 1

Cell 02 - Address: 00:23:69:B5:BE:48
          ESSID:"angr2"
          Mode:Managed
          Encryption key:off
          Frequency:2.412 GHz (Channel 1)
          Quality:20/30 Signal level:-30 dBm Noise level:-50 dBm
          Extra:Beacon period: 100 Kusec
          Extra:DTIM period: 2

Cell 03 - Address: 00:25:9C:6F:58:B0
          ESSID:"TeliaADSL"
          Mode:Managed
          Encryption key:on
          Frequency:2.437 GHz (Channel 6)
          Quality:22/30 Signal level:-45 dBm Noise level:-67 dBm
          IE: IEEE 802.11i/WPA2 Version 1
              Group Cipher : CCMP
              Pairwise Ciphers (1) : CCMP
              Authentication Suites (1) : PSK
          Extra:Beacon period: 100 Kusec
          Extra:DTIM period: 1

Connect to an unprotected network

Connect to an unprotected network that was found during the scan. In this case we will choose the ssid hdwireless.

$ iwconfig owl0 essid hdwireless

This will initiate a connect, use the iwconfig command again to "poll" the connection status. The iwconfig output will look similar to below when not yet connected:

$ iwconfig owl0
owl0    IEEE 802.11bg ESSID:"hdwireless"
        Mode:Managed Access Point: Not-Associated
        Encryption key:off
        Power Management:off

Once the connetion is established, the MAC address of the access point should be displayed in the output:

$ iwconfig owl0
owl0    IEEE 802.11bg ESSID:"hdwireless"
        Mode:Managed Frequency:2.422 GHz Access Point:68:7F:74:10:5B:4C
        Encryption key:off
        Power Management:off
        Link Quality=19/30 Signal level=-27 dBm Noise level=-46 dBm
        Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
        Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Note again that the iwconfig command will only initiate a connection. Another connection request cannot be issued until the previous connection has been successfully established or considered failed. Therefore, if the owl driver receives two connection requests very quickly, the last one will be discarded:

$ iwconfig owl0 essid hdwireless; iwconfig owl0 essid foo
Error for wireless request "Set ESSID" (8B1A) :
SET failed on device owl0 ; Device or resource busy.

A wireless event that indicates connected or disconnected status will be generated when a connection attempt is completed. However, the details about wireless events are out of the scope for this document. See the Linux kernel header file include/linux/wireless.h

and related files for more information.

Assign an IP address

If a static IP address is used, set it using ifconfig:

$ ifconfig owl0 192.168.2.50

If DHCP is used, invoke the DHCP client available on the platform:

$ udhcpc -i owl0
udhcpc (v1.13.2) started
Sending discover...
Sending select for 192.168.2.102...
Lease of 192.168.2.102 obtained, lease time 172800
adding dns 192.168.2.1

The current IP address can now be displayed using ifconfig:

$ ifconfig owl0
owl0    Link encap:Ethernet HWaddr 7A:C4:0E:A1:DD:9C
        inet addr:192.168.2.102 Bcast:192.168.2.255 Mask:255.255.255.0
        UP BROADCAST MULTICAST MTU:1500 Metric:1
        RX packets:18 errors:0 dropped:0 overruns:0 frame:0
        TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Verify the connection

Ping the access point to verify the connection:

$ ping -c 3 192.168.2.1
PING 192.168.2.1 (192.168.2.1): 56 data bytes
64 bytes from 192.168.2.1: seq=0 ttl=64 time=1.672 ms
64 bytes from 192.168.2.1: seq=1 ttl=64 time=1.333 ms
64 bytes from 192.168.2.1: seq=2 ttl=64 time=1.342 ms

--- 192.168.2.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 1.333/1.449/1.672 ms

Disconnect from the network

Disconnect from the network by setting the ssid to off:

$ iwconfig owl0 essid off
$ iwconfig owl0
owl0    IEEE 802.11bg ESSID:""
        Mode:Managed Access Point: Not-Associated
        Encryption key:off
        Power Management:off

Configure the device to use WEP encryption

Now, we will connect to an access point that uses WEP 64-bit encryption, shared key authentication and with key index 1 set to 0102030405. Key index 1 should be the default transmit key and no other keys should be configured on the access point.

First, the key must be configured into the owl device:

$ iwconfig owl0 key 0102030405 [1] restricted

The [1] specifies that we are setting key index 1 (as was configured in the access point), restricted means that shared key authentication will be used. To list the current key configuration, iwlist can be used:

$ iwlist owl0 keys
owl0      4 keys available :
                [1]: 0102-0304-05 (40 bits)
                [2]: off
                [3]: off
                [4]: off
          Current Transmit Key: [1]
          Security mode:restricted

Connect to an WEP encrypted network

Now it should be possible to connect to the network, set an ip address and verify the connection with ping:

$ iwconfig owl0 essid hdwireless
$ iwconfig
owl0    IEEE 802.11bg ESSID:"hdwireless"
        Mode:Managed Frequency:2.422 GHz Access Point:68:7F:74:10:5B:4C
        Encryption key:0102-0304-05 Security mode:restricted
        Power Management:off
        Link Quality=23/30 Signal level=-20 dBm Noise level=-43 dBm
        Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
        Tx excessive retries:0 Invalid misc:0 Missed beacon:0
$ ifconfig owl0 192.168.2.50

$ ping -c 3 192.168.2.1
PING 192.168.2.1 (192.168.2.1): 56 data bytes
64 bytes from 192.168.2.1: seq=0 ttl=64 time=1.803 ms
64 bytes from 192.168.2.1: seq=1 ttl=64 time=1.707 ms
64 bytes from 192.168.2.1: seq=2 ttl=64 time=1.503 ms
--- 192.168.2.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 1.503/1.671/1.803 ms

Disable WEP encryption and delete keys

To disable WEP encryption and delete all the configured keys, the iwconfig command can be used:

$ iwconfig owl0 key off

Enable device power save mode

In power save mode, the device will sleep until either the host request to transmit data or until there is buffered incoming data to fetch from the access point. In power save mode, the throughput performance will be slightly degraded and the response latency will depend on the access point beacon interval and DTIM parameters. In most cases the access point is configured with 100 ms beacon interval and a DTIM interval of 1; this results in responses time around 100 ms. Depending on the application, the power consumption of the owl device can be heavily reduced.

Device power save mode can be enabled with the iwconfig command:

$ iwconfig owl0 power on

The current power management configuration can be shown by issuing iwconfig again:

$ iwconfig owl0
owl0    IEEE 802.11bg ESSID:"angr"
        Mode:Managed Frequency:2.422 GHz Access Point:68:7F:74:10:5B:4C
        Bit Rate=54 Mb/s
        Encryption key:0102-0304-05 Security mode:restricted
        Power Management timeout:10
        Link Quality=23/30 Signal level=-20 dBm Noise level=-43 dBm
        Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
        Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Power Management timeout:10 indicates that the device is in power save mode with a timeout setting of 10 [ms]. After waking up, the device will wait for timeout [ms] before going back to sleep.

List of supported Wireless Tools commands and options

iwconfig owl0 key <key 5 or 13 hex digits> [idx] [off]
iwconfig owl0 essid <ssid|off>
iwconfig owl0 ap <mac>
iwconfig owl0 power on|off
iwlist owl0 keys
iwlist owl0 

Access point mode

Make sure that the kernel module for access point mode is built on loaded, see BuildDrivers for details.

Start the access point with the SSID "hdwireless".

iwconfig owl0 essid hdwireless
iwconfig owl0 commit

It should now be possible to scan for the SSID "hdwireless" from e.g. a PC or a phone. Make sure to assign an IP address to the access point.

ifconfig owl0 192.168.1.1

When a client connects, the file /sys/class/net/owlap0/carrier will have the value '1'

cat /sys/class/net/owl0/carrier
1
Topic revision: r4 - 2015-02-16 - 08:31:53 - AndersGrahn

Log In (Admin Only)

 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback