WILI-S Radio Tuning
From wiliGear wiki
Contents |
Antenna Settings
Most of the radio module manufacturers mark main antenna connector on PCB as "main". Usually these settings provided in default system.cfg match for the main antenna:
radio.1.rx_antenna = 1 (default) radio.1.tx_antenna = 1 (default)
If the radio link is unstable while the distance between the wireless devices is 20-25 meters, it’s recommended to re-configure antenna settings in system.cfg as provided below and check if the link improved:
radio.1.rx_antenna = 2 radio.1.tx_antenna = 2
If the only antenna is connected, antenna diversity functionality should be disabled:
radio.1.rx_antenna_diversity=disabled radio.1.tx_antenna_diversity=disabled
Signal Monitoring
Remote Wireless Client/AP Signal strength can be monitored in shell (type command “shell” while in “cli>”), using the command:
# iwconfig <wireless_interface>
or
# wlanconfig <wireless_interface> list
<wireless_interface> is ath0 usually if the Atheros wireless card is used.
Client side signal monitoring example:
# iwconfig ath0 | grep Link
The command output should be like:
00:15:6D:11:11:3E : Quality=32/94 Signal level=-63 dBm Noise level=-95 dBm
Shell command:
# while true; do iwconfig ath0 | grep level; sleep 1; done
can be used for the permanent monitoring of the signal level.
“Quality” parameter value should be used as primary factor for antenna aligning (it’s value depends totally on the driver and hardware);
“Signal level” shows the RSSI - how strong the received signal is (it’s value depends on driver meta information to interpret the raw value given);
“Noise level” is the background noise level (when no packet is transmitted).
On AP side detailed associated station information can be monitored using the command:
# wlanconfig ath0 list
The command output should be like:
ADDR AID CHAN RATE RSSI DBM IDLE TXSEQ RXSEQ CAPS ACAPS ERP STATE MODE 00:0e:35:29:e0:b2 1 8 6M 43 -52 225 7850 46464 ESs 0 25 Normal
Atheros Link Quality(SNR)/Signal level association table:
| Link quality (RSSI) | Signal level (dBm) | Link quality (RSSI) | Signal level (dBm) | Link quality (RSSI) | Signal level (dBm) | Link quality (RSSI) | Signal level (dBm) |
| 60 /94 | -35 | 45 /94 | -50 | 30 /94 | -65 | 15 /94 | -80 |
| 59 /94 | -36 | 44 /94 | -51 | 29 /94 | -66 | 14 /94 | -81 |
| 58 /94 | -37 | 43 /94 | -52 | 28 /94 | -67 | 13 /94 | -82 |
| 57 /94 | -38 | 42 /94 | -53 | 27 /94 | -68 | 12 /94 | -83 |
| 56 /94 | -39 | 41 /94 | -54 | 26 /94 | -69 | 11 /94 | -84 |
| 55 /94 | -40 | 40 /94 | -55 | 25 /94 | -70 | 10 /94 | -85 |
| 54 /94 | -41 | 39 /94 | -56 | 24 /94 | -71 | 9 /94 | -86 |
| 53 /94 | -42 | 38 /94 | -57 | 23 /94 | -72 | 8 /94 | -87 |
| 52 /94 | -43 | 37 /94 | -58 | 22 /94 | -73 | 7 /94 | -88 |
| 51 /94 | -44 | 36 /94 | -59 | 21 /94 | -74 | 6 /94 | -89 |
| 50 /94 | -45 | 35 /94 | -60 | 20 /94 | -75 | 5 /94 | -90 |
| 49 /94 | -46 | 34 /94 | -61 | 19 /94 | -76 | 4 /94 | -91 |
| 48 /94 | -47 | 33 /94 | -62 | 18 /94 | -77 | 3 /94 | -92 |
| 47 /94 | -48 | 32 /94 | -63 | 17 /94 | -78 | 2 /94 | -93 |
| 46 /94 | -49 | 31 /94 | -64 | 16 /94 | -79 | 1 /94 | -94 |
Site Survey
Site survey functionality can be enabled if the wireless interface (ath0) is operating in client (managed) mode only. To set wireless interface ath0 into client operating mode, use command:
# iwconfig ath0 mode managed
For the site survey use the command:
# iwlist ath0 scan
To filter the used frequencies only, use the command:
# iwlist ath0 scan | grep Freq
The command output should be like:
# Frequency:2.422 GHz (Channel 3) # Frequency:2.422 GHz (Channel 3) # Frequency:2.442 GHz (Channel 7) # Frequency:2.442 GHz (Channel 7) # Frequency:2.457 GHz (Channel 10) # Frequency:2.462 GHz (Channel 11)
thus showing what channels are occupied.
ACK and CTS Timeout settings
If you have:
- a long range link
- the right antennas
- plenty of TX power and RX sensitivity
but the link has very low throughput over long distances (while it works fast over short distances), the problem could be the incorrect ACK timeout setting value.
What is ACK Timeout Setting:
When a packet is sent out from Station(A) it then waits for an 'ACKnowledgement frame' from Station(B). 802.11Station(A) will only wait for a certain amount of time, this time is called the ACK timeout. If the ACK is not received within that timeout period then the packet will be re-transmitted from 802.11Station(A) resulting in reduced throughput. When sending lots of packets you can see how equipment in this scenario wouldn't perform very well as the equipment would be continuously transmitting 'retries' due to the ACK not making it back to Station(A) in time, effectively losing throughput no matter what the signal strength.
The current Atheros chipsets have a hard limit of 409uS - roughly 45Km to 50Km. Maximum theoretical ACK timeouts
802.11a : 409us ~ 61km 802.11b : 744us ~ 111km 802.11g : 372us ~ 55km
The higher is the ACK timing the lower the throughput, if the ACK setting is too high then throughput will be lost due to waiting for the Ack Window to timeout on lost packets. If the ACK setting is too low then the ACK window will have expired and the returning packet will be dropped, greatly lowering throughput. By having the ability to adjust the ACK setting you can effectively optimize the throughput over long distance links (44Km+ link can get throughput of 1 MByte/s by adjusting the ACK timeout).
What is best ACK timing for long distance 802.11a: The optimal value of the ACK Timeout depends on the distance between wireless devices and should be tuned in manual way. This value is critical for the data throughput and should be tune thoroughly.
The formula for setting the ACK timing is
ACK=23+(Distance in meter/150)
ACK Timeout value is set in configuration file system.cfg as the key:
radio.1.acktimeout = 78
CTS Timeout value is set in configuration file system.cfg as the key:
radio.1.ctstimeout = 78
It is important to change the value to find the optimal setting. A value too low will give very low throughput. A high value may slowdown the link. A low value is far worse then a value slightly too high. ACK Timeout value should be tuned to the optimal value for the maximum system throughput.
Basic recommendations for 5GHz (802.11a) radio mode are:
| Distance (km) | ACK timeout value |
|---|---|
| 1 | 55 |
| 4 | 60 |
| 7 | 75 |
| 10 | 85 |
| 15 | 121 |
| 19 | 135 |
| 20 | 160 |
| 25 | 203 |
| | For 5GHz-turbo mode optimal ACK Timeout values are different (i.e. 802.11a_ACK=33, 802.11g_ACK=48, 802.11aTurbo_ACK=31, 802.11gTurbo_ACK=22) |
ACK Timeout value can be set directly to the wireless device driver using the shell command:
# echo 55 > /proc/sys/dev/wifi0/acktimeout
CTS Timeout value can be set directly to the wireless device driver using the shell command:
# echo 55 > /proc/sys/dev/wifi0/ctstimeout
Active ACK Timeout value can be printed using the shell command:
# cat /proc/sys/dev/wifi0/acktimeout
The command output should be like:
# 55
Active CTS Timeout value can be printed using the shell command:
# cat /proc/sys/dev/wifi0/ctstimeout
The command output should be like:
# 55
CTS timeout value should be the same as ACK timeout value.
Radio settings
There are several radio settings which may influence on system performance. The optimal values for these settings should be saved in configuration file system.cfg using the keys:
# radio.1.channel # radio.1.txpower # radio.1.rate.auto # radio.1.rate.max # radio.1.frag # radio.1.rts
The Super A mode is a mode special from Atheros. For more information look at the website www.superag.com. The technique behind the Super mode are frame bursting, fast frames, compression and dynamic turbo. At the Atheros site there is a white paper called Super G Maximizing Wireless Performance with more details.
The key:
radio.1.turbo
enables 802.11a-TurboA/802.11g-SuperG feature. The only TurboA possible channels are: 42, 50 and 58; the only SuperG possible channel is: 6.
Country Codes
The country codes is a numeric code of a physical territory. The country names is official short 2 or 3 letters names in English. Each country or territory has three codes:
- Two letter code
- Three letter code
- Three digit code
For example Lithuania can be displayed as LT, LTU or 440.
This is a subset of the full ISO 3166 lists. The countries listed here are supported in the wireless interface drivers (radio.countrycode key). See: http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/index.html and http://unstats.un.org/unsd/methods/m49/m49alpha.htm for the complete ISO country code lists.
