Configuring the Driver in Wi-Fi AP Mode#

This section provides steps to configure Wi-Fi AP mode using hostapd application.

  • Follow the steps below to run AP mode with hostapd application.

  1. Before running hostapd make sure wpa_supplicant or hostapd is not running in the background. Run the following command to stop wpa_supplicant if it is running:

    # killall wpa_supplicant
    # killall hostapd
  2. Install hostapd.

    # apt-get install hostapd

The below section provides the steps to configure Wi-Fi Access Point mode using startup script or manual commands. You can choose any one of the methods below.

Startup Script to Run Wi-Fi AP Mode#

Navigate to the rsi folder and use the script to run Wi-Fi AP mode after configuring hostapd.

   #./start_SiWT917.sh  AP

See the Startup Script section for more details about startup script file to configure in different operating modes.

Manual Steps to Run Wi-Fi AP Mode#

  • For AP mode connectivity, ensure that the dev_oper_mode is set in installation as given below and interface is detected after installation. See the Installing the Driver section.

     dev_oper_mode = 1
  • To install the modules manually, run the following commands, to configures in Wi-Fi AP mode, debug zone=0x601 and SDIO clock=50 Mhz

      #insmod rsi_91x.ko dev_oper_mode=2 rsi_zone_enabled=0x601
    
      #insmod rsi_sdio.ko sdio_clock=50

Configure hostapd#

Create a hostapd configuration file (for example: ap.conf) and add below:

  1. Create an ap.conf file with below information. Sample .conf files (ap_open.conf,ap_wpa.conf) are available within scripts directory of the release package with basic configurations required. You can use this file and edit the information as explained below. For the details of all available configurations, see the open source hostapd.conf file.

  2. Set interface name:

    interface=<interface_name>
    Ex: interface=wlan0
  3. Set driver name:

    driver=nl80211 
  4. Set country name code in ISO/IEC 3166-1 format. This is used to set regulatory domain. Set as needed to indicate country in which device is operating. This can limit available channels and transmit power.

    For example, IN for India, UK for United Kingdom, US for the United States of America.

    country_code=IN 
  5. Set your SSID: In the example below, we have set Test_AP as the SSID:

    ssid=Test_AP 
  6. Set operation mode ( b = IEEE 802.11b, g = IEEE 802.11g)

    hw_mode=g 
  7. Set Beacon Interval:

     beacon_int=100

    Note: You may select required beacon interval within the range of 56-1000 ms. For value less than 56 ms or more than 1000 ms, the driver will return an error. The defaut value is 100 ms.

  8. Set the channel number.

        channel=6

    Note: You may select a required channel of operation or you may opt for Auto Channel Selection (ACS). For ACS, you have to follow the procedure below.

    • Compile hostapd with below flag set in its .config file.

      CONFIG_ACS=y
    • Also user has to add below configurations to hostapd.conf file.

      channel=0
      acs_num_scans=5 (Default Value, user may select)
  9. Set wpa mode to 2:

    wpa=2 
  10. Set your passphrase (Wi-Fi password):

      wpa_passphrase=MyWiFiPassword
  11. Set key and auth options for WPA2:

    Set the key management algorithm as shown.

      wpa_key_mgmt=WPA-PSK

    Set cipher suites i.e., encryption algorithms:

     wpa_pairwise=TKIP 
     rsn_pairwise=CCMP 

    Shared Key Authentication :

     auth_algs=1

    Save and close the file.

    TKIP stands for Temporal Key Integrity Protocol and CCMP is AES in Counter mode with CBC-MAC .

  12. Start the hostapd application:

     # hostapd ap.conf –dddt > log_file & 
  13. To check if AP mode is successfully started or not, run the following command:

     # iw dev

    For example, if the AP is successfully started, expect the below sample output i.e., with SSID and channel information.

       phy#10
       Interface wlan0    
       ifindex 13
       wdev 0xa00000001
       addr ec:f6:4c:a0:3f:10
       ssid rsi_ap_wpa
       type AP
       channel 11 (2462 MHz), width: 20 MHz (no HT), center1: 2462 MHz

    And If AP failed to start, output does not show SSID and channel information as shown in below sample output :

       phy#10
       Interface wlan0
       ifindex 13
       wdev 0xa00000001
       addr ec:f6:4c:a0:3f:10
       type managed
  14. Run DHCP server script, located in scripts folder, to assign IPs to the client.

     # sh dhcp_server.sh <interface_name>

    Note: dhcp_server.sh script uses dhcpd.conf file for required configurations. You can modify this file as needed.

In the scripts folder, several hostapd config files are provided to start the AP in various modes, such as open (ap_open.conf), WPA/2-PSK (ap_wpa.conf). You could use these configuration files instead of creating new ones.

Note: For other hostapd configurations, such as ACL policy and keep alive, see the Configuring Wi-Fi Access Point Parameters section.