MCUXpresso_MIMXRT1052xxxxB/boards/evkbimxrt1050/wifi_examples/wifi_webconfig
Yilin Sun 6baf4427ce
Updated to v2.15.000
Signed-off-by: Yilin Sun <imi415@imi.moe>
2024-03-18 23:15:10 +08:00
..
armgcc Updated to v2.15.000 2024-03-18 23:15:10 +08:00
mcux/linkscripts Updated to v2.14.0 2023-11-30 20:55:00 +08:00
webui Updated to v2.14.0 2023-11-30 20:55:00 +08:00
FreeRTOSConfig.h SDK v2.11.1 2022-04-08 22:46:35 +08:00
app_config.h Updated to v2.15.000 2024-03-18 23:15:10 +08:00
board.c Updated to v2.15.000 2024-03-18 23:15:10 +08:00
board.h Updated to v2.15.000 2024-03-18 23:15:10 +08:00
clock_config.c Update SDK to v2.13.0 2023-01-26 09:35:56 +08:00
clock_config.h Update SDK to v2.13.0 2023-01-26 09:35:56 +08:00
cred_flash_storage.c Updated to v2.14.0 2023-11-30 20:55:00 +08:00
cred_flash_storage.h Updated to v2.14.0 2023-11-30 20:55:00 +08:00
dcd.c SDK v2.11.1 2022-04-08 22:46:35 +08:00
dcd.h SDK v2.11.1 2022-04-08 22:46:35 +08:00
http_server.c SDK v2.11.1 2022-04-08 22:46:35 +08:00
http_server.h SDK v2.11.1 2022-04-08 22:46:35 +08:00
httpsrv_fs_data.c Updated to v2.14.0 2023-11-30 20:55:00 +08:00
lwipopts.h Updated to v2.15.000 2024-03-18 23:15:10 +08:00
lwippools.h SDK v2.11.1 2022-04-08 22:46:35 +08:00
pin_mux.c SDK v2.11.1 2022-04-08 22:46:35 +08:00
pin_mux.h SDK v2.11.1 2022-04-08 22:46:35 +08:00
readme.md Updated to v2.15.000 2024-03-18 23:15:10 +08:00
readme_modules.txt Updated to v2.15.000 2024-03-18 23:15:10 +08:00
sdmmc_config.c Updated to v2.12.0 2022-08-24 23:30:23 +08:00
sdmmc_config.h Updated to v2.14.0 2023-11-30 20:55:00 +08:00
webconfig.c Updated to v2.14.0 2023-11-30 20:55:00 +08:00
webconfig.h Updated to v2.14.0 2023-11-30 20:55:00 +08:00
wifi_bt_config.c SDK v2.11.1 2022-04-08 22:46:35 +08:00
wifi_bt_config.h SDK v2.11.1 2022-04-08 22:46:35 +08:00
wifi_config.h Updated to v2.15.000 2024-03-18 23:15:10 +08:00
wifi_webconfig_v3_14.xml Updated to v2.15.000 2024-03-18 23:15:10 +08:00

readme.md

Overview

This demo implements a simple web based Wi-Fi configuration utility for connecting the board to the local Wireless network.

Initially, the board doesn't have the credentials to join the local network, so it starts its own Access Point with SSID: "nxp_configuration_access_point" and password: "NXP0123456789".

The user can connect their device to this SSID and access the HTML UI under 192.168.1.1. The board will scan for the nearby Wi-Fi networks and display a list of them on this page. By clicking on the entries, the user can choose their network, enter the credentials and connect. The board will attempt to join this Wi-Fi network as a client and if it succeeds, it will disconnect its AP and save the credentials to its mflash memory.

On successive restarts, it checks the mflash memory and uses the saved credentials to directly connect to the local Wi-Fi network without starting the AP.

A simple LED visualization is implemented. The board LED will be on if the device is in AP mode and turns off after the board changes to client mode.

The site allows the user to clear the credentials from the flash memory and reset the board to AP mode. If connection fails, user can also set device to AP mode through serial connection.

The source files for the web interface are located in the webui directory. Use the <path_to_sdk>/middleware/lwip/src/apps/httpsrv/mkfs/mkfs.pl webui Perl script in order to convert the webui files into the httpsrv_fs_data.c which is used in order to flash the static files onto the board. Make sure the mkfsl.pl script is executed from the same directory where the file httpsrv_fs_data.c and the directory webui are.

Note that Microsoft Internet Explorer is not supported by this webconfig example.

Before building the example application select Wi-Fi module macro in the app_config.h. (see #define WIFI_BOARD). For more information about Wi-Fi module connection see: readme_modules.txt Getting started guide on supported modules configuration: https://www.nxp.com/document/guide/getting-started-with-nxp-wi-fi-modules-using-i-mx-rt-platform:GS-WIFI-MODULES-IMXRT-PLATFORM

SDK version

  • Version: 2.15.000

Toolchain supported

  • IAR embedded Workbench 9.40.1
  • Keil MDK 5.38.1
  • GCC ARM Embedded 12.2
  • MCUXpresso 11.8.0

Hardware requirements

  • Micro USB cable
  • evkbimxrt1050 board
  • Personal Computer

Board settings

Prepare the Demo

  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port on the board
  2. Open a serial terminal with the following settings:
    • 115200 baud rate
    • 8 data bits
    • No parity
    • One stop bit
    • No flow control
  3. Connect the WiFi module to SD card slot or M.2 slot.
  4. Download the program to the target board.
  5. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

  1. When the demo starts, basic initialization proceeds
  2. After that, device will wait for connection and configuration:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Starting webconfig DEMO [i] Trying to load data from mflash. [i] Nothing stored yet [i] Initializing Wi-Fi connection... MAC Address: 9C:50:D1:44:67:5F [i] Successfully initialized Wi-Fi module Starting Access Point: SSID: nxp_configuration_access_point, Chnl: 1 [wlcm] Warn: NOTE: uAP will automatically switch to the channel that station is on. Now join that network on your device and connect to this IP: 192.168.1.1 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. Connect to the access point and in your web browser enter 192.168.1.1
  2. Wait for the scan to finish - the demo terminal will print something like:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Initiating scan...

nxptp BSSID : B0:A7:B9:99:27:52 RSSI : -34dBm Channel : 3 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. In your web browser you should also see the scan results, click on the network you want to add, fill in the credentials and click connect.
  2. After you send credentials, device will try connecting to the AP and if successful saves the credentials to the mflash.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [i] Chosen ssid: nxptp [i] Chosen passphrase: "NXP01234" [i] Chosen security methods: "WPA2 WPA3_SAE" [i] Joining: nxptp [i] Successfully joined: nxptp Now join that network on your device and connect to this IP: 192.168.0.209 [i] mflash_save_file success [i] Stopping AP! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. The device is now in station mode and is joined to the selected network. Now join this network on your PC and enter the IP from demo terminal.
  2. You can try to join different networks or reset the board back to AP mode and start again.