Difference between revisions of "WiFi notes"

From Noah.org
Jump to navigationJump to search
Line 3: Line 3:
 
== connecting to an AP from the command-line ==
 
== connecting to an AP from the command-line ==
  
This should be the bare minimum you need to get WifI up and working with '''WPA''' security from the command-line. This does not establish a connection that will be restored on rebooot; this is just a temporary connection.
+
This should be the bare minimum you need to get WifI up and working with '''WPA''' security from the command-line. This does not establish a connection that will be restored on reboot; this is just a temporary connection.
  
 
Run `wpa_passphrase` to generate a conf file that will be used later by `wpa_supplicant`:
 
Run `wpa_passphrase` to generate a conf file that will be used later by `wpa_supplicant`:

Revision as of 17:48, 5 October 2011


connecting to an AP from the command-line

This should be the bare minimum you need to get WifI up and working with WPA security from the command-line. This does not establish a connection that will be restored on reboot; this is just a temporary connection.

Run `wpa_passphrase` to generate a conf file that will be used later by `wpa_supplicant`:

wpa_passphrase SOME-AP PASSWORD > wpa.conf

You will get a file that looks like this:

network={
        ssid="SOME-AP"
        #psk="PASSWORD"
        psk=f0431c0df3d54975b2fcf11f2041539e70d3ba74db889a0d78ed8cd0423f2c7a
}

Modify the file so that it looks like this (add the ctrl_interface and scan_ssid lines):

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
        ssid="SOME-AP"
        scan_ssid=1
        psk=f0431c0df3d54975b2fcf11f2041539e70d3ba74db889a0d78ed8cd0423f2c7a
}

Now run the following commands (where wlan0 is your WiFi device name):

ifconfig wlan0 up
wpa_supplicant -B -D wext -c "wpa.conf" -i wlan0 -f /var/log/wpa_supplicant.log
dhclient wlan0

If your dhcp server is stupid then you might also have to change your /etc/resolv.conf file to something like the following (8.8.8.8 is Google's free, public nameserver):

nameserver 8.8.8.8

Received Signal Strength Indicator

Received Signal Strength Indicator (RSSI) is dimensionless. It is a measure of relative signal strength; thus, it is only useful in comparing measurements made with the same hardware and drivers. Measurements are probably not comparable even between two different receivers made with identical equipment. The values returned from different hardware and drivers can have vastly different ranges and interpretations of minimum and maximum.

Contrast this to Signal Strength.

SNR

The Signal to Noise Ratio (SNR) in WiFi can be characterized by the following values:

>40 dB
excellent signal; almost always full speed.
25 - 40 dB
good signal; usually full speed, but may sometimes drop to lower speed.
15 - 25 dB
moderate signal; fast, but not always full speed.
10 - 15 dB
lowest useful signal; slow data speeds; may sometime loose association.
<10 dB
AP may be detectable, but rarely useful signal; rarely maintains association.

Signal Strength

Signal Strength is usually expressed in dBm. This is an absolute value (not dimensionless) for measuring milliwatts. That is, dBm is another way to measure milliwatts. The reference power is 0 dBm = 1 mW. The range of received signal power for WiFi stations is typically in the range or -80 to -60 dBm. Contrast this to Received Signal Strength Indicator.

  • A reading of -80 dBm equals 10 pW of received radio power.
  • A reading of -70 dBm equals 100 pW. This is 10 times stronger than -80 dBm.
  • A reading of -60 dBm equals 1000 pW, or 1 nW. This is 10 times stronger than -70 dBm.

The inside of a microwave oven can have a signal strength of 60 dBm, which is 1 kilowatt. There is a 120 dB difference between -60 dBm and 60 dBm. That's a factor of 10^12, so there is one trillion times more radio energy inside a microwave oven than what is received by a WiFi station. But, you have to be careful when trying to impress people with big numbers. The range of human hearing is also 120 dB. That ranges from the most quiet sound the ear can hear to the loudest sound the ear can hear before it is damaged.

1 milliwatt = 1.0 × 10-6 kilowatts

Location by RSSI

Trilateration

Bilinear Interpolation

Shapely