softap
功能概述
本例演示如何使用 Wi-Fi 的 softap 功能。
环境要求
在 menuconfig 中配置 WiFi SSID 和 WiFi Password
如果有需要,可在 menuconfig 中配置 AP 的信道 WiFi Channel 和最大 station 连接数 Maximal STA connections
编译和烧录
示例位置:examples/wifi/softap
编译、烧录等操作请参考:快速入门
运行结果
成功运行将输出如下日志
D/main [0.002] boot reason 0
D/main [0.004] heap size 270792(264.45KB)
D/fls [0.010] flash size 0x200000(2MB)
D/ptb [0.014] partition table base 0x800e000
D/ft [0.020] ft_0 base 8000000, ft_1 base 8001000
D/ft [0.026] ft init too
D/ft [0.030] ft init error
E/nvs [0.034] use new hash entry num=53
I/ota_http [0.040] 0.3.0 build at Jun 13 2024 10:44:06
I/wifi softap [0.046] WM_WIFI_MODE_AP
D/wifi [2.278] distribution event 5
D/wifi [2.282] softap started
I/wifi softap [2.290] wifi_init_softap finished. SSID:test-WiFi password:11111111 channel:1
I/wifi softap [29.530] station 7E-B1-7B-28-F3-55 join, AID=1
D/wifi [29.536] distribution event 7
D/wifi [29.540] sta 7E-B1-7B-28-F3-55 aid 1 joined softap
D/dhcps [29.918] ClientMacAddr=7E-B1-7B-28-F3-55, MsgType=1, ReqIpAddr=0.0.0.0, ServerIp=0.0.0.0
D/dhcps [29.930] sent dhcp offer, ClientMacAddr=7E-B1-7B-28-F3-55, GivenIpAddr=192.168.10.2, ServerIp=192.168.10.1
D/dhcps [29.948] ClientMacAddr=7E-B1-7B-28-F3-55, MsgType=3, ReqIpAddr=192.168.10.2, ServerIp=192.168.10.1
D/dhcps [29.960] sent dhcp ack, ClientMacAddr=7E-B1-7B-28-F3-55, GivenIpAddr=192.168.10.2, ServerIp=192.168.10.1
D/wifi [29.974] distribution event 4
D/wifi [29.978] sta 7E-B1-7B-28-F3-55 assigned ip 192.168.10.2