Skip to main content

Start the Wi-Fi subsystem

If the device is started in STA mode, Wi-Fi is active by default, that is, the Wi-Fi host driver and wpa_supplicant are launched during the boot process of the device.
  1. Ensure that the device is connected to the host over UART by performing the steps listed in Connect to a UART shell.
  2. To confirm if the Wi-Fi host driver is loaded, run the following command on the debug UART console:
  3. Search for the wlan0 interface in the output: Sample output
  4. To verify if wpa_supplicant is active, run the following command:
    The following output indicates that the wpa_supplicant has been successfully enabled:
Note:
As Predictable Network Interface Names enabled by default:
  • For non-PCIe interfaces, the WLAN interface name is wlanX (RB3GEN2, Shikra).
  • For PCIe interfaces, wlanX is renamed to wlpXsY, where:
    • X = PCIe port index + 1
    • Y = device index

Scan for Wi-Fi APs

A Wi-Fi scan finds the APs listed in the vicinity that must be initiated through the nmcli command line tool. To initiate a Wi-Fi scan using nmcli run the following command:
Sample output
Note To exit from the standard input shell, press CTRL+C.

Set up a Wi-Fi station

In the STA mode, the device operates as a client and it can connect to a wireless hotspot or router. Establish a wireless connection through the nmcli command line tool. To set up the Wi-Fi in STA mode, perform the following steps:
  1. Ensure that the device is connected to the host over UART by performing the steps listed in Connect to a UART shell.
  2. To establish a connection to an AP, run the following command:
    For example, run the command
    where, the Wi-Fi SSID is QualcommWiFi and the Wi-Fi password is 1234567890. Sample output
    Note If you see a network error message while running the command, then run one of the following commands to trigger the Wi-Fi scan and verify the intended AP.
  3. To verify the connection state, run the following command:
    Sample output
  4. To verify the connection status, perform the following steps:
    1. To view the device status, run the following command:
      Sample output
    2. To view the additional connection information, run the following command:
      Sample output
    3. Verify if the IP address is assigned on the wlan0 interface by running the ip addr show wlan0 command in the UART console.
      Sample output
    4. Verify if the AP or router is connected to the Internet by pinging the following public DNS IP:
      Sample output
      Note If you are connected to one network, but want to use a different connection, you can disconnect by switching the connection to down by specifying the SSID nmcli con down ssid/uuid. Alternatively, if you have multiple connections with the same SSID, use the UUID. Note To connect to another saved connection, simply pass the up option in the nmcli command line tool by running the following command.
      Ensure that you specify the SSID or UUID of the new network that you want to connect to. Note To exit from the standard input shell, press CTRL+C. For more information about nmcli, see https://www.linux.org/docs/man1/nmcli.html and https://networkmanager.dev/docs/api/latest/nmcli.html.

Set up a Wi-Fi hotspot

Ensure that you enable SSH by following the steps listed in Sign in using SSH. Set up a Wi-Fi hotspot in SoftAP mode by performing the following steps: Run the SSH using the following command:
For example, if the IP address of the device is 192.168.1.22, run the following command:
Note If there is a WCN6750 chipset, ensure that the Wi-Fi SoftAP operating channel configured on the Qualcomm Dragonwing RB3 Gen 2 Development Kit is the same as the one on the Wi-Fi STA operating channel (excluding the DFS channel). Note Use either STA or SAP with a DFS channel because STA+SAP SCC DFS concurrency is currently unavailable. By default the hostapd.conf file is available at /etc location. This file configures the RB3 Gen 2 device as a Wi-Fi SoftAP operational mode with SSID as QSoftAP and password as 1234567890.
  1. Add the Wi-Fi SoftAP operational mode interface by running the following command:
  2. Reconfigure Wi-Fi SoftAP operational mode by performing the following steps:
    1. Open a new command prompt/terminal.
    2. Pull the default hostapd.conf file from the device by running the following command:
      To pull a file to the current file path, enter the <destination_file_path> as . in the command. For example, the IP address of the device is 192.168.1.22, to pull hostapd.conf from /etc, run the following command:
    3. Update the hostapd.conf file with the required SSID, password, and relevant hostapd configurations. Note Update hw_mode accurately while modifying the Wi-Fi channel. For more information about hostapd configuration, see https://w1.fi/cgit/hostap/plain/hostapd/README.
    4. Push the file to the device by running the following command:
    5. To verify that the configuration parameters are updated, run the following command in the device for the hostapd.conf file:
  3. Set a MAC address for wlan1 on the Qualcomm Dragonwing RB3 Gen 2 Development Kit that has a WCN6750 Wi-Fi chipset. The following example can be used as a reference while setting up a MAC address.
  4. To set up the SoftAP, run the following command in the ssh shell:
    The following output indicates that the AP is set up:
  5. To start the Dynamic Host Configuration Protocol (DHCP) server on the Wi-Fi hotspot interface, run the following commands:
  6. To establish a connection with the hostapd_cli, run the following command in SSH:
    Monitor the hostapd_cli console for the Wi-Fi STA connection notifications such as AP-STA-CONNECTED, EAPOL-4WAY-HS-COMPLETED. Sample output
  7. To verify the connection status, connect to SoftAP from other devices. For example, connect to SoftAP from a mobile device by performing the following steps:
    1. On the mobile device, go to the Wi-Fi settings.
    2. Wait for the Wi-Fi STA to detect SoftAP (with the SSID QSoftAP).
    3. Select SoftAP and enter the corresponding wpa_passphrase that was configured for SoftAP on the RB3 Gen 2 device, then connect. Sample output
    4. To verify the connection, ping the IP address of the mobile from the RB3 Gen 2 device in the ssh shell. The following output indicates that the Wi-Fi connection has been established successfully and the data transfer has begun:
      Alternatively, you can verify the Wi-Fi connection status in the Settings of the connected device. For example, to get the IP address of a mobile device connected to the RB3 Gen 2 SoftAP, perform the following steps:
      1. Go to Settings > Wi-Fi.
      2. Verify the SSID of the AP.

Stop a Wi-Fi hotspot

Note Ensure that the Wi-Fi hotspot has been set up. To stop the hotspot, do the following in SSH:
  1. Stop the hostapd by performing the following steps:
    1. To stop the hostapd process, run the following command:
    2. To disable the interface, run the following command:
  2. To delete ctrl_interface, run the following command:
    The Wi-Fi hotspot stops successfully.