音樂播放器原型機之《可能性》 WiFi 除錯‧分析儀

220px-Wi-Fi_Logo.svg
Wi-Fi Alliance

200px-Wi-Fi
無線區域網路通訊

Wi-Fi 是 『 Wi-Fi 聯盟製造商』Wi-Fi Alliance 的商標,將它做為產品『符合聯盟標準』的品牌認證標章。據聞這個名稱淵源於『 HiFi 』── 高傳真音響 ── 的命名法,代表『高品質無限傳輸』裝置,定義為︰

Wi-Fi as any “wireless local area network” (WLAN) products that are based on the Institute of Electrical and Electronics Engineers’ (IEEE) 802.11 standards”.

這個 Wi-Fi 聯盟成立於一九九九年,那時叫做『 Wireless Ethernet Compatibility Alliance』 WECA 。然後在二零零二年,正式更名為『 Wi-Fi Alliance 』。然而並非市面上的商品都會申請 Wi-Fi 聯盟的認證,也非缺少 Wi-Fi 認證的東西就一定意味著不相容於『 IEEE 802.11 』 的規範。又或許正因為『相容性』等等太技術化的問題,在樹莓派上使用以及設定無限區域網路時,依然需要了解一些技術細節,更不要說玩『熱點』AP  Access Point 的人了。那麼當我們實務上如果碰到『無線網路』的問題時,該怎麽『除錯』呢?還是說不得不有一台『 WiFi 分析儀』的呢??從早年 HP 贊助『 Wireless Tools for Linux 』開源計畫之始,『 Jean Tourrilhes 』寫了著名的『 iwconfig 』工具,而今也到了功成身退的時候。現今想玩 linux wireless 的人,大概最好知道『 iw 』新工具的用法,一個簡單的『 iw list 』指令可以告訴你,系統上的『無限網卡』符合多少『 IEEE 802.11 』 的『界面模式』 interface modes !

iw list

Wiphy phy0
	Band 1:
		Capabilities: 0x172
			HT20/HT40
			Static SM Power Save
			RX Greenfield
			RX HT20 SGI
			RX HT40 SGI
			RX STBC 1-stream
			Max AMSDU length: 3839 bytes
			No DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: 2 usec (0x04)
		HT RX MCS rate indexes supported: 0-7, 32
		TX unequal modulation not supported
		HT TX Max spatial streams: 1
		HT TX MCS rate indexes supported may differ
...

	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * WDS
		 * monitor
		 * mesh point
	software interface modes (can always be added):
		 * AP/VLAN
		 * monitor
...

在此特別介紹一個『實用』的『 WiFi 除錯‧分析儀』軟體,很適合在擁有小螢幕,用『電池』跑的可攜式『樹莓派』之上。由於這個工具需要『無限網卡』能夠設定成『 monitor mode 』,所以作者選擇了『已知沒問題』,使用『 Ralink Technology, Corp. RT5370 Wireless Adapter 』的裝置。因為這是用於『 WiFi 環境』的『偵測』與『除錯』,所以說『天線』的『靈敏度』或許必須得考慮,其次就像『 horst 』軟體作者在『使用手冊』裡所講的︰

The “poor mans spectrum analyzer” screen is only really useful when horst is started with the -s option or the “Automatically change channel” option is selected in the “Chan” settings.

 

272_P_1397252303326

horst_main

horst_spectrum

此處僅簡記作者之『安裝』與『執行』的方法︰

git clone git://br1.einfach.org/horst

cd horst/

make

sudo iw dev wlan0 del

sudo iw phy phy0 interface add mon0 type monitor

sudo ./horst -i mon0