wiki:OpenWrt/wireless

Version 1 (modified by trac, 7 years ago) ( diff )

--

This information has been tested and created for use on the Gateworks Single Board Computers (SBCs), specifically the Ventana family that utilizes the Freescale i.MX6 processors.

Gateworks SBCs can be viewed at the following link: http://www.gateworks.com

http://trac.gateworks.com/raw-attachment/wiki/OpenWrt/wireless/relayd/gw5100realsmall.png

OpenWrt 802.11 Wireless

For wireless info regarding to other BSP's see:

General Configuration

OpenWrt its own system configuration called Unified Configuration Interface or UCI. You can use the uci command-line utility to get/set configuration or edit the files directly under /system/config (if you know what your doing). Often we will provide uci command-line examples because these can be easily cut-n-pasted into a shell.

Wireless radio configuration is contained in /etc/config/wireless, but the network configuration is contained in /etc/config/network. Each physical radio has a 'wifi-device' config section and each virtual interface (there is always one or more per physical radio) has a 'wifi-iface' config section that also specifies a 'network' config that links back to a section in /etc/config/network.

Example configuration for a single radio (WLE300NX 802.11N) with a wireless Access Point:

  • looking at /etc/config/wireless
    root@OpenWrt:/# cat /etc/config/wireless 
    config wifi-device  radio0
            option type     mac80211
            option channel  11
            option hwmode   11ng
            option path     pci0001:00/0001:00:01.0
            option htmode   HT20
            list ht_capab   LDPC
            list ht_capab   SHORT-GI-20
            list ht_capab   SHORT-GI-40
            list ht_capab   TX-STBC
            list ht_capab   RX-STBC1
            list ht_capab   DSSS_CCK-40
    
    config wifi-iface
            option device   radio0
            option network  lan
            option mode     ap
            option ssid     OpenWrt
            option encryption none
    
  • using UCI:
    root@OpenWrt:/# uci show wireless
    wireless.radio0=wifi-device
    wireless.radio0.type=mac80211
    wireless.radio0.channel=11
    wireless.radio0.hwmode=11ng
    wireless.radio0.path=pci0001:00/0001:00:01.0
    wireless.radio0.htmode=HT20
    wireless.radio0.ht_capab=LDPC SHORT-GI-20 SHORT-GI-40 TX-STBC RX-STBC1 DSSS_CCK-40
    wireless.@wifi-iface[0]=wifi-iface
    wireless.@wifi-iface[0].device=radio0
    wireless.@wifi-iface[0].network=lan
    wireless.@wifi-iface[0].mode=ap
    wireless.@wifi-iface[0].ssid=OpenWrt
    wireless.@wifi-iface[0].encryption=none
    

For more info:

Adding a Wireless Radio

Here are the steps to add a wireless radio to your board:

  1. Insert Wireless Card into Mini-PCI / Mini-PCIe slot.
  2. Power on and boot Gateworks Single Board Computer
  3. The wireless configuration is located in the file /etc/config/wireless. Run the command cat /etc/config/wireless to display this file and ensure your device is detected (each physical radio will have a 'wifi-device' section with the 'macaddr' option matching the unique MAC address of the radio
  4. By default newly detected wireless devices are disabled. You will have to comment out or remove the 'option disabled 1' in the appropriate wifi-device section.

Re-detecting Wireless Radios

If something happens to your /etc/config/wireless file, you can force a re-detection with:

wifi detect > /etc/config/wireless

Enabling a Wireless Radio

By default OpenWrt does not enable the radios it detects. You must do this using the LuCI web-admin or via shell commands.

Using UCI shell command to enable radio0:

uci delete wireless.radio0.disabled
uci commit

Radio Identification

Each Physical radio detected in a system has a 'wifi-device' section. Which radio each section pertains to is specified by either:

  • a 'macaddr' linking the config section to a specific radio regardless of bus/slot it is detected on (making it easy to move radios around in physical slots if that is your desire). For example:
            option macaddr  '04:f0:21:01:3d:02'
    
  • a 'path' pointing to a specific bus/slot (making it easy to refer to a radio in a specific physical location regardless of the radio's unique mac address or order of detection. For example the following specifies the first slot on the first PCI bus:
            option path     'pci0001:00/0001:00:01.0'
    
  • a 'phy' pointing to the order the radio was detected in the system (making it easy to refer to the 'first' radio detected (phy0) or the 'second' radio detected (phy1) for example)
            option phy      'phy0'
    

Troubleshooting

Here are the common pitfalls of OpenWrt wireless configuration:

  • If the /etc/config/wireless file does not exist or does not contain a 'wifi-device' section matching your card, the card is not being detected
    • use the latest Gateworks OpenWrt BSP for the latest wireless drivers
    • If the drivers that are loaded on the system do not support the card, the card will not come up.
    • Be sure the proper wireless drivers are loaded on the system for the wireless chipset being used. Using the command opkg list will show installed packages and drivers.
    • Check to see if the card shows up when using shell commands lspci (for miniPCI and miniPCIe based cards) or lsusb (for USB based cards)
      • If not then the card is not getting powered, the slot it is in does not have USB or PCI routed to it, or the card is malfunctioning.
  • Make sure you have 'enabled' the card (see above). By default OpenWrt puts newly detected cards in the disabled state (option disabled 1)

Driver Support

OpenWrt uses a fairly modern Linux kernel and drivers from the Linux Backports project which provides support for drivers for many common 802.11 devices.

Some popular drivers (and notes specific to them are):

  • ath9k (802.11n based Qualcomm / Atheros cards):
    • htmod can be set to HT20 (20MHz channel width), HT40- or HT40+ (40MHz channel widths)
  • ath10k (802.11ac based Qualcomm / Atheros cards):
    • htmode can be set to VHT40 (40MHz channel width), VHT80 (80MHz channel width), VHT160 (160MHz channel width, if your card supports it)
    • Sample 802.11AC configuration file for OpenWrt in /etc/config/wireless using a ACE-DB-3 Doodle Lab Wireless Card in Access Point Mode with a SSID of OpenWrt and no security below:
      config wifi-device  radio0
              option type     mac80211
              option channel  157
              option hwmode   11a
              option path     'soc0/soc.0/1ffc000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:05.0/0000:05:00.0'
              option htmode   VHT80
      
      config wifi-iface
              option device   radio0
              option network  lan
              option mode     ap
              option ssid     OpenWrt
              option encryption none
      

Wireless Configurations

Networking

Note: See TracWiki for help on using the wiki.