WEB Server
Overview
This example demonstrates how to use the features of the WEB server, including AUTH, CGI, ASP, SSI, INDEX, ALIAS, Upload, and more.
When the device is connected to the network in Station mode, the PC browser can input the device IP to access the WEB page, and the default port is 80.
File description
file path | notes |
---|---|
main/src/main.c | Synthesis example code |
main/src/wn_sample_upload.c | Sample file upload code |
main/file/index.html | Comprehensive example page |
main/file/index.shtml | SSI feature example page |
main/file/version.asp | ASP feature example page |
Requirements
A working AP is required.
Configure WiFi SSID and WiFi Password in menuconfig.
A PC or handheld device is required.
Building and flashing
Example Location: examples/network/webnet
compile, burn, and more, see: get started
Running result
Successfully running will output the following logs
I/wm_nm_core [5.434] got ip: 192.168.3.208
D/wm_nm_core [5.440] WM_NM_EV post event 4 success
I/examples_webnet [5.946] wifi station start success, network is ready!
D/webnet [5.954] Create socket success.
D/webnet [5.960] webnet_module_handle_event WEBNET_EVENT_INIT
I/examples_webnet [133.442] Upload FileName: cmake.txt
I/examples_webnet [133.446] Content-Type : text/plain
I/examples_webnet [133.452] save to: cmake.txt
I/examples_webnet [133.460] write: length 3957
I/examples_webnet [133.468] write: length 3931
I/examples_webnet [133.474] Upload FileSize: 7888