Web Server AT Commands

[中文]

  • AT+WEBSERVER: Enable/disable Wi-Fi connection configuration via Web server.

AT+WEBSERVER: Enable/disable Wi-Fi connection configuration via Web server

Set Command

Command:

AT+WEBSERVER=<enable>,<server_port>,<connection_timeout>

Response:

OK

Parameters

  • <enable>: Enable or disable Web server.

    • 0: Disable the Web server and release related resources.

    • 1: Enable Web server, which means that you can use WeChat or a browser to configure Wi-Fi connection information.

  • <server_port>: The Web server port number.

  • <connection_timeout>: The timeout for the every connection. Unit: second. Range:[21,60].

Notes

  • There are two ways to provide the HTML files needed by the Web server. One is to use FAT file system, and you need to enable AT FS command at this time. The other one is to use embedded files to store HTML files (default setting).

  • Please make sure that the maximum number of open sockets is not less than 12, you may change the number by ./build.py menuconfig > Component config > LWIP > Max bumber of open sockets and compile the project (see Compile ESP-AT Project).

  • The default firmware does not support Web server AT commands (see ESP-AT Firmware Differences), but you can enable it by ./build.py menuconfig > Component config > AT > AT WEB Server command support and compile the project (see Compile ESP-AT Project).

  • ESP-AT supports captive portals in ESP32 and ESP32-C series of devices. See example.

  • For more examples, please refer to Web Server AT Example.

  • The command implementation is open-source. See the source code in at/src/at_web_server_cmd.c.

  • Please refer to How to Implement OTA Upgrade for more OTA commands.

Example

// Enable the Web server with port 80, and the timeout for the every connection is 50 seconds
AT+WEBSERVER=1,80,50

// Disable the Web server
AT+WEBSERVER=0