.. _wifi_softap_sample: Wi-Fi: SoftAP ############# .. contents:: :local: :depth: 2 The SoftAP sample demonstrates how to start an nRF70 Series device in :term:`Software-enabled Access Point (SoftAP or SAP)` mode. Requirements ************ The sample supports the following development kits: .. table-from-sample-yaml:: Overview ******** The sample enables SoftAP mode and allows the devices to connect to it. It starts a Dynamic Host Configuration Protocol (DHCP) server to assign the automatic IP address to the connected devices. Then, the sample lists the connected devices. You can enable the SoftAP mode by setting the below configuration options in the sample project configuration file: * :kconfig:option:`CONFIG_NRF700X_AP_MODE`: Enables access point mode support. * :kconfig:option:`CONFIG_WPA_SUPP_AP`: Enables access point support. .. note:: The SoftAP mode operation is dictated by regulatory requirements. It is mandatory to set the regulatory domain to a specific country when operating in the 5 GHz frequency band. You can set the regulatory domain using the below configuration option: * :kconfig:option:`CONFIG_SOFTAP_SAMPLE_REG_DOMAIN`: Sets the ISO/IEC alpha2 country code. For more information, see the :ref:`nRF70_soft_ap_mode` documentation. Configuration ************* |config| Configuration options ===================== The following Kconfig options are used in this sample (located in :file:`samples/wifi/softap/Kconfig`): .. options-from-kconfig:: IP addressing ************* The sample starts the DHCP server on the SoftAP interface. The station devices should use DHCP to get an IP address from the virtual router. To specify the DHCP pool start address, you can edit the :kconfig:option:`CONFIG_SOFTAP_SAMPLE_DHCPV4_POOL_START` Kconfig option in the :file:`prj.conf` file. Building and running ******************** .. |sample path| replace:: :file:`samples/wifi/softap` .. include:: /includes/build_and_run_ns.txt To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following is an example of the CLI command: .. code-block:: console west build -b nrf7002dk/nrf5340/cpuapp To build for the nRF7002 EK with nRF5340 DK, use the ``nrf5340dk/nrf5340/cpuapp`` build target with the ``SHIELD`` CMake option set to ``nrf7002ek``. Testing ======= |test_sample| #. |connect_kit| #. |connect_terminal| The sample shows the following output: .. code-block:: console *** Booting nRF Connect SDK v3.4.99-ncs1-4797-g7c3e830729b7 *** [00:00:00.580,596] net_config: Initializing network [00:00:00.580,596] net_config: Waiting interface 1 (0x200014e4) to be up... [00:00:00.580,718] net_config: IPv4 address: 192.168.1.1 [00:00:00.581,268] wpa_supp: Successfully initialized wpa_supplicant [00:00:00.582,122] softap: Regulatory domain set to IN [00:00:00.602,508] softap: DHCPv4 server started and pool address start from 192.168.1.2 [00:00:01.250,000] wpa_supp: wlan0: interface state UNINITIALIZED->ENABLED [00:00:01.250,061] wpa_supp: wlan0: AP-ENABLED [00:00:01.250,335] wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to nn:oo:rr:dd:ii:cc completed [id=0 id_str=] [00:00:01.254,608] softap: AP enable requested [00:00:01.256,225] softap: AP mode enabled [00:00:01.257,873] softap: Status: successful [00:00:01.257,904] softap: ================== [00:00:01.257,904] softap: State: COMPLETED [00:00:01.257,934] softap: Interface Mode: ACCESS POINT [00:00:01.257,965] softap: Link Mode: UNKNOWN [00:00:01.257,995] softap: SSID: MySoftAP [00:00:01.258,026] softap: BSSID: NN:OO:RR:DD:II:CC [00:00:01.258,026] softap: Band: 2.4GHz [00:00:01.258,056] softap: Channel: 6 [00:00:01.258,056] softap: Security: OPEN [00:00:01.258,087] softap: MFP: Disable [00:00:01.258,087] softap: Beacon Interval: 100 [00:00:01.258,087] softap: DTIM: 2 [00:00:01.258,117] softap: TWT: Not supported [00:00:01.341,674] net_config: IPv6 address: fe80::f6ce:36ff:fe00:10d4 [00:00:15.270,446] wpa_supp: HT: Forty MHz Intolerant is set by STA aa:bb:cc:dd:ee:ff in Association Request [00:00:15.286,376] wpa_supp: wlan0: AP-STA-CONNECTED aa:bb:cc:dd:ee:ff [00:00:15.286,529] softap: Station connected: AA:BB:CC:DD:EE:FF [00:00:15.286,529] softap: AP stations: [00:00:15.286,529] softap: ============ [00:00:15.286,560] softap: Station 1: [00:00:15.286,560] softap: ========== [00:00:15.286,590] softap: MAC: AA:BB:CC:DD:EE:FF [00:00:15.286,590] softap: Link mode: WIFI 4 (802.11n/HT) [00:00:15.286,621] softap: TWT: Not supported Dependencies ************ This sample uses the following |NCS| library: * :ref:`nrf_security`