Project

General

Profile

Wireless autoconf » History » Version 5

Pau Escrich, 06/13/2011 05:59 PM

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