Projecte

General

Perfil

Actions

Wireless autoconf » Historial » Revisió 5

« Anterior | Revisió 5/15 (diferencies) | Següent »
Pau Escrich, 13-06-2011 17:59


Wireless autoconf

Wireless configuration for file: /etc/config/qmp

These are the default parameters sharing all wireless interfaces

config 'qmp' 'wireless'
     option 'driver' 'mac80211'
     option 'country' 'UZ'
     option 'bssid' '02:CA:FF:EE:BA:BE'

driver can be `mac80211` for athXk, and `madwifi` for madwifi

And these are the config parameters for each wifi interface.

 config 'wireless'
     option 'channel' '44'
     option 'mode' 'adhoc'
     option 'name' 'qmp'
     option 'mac' '00:80:48:6b:25:b5'

 config 'wireless'
     option 'channel' '10'
     option 'mode' 'ap'
     option 'name' 'qmp.cat-AP'
     option 'mac' '00:80:48:6b:25:b6'

To apply this configuration to device, you must execute this commands:

. /etc/qmp/qmp_wireless.sh
qmp_configure_wifi

This function takes the parameters from UCI and using the templates from: /etc/qmp/templates creates the openwrt wireless config
Templates are named like that: wireless.mac80211.adhoc wireless.madwifi.ap
Separed by dots, second name is the driver to use and third one is the mode.

These templates looks like this:

config wifi-device #QMP_DEVICE
    option type     mac80211
    option macaddr    #QMP_MAC
    option channel  #QMP_CHANNEL
        option diversity 0 # 0:off, 1:on
        option txantenna 0 # 0:auto, 1:main, 2:aux
        option rxantenna 0 # 0:auto, 1:main, 2:aux
    option country    #QMP_COUNTRY
    option outdoor    1
#    option txpower  1 

config wifi-iface
    option device    #QMP_DEVICE
    option mode    adhoc
    option ssid    #QMP_SSID
    option bssid    #QMP_BSSID
    option encryption none

As you can see, the special words starting witch #QMP will be replaced by UCI parameters.
So you can play a little with templates. For example, there is a template named: `wireless.mac80211.adhoc-n`

Actualitzat per Pau Escrich fa més de 13 anys · 5 revisions