勇闖新世界︰ W!o《卡夫卡村》變形祭︰圓局定向‧一

雖然不知 M♪o 所用的『無線阡陌網』科技如何?就讓我們用常見的『熱點』與 USB WiFi 『小玩意』來研究那『定向器』可以怎樣實現的呢??在一篇名為

Testing of location systems using WiFi in indoor environments

的文章裡,有人探討了這個技術。更有一本叫做

Principles of Wireless Access and Localization

的書,較詳細說明了無限 WiFi 之 WPS 定位技術。

其中一個關鍵之處就在『接收訊號強度指示』 RSSI 這個『術語』。據維基百科解釋︰

Received signal strength indication

RSSI in 802.11 implementations

In an IEEE 802.11 system, RSSI is the relative received signal strength in a wireless environment, in arbitrary units. RSSI is an indication of the power level being received by the antenna. Therefore, the higher the RSSI number, the stronger the signal.

RSSI can be used internally in a wireless networking card to determine when the amount of radio energy in the channel is below a certain threshold at which point the network card is clear to send (CTS). Once the card is clear to send, a packet of information can be sent. The end-user will likely observe a RSSI value when measuring the signal strength of a wireless network through the use of a wireless network monitoring tool like Wireshark, Kismet or Inssider. As an example, Cisco Systems cards have a RSSI_Max value of 100 and will report 101 different power levels, where the RSSI value is 0 to 100. Another popular Wi-Fi chipset is made by Atheros. An Atheros based card will return an RSSI value of 0 to 127 (0x7f) with 128 (0x80) indicating an invalid value.

There is no standardized relationship of any particular physical parameter to the RSSI reading. The 802.11 standard does not define any relationship between RSSI value and power level in mW or dBm. Vendors and chipset makers provide their own accuracy, granularity, and range for the actual power (measured as mW or dBm) and their range of RSSI values (from 0 to RSSI_Max).[2] One subtlety of the 802.11 RSSI metric comes from how it is sampled—RSSI is acquired during only the preamble stage of receiving an 802.11 frame, not over the full frame. As early as 2000, researchers were able to use RSSI for coarse-grained location estimates.[3] More recent work was able to reproduce these results using more advanced techniques.[4] Nevertheless, RSSI doesn’t always provide measurements that are sufficiently accurate to properly determine the location.[5]

 

可知它不是像『尺』一般的『量距離』設備,比較像海邊『燈塔』一樣的『遠近』指示。所以實務上 WPS 常和 GPS 組在一塊,用以收集、定位、校正那些『WiFi AP』的數據。在此引用前面網文裡的兩張圖,或可意會 RSSI 與距離的複雜關係。

 

figure-8

 

figure9

 

假使在樹莓派已有 USB WiFi 『小玩意』,而且連接到 WiFi AP 上,一個『 iwconfig 』指令,可以告知『連接品質』 Link Quality 以及『訊號準位』 Signal level 。

pi@raspberrypi ~ iwconfig wlan0 wlan0     IEEE 802.11bg  ESSID:"caseyhome"  Nickname:"<WIFI@REALTEK>"           Mode:Managed  Frequency:2.412 GHz  Access Point: 10:6F:3F:62:2C:15              Bit Rate:54 Mb/s   Sensitivity:0/0             Retry:off   RTS thr:off   Fragment thr:off           Power Management:off           Link Quality=100/100  Signal level=100/100  Noise level=0/100           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0           Tx excessive retries:0  Invalid misc:0   Missed beacon:0  pi@raspberrypi ~ 

 

另一個『 iwlist wlan0 scanning 』之指令,則能提供周遭可連線之 WiFi AP 的『連接品質』與『訊號準位』數據。這兩個指令來自於 Jean Tourrilhes 先生啟始的

Wireless Tools for Linux

Presentation

The Linux Wireless Extension and the Wireless Tools are an Open Source project sponsored by Hewlett Packard (through my contribution) since 1996, and build with the contribution of many Linux users all over the world.

The Wireless Extension (WE) is a generic API allowing a driver to expose to the user space configuration and statistics specific to common Wireless LANs. The beauty of it is that a single set of tool can support all the variations of Wireless LANs, regardless of their type (as long as the driver support Wireless Extension). Another advantage is these parameters may be changed on the fly without restarting the driver (or Linux).

The Wireless Tools (WT) is a set of tools allowing to manipulate the Wireless Extensions. They use a textual interface and are rather crude, but aim to support the full Wireless Extension. There are many other tools you can use with Wireless Extensions, however Wireless Tools is the reference implementation.

  • iwconfig manipulate the basic wireless parameters
  • iwlist allow to initiate scanning and list frequencies, bit-rates, encryption keys…
  • iwspy allow to get per node link quality
  • iwpriv allow to manipulate the Wireless Extensions specific to a driver (private)
  • ifrename allow to name interfaces based on various static criteria

Most Linux distributions also have integrated Wireless Extensions support in their networking initialisation scripts, for easier boot-time configuration of wireless interfaces. They also include Wireless Tools as part of their standard packages.

Wireless configuration can also be done using the Hotplug or uDev scripts and distribution specific support, this enable the proper support of any removable wireless interface (Pcmcia, CardBus, USB…).

Any versions of the Pcmcia package offer the possibility to do wireless configuration of Pcmcia and Cardbus card through thefile wireless.opts. This allow to fully integrate wireless settings in the Pcmcia scheme mechansism. However, this method is now deprecated in favor of distribution specific methods.

Please note that the Wireless Tools (starting with version 19) supports fully IEEE 802.11 parameters and devices, support older style of devices and most proprietary protocols, and are prepared to handle HiperLan as well. More recent versions of course adds more 802.11 support.
But, unfortunately not all drivers support all these features…

………

雖然根據

User Tools

About iw

iw is a new nl80211 based CLI configuration utility for wireless devices. It supports all new drivers that have been added to the kernel recently. The old tool iwconfing, which uses Wireless Extensions interface, is deprecated and it’s strongly recommended to switch to iw and nl80211.

Like rest of Linux kernel, iw is still under development. Features are added ‘as we go’. The only documentation for iw is this page and output from ‘iw help’. Please help expand this page.

There is a page listing use cases with iwconfig and iw: replacing iwconfig.

Getting iw

Release tarballs of iw are available from http://kernel.org/pub/software/network/iw/.

Alternatively, you can download iw from git: http://git.kernel.org/?p=linux/kernel/git/jberg/iw.git.

Build requirements

  • libnl >= libnl1
  • libnl-dev >= libnl-dev-1
  • pkg-config Using iw requires you to have libnl, the first working version is 1.0 pre8 as this release introduced genl, Generic Netlink, which nl80211 relies on. If your distribution’s libnl is a wrong version then you’ll have to download and compile libnl yourself for now (http://www.infradead.org/~tgr/libnl/).

 

所言『 Wireless Extension 』終逐步步入歷史,這個替換過程或許還很長。何不就通熟兩者的呢!接續的文本,將以『派生』方便性與『實務』容易性為考量,應用兩套工具,或有『取巧之嫌』,豈可不辯之以學習『簡易是尚』的耶!!