01 Overview
Runs HTTP on a connected device. Fits LAN config pages.
- Use when: engineer debug, local switches, provisioning portal.
- Skip when: public internet without auth/TLS.
Reach a server
Serve a page on the device to change settings. Common for small-batch debug.
Official path: examples/protocols/http_server/simple
Runs HTTP on a connected device. Fits LAN config pages.
1. Wait for an IP.
2. Start esp_http_server and register URI handlers.
3. Official demo returns simple text/HTML. Products add forms and auth.
4. Persist settings in NVS, not only RAM.
中文
连上服务器
设备开网页改参数。小批量调试和本地控制常用。
官方路径: examples/protocols/http_server/simple
在已联网的设备上开 HTTP 服务。适合局域网配置页。
1. 先拿到 IP。
2. 启动 esp_http_server,注册 URI 处理。
3. 官方返回简单文本/HTML。产品要加表单、鉴权、CSRF 意识。
4. 量产参数应写入 NVS,而不是只改内存。