wiki:Yocto/Wireless

Version 2 (modified by Bobby Jones, 6 years ago) ( diff )

Replace AP configuration section with link to relevant section in wireless/wifi

Goal

This page will attempt to guide a user through setting up a wireless connection (both as an AP and as a STA)

Wireless Info

Our product uses the compat-wireless driver set which provides the most recent drivers from linux-wireless backwards-compatible with older kernel versions. The following packages are required or at least recommended for wireless:

  • iw (recommended) - the iw tool for interfacing with modern mac80211 based wireless drivers
  • wireless-tools (deprecated) - the old toolset for interfacing with legacy wireless drivers (somewhat backwards compatible)
  • hostap-daemon - (required for AP mode) the hostapd background daemon app required for AP configuration
  • wpa-supplicant - (required for client (STA) mode with encryption) the wpa-supplicant daemon/app required for client (STA) configuration when using encryption

See also:

client configuration (STA)

Using wpa_passphrase/wpa_supplicant

In order to connect to a network with WPA encryption, you must use the wpa_supplicant application. First you must generate a configuration file which is often made easy with the wpa_passphrase application. Then, you must use wpa_supplicant to connect to the network and finally you can configure an IP address (static or dynamic if the AP is running DHCP). The netbase package provides tools such as ifup/ifdown and a config file /etc/network/interfaces that can configure network on startup.

Example:

  1. edit /etc/network/interfaces and edit/add the following to configure wlan0 on boot wpa_supplicant:
    # Wireless interfaces
    auto wlan0
    iface wlan0 inet dhcp
            wireless_mode managed
            wireless_essid any
            #wpa-driver wext
            wpa-driver nl80211 # New software makes use of nl80211 over wext!
            wpa-conf /etc/wpa_supplicant.conf
    
    • this causes the network interface to be automatically configured on boot (auto wlan), use dhcp for IP address configuration, and run in client mode using wpa supplicant to manage the authentication/encryption keys
  2. configure wpa_supplicant to connect to SSID 'testssid' with no key management.
    network={
            scan_ssid=1
            ssid="testssid"
            key_mgmt=NONE
    }
    
    Or with key management:
    network={
            scan_ssid=1
            ssid="MYSSID"
            proto=WPA
            key_mgmt=WPA-PSK
            psk="MYWPAPASSCODE"
    }
    
    You can also generate the wpa_supplicant.conf file using a tool called wpa_passphrase. Below is an example usage:
    root@ventana:~# wpa_passphrase MYSSID MYWPAPASSCODE
    network={
            ssid="MYSSID"
            #psk="MYWPAPASSCODE"
            psk=82207641ae13124ee6dc8fd2642605ac52a17405263b0b3203ee5cdb826d700d
    }
    root@ventana:~# wpa_passphrase MYSSID MYWPAPASSCODE > /etc/wpa_supplicant.conf
    
  3. To start manually:
    killall wpa_supplicant
    wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B
    
    • To start automatically: Just reboot! The /etc/network/interfaces file we touched above will configure wlan0 to automatically come up with the given options. If you have issues with this, please see the #Troubleshooting section below.

Access Point configuration (AP)

For more information on access point configuration, see wireless/wifi.

Note: See TracWiki for help on using the wiki.