1.15 WLAN AP

This example application shows how to use the PIC32MZW1 WLAN APIs to configure the device in AP mode directly using the WLAN driver APIs.

Description

This application shows the various commands to be used for AP mode of PIC32MZW1 device. The user can use these commands in configuring the device as AP, start or stop the device as AP, scan operations etc.

Downloading and building the application

To download or clone this application from Github, go to the top level of the repository and click

clone

Path of the application within the repository is apps/wifi_ap/firmware .

To build the application, refer to the following table and open the project using its IDE.

Project NameDescription
pic32mz_w1_curiosity_driver.XMPLABX project for PIC32MZ W1 Curiosity Board

Configuring the Application

Setting up a regulatory region

The available regulatory domains are - GEN, USA, EMEA, CUST1 and CUST2. One of these regulatory domains must be selected as an active domain. This selection can be done in two ways.

Using MHC

Figure below shows how to set the regulatory domain in MHC and the path is: TCPIP & SYS_CONSOLE -> TCP/IP STACK -> BASIC CONFIGURATION -> PIC32MZW1

mhc_regulatory

Using command

wlan set regdomain <reg_domain_name> is the command used to set the regulatory domain. (wlan set regdomain USA – sets the regulatory domain to USA).

Note: User can change the regulatory domain using this command only if the current setting is "None" (cofigured using MHC)

Setting up the hardware

The following table shows the target hardware for the application projects.

Project NameBoard
pic32mz_w1_curiosity_driver.XPIC32MZ W1 Curiosity Board

Setting up PIC32MZ W1 Curiosity Board

  • Connect the Debug USB port on the board to the computer using a micro USB cable

  • On the GPIO Header (J207), connect U1RX (PIN 13) and U1TX (PIN 23) to TX and RX pin of any USB to UART converter like USB UART click respectively

Running the Application

1.Open the Terminal application (Ex.:Tera term) on the computer

2.Connect to the "USB to UART" COM port and configure the serial settings as follows:

- Baud : 115200
- Data : 8 Bits
- Parity : None
- Stop : 1 Bit
- Flow Control : None

3.Build and Program the application project using its IDE

4.Console displays the initialization messages and WLAN config if already saved in NVM

output

Supported Commands

CommandDescription
wlan config <ssid> <ssid_length> <ssid_visible> <channel> <open/wpa2/wpam/wpa3/wpa3m/wep> <password>Configures the SSID, SSID length, SSID visibility, channel number and the security of the AP that DUT wants to connect. NOTE: Valid channel numbers are in range 1-13
wlan ap startStart the AP
wlan ap stopStop the AP
wlan show devicesThe connected devices are shown – MAC and IP addresses are displayed
wlan scan <active / passive> <channel>Runs either a active or passive scan (as per the input) on the channel number specified
wlan save configStores the WLAN configurations given in command “wlan config” to flash memory. On restart DUT is started as AP with the credentials stored in flash.
wlan set regdomain <reg_domain_name>Sets the regulatory domain
wlan get regdomain <all / current>Displays the regulatory domain all – request all regulatory domains; current - request current regulatory domain