Projecte

General

Perfil

Wireless autoconf » Historial » Versió 6

Pau Escrich, 13-06-2011 18:00

1 1 Pau Escrich
h1. Wireless autoconf
2
3 6 Pau Escrich
h2. Technical information (for developers)
4 1 Pau Escrich
Wireless configuration for file: /etc/config/qmp
5
6
These are the default parameters sharing all wireless interfaces
7 4 Pau Escrich
<pre>
8
config 'qmp' 'wireless'
9 3 Pau Escrich
 	option 'driver' 'mac80211'
10
 	option 'country' 'UZ'
11 1 Pau Escrich
 	option 'bssid' '02:CA:FF:EE:BA:BE'
12 4 Pau Escrich
</pre>
13 3 Pau Escrich
 
14 1 Pau Escrich
driver can be `mac80211` for athXk, and `madwifi` for madwifi
15 2 Pau Escrich
16
And these are the config parameters for each wifi interface.
17 3 Pau Escrich
<pre>
18
 config 'wireless'
19
 	option 'channel' '44'
20
 	option 'mode' 'adhoc'
21
 	option 'name' 'qmp'
22
 	option 'mac' '00:80:48:6b:25:b5'
23
 
24
 config 'wireless'
25
 	option 'channel' '10'
26
 	option 'mode' 'ap'
27
 	option 'name' 'qmp.cat-AP'
28
 	option 'mac' '00:80:48:6b:25:b6'
29
30
</pre>
31 5 Pau Escrich
32
To apply this configuration to device, you must execute this commands: 
33
<pre>
34
. /etc/qmp/qmp_wireless.sh
35
qmp_configure_wifi
36
</pre>
37
This function takes the parameters from UCI and using the templates from: /etc/qmp/templates creates the openwrt wireless config
38
Templates are named like that: wireless.mac80211.adhoc wireless.madwifi.ap
39
Separed by dots, second name is the driver to use and third one is the mode. 
40
41
These templates looks like this:
42
43
<pre>
44
config wifi-device #QMP_DEVICE
45
	option type     mac80211
46
	option macaddr	#QMP_MAC
47
	option channel  #QMP_CHANNEL
48
        option diversity 0 # 0:off, 1:on
49
        option txantenna 0 # 0:auto, 1:main, 2:aux
50
        option rxantenna 0 # 0:auto, 1:main, 2:aux
51
	option country	#QMP_COUNTRY
52
	option outdoor	1
53
#	option txpower  1 
54
55
config wifi-iface
56
	option device	#QMP_DEVICE
57
	option mode	adhoc
58
	option ssid	#QMP_SSID
59
	option bssid	#QMP_BSSID
60
	option encryption none
61
</pre>
62
As you can see, the special words starting witch #QMP will be replaced by UCI parameters. 
63
So you can play a little with templates. For example, there is a template named: `wireless.mac80211.adhoc-n`