我将 IDF V5 与 vs code 和 esp Wroom 32 一起使用。
我尝试通过 BT 和 android ESP BLE Prov 应用程序实现 wifi 配置。
在 esp 方面,我永远不会退出 wifi_prov_mgr_wait() 函数。
在 android 应用程序端,在 手机屏幕上:
- 发送 WI-FI 凭据 => 确定
- 应用 WI-FI 连接 => 确定
- 检查配置状态 => 屏幕上的微调器,永远旋转
有人可以告诉我什么'我做错了/失踪了吗?
我把代码和终端输出放在下面。
非常感谢
esp_err_t wifi错误;
esp_err_t wifiInit()
{
wifi_init_config_t wifiConfig = WIFI_INIT_CONFIG_DEFAULT();
如果((wifiError=nvs_flash_init()))
返回wifiError;
如果((wifiError=esp_wifi_init(&wifiConfig)))
返回wifiError;
如果((wifiError=esp_wifi_set_mode(WIFI_MODE_STA)))
返回wifiError;
esp_wifi_start();
返回 0;
}
void wifiProv(void)
{
const char *service_name = "cb_boiler";
const char *service_key = "";
wifi_prov_security_t 安全 = WIFI_PROV_SECURITY_1;
const char *pop = "8888";
wifi_prov_mgr_config_t 配置 =
{
.scheme = wifi_prov_scheme_ble,
.scheme_event_handler = WIFI_PROV_SCHEME_BLE_EVENT_HANDLER_FREE_BTDM
};
ESP_ERROR_CHECK(wifi_prov_mgr_init(config));
ESP_ERROR_CHECK(wifi_prov_mgr_start_provisioning(security, pop, service_name, service_key) );
wifi_prov_mgr_wait();
wifi_prov_mgr_deinit();
}
rst:0x1(POWERON_RESET),boot:0x13(SPI_FAST_FLASH_BOOT)
configsip:0,SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
模式:DIO,时钟div: 2
load:0x3fff0030,len:6940
ho 0 tail 12 room 4
load:0x40078000,len:15500
load:0x40080400,len:3844
0x40080400: _init at ??:?
条目 0x4008064c
I (29) 引导:ESP-IDF v5.0.1 第二阶段引导加载程序
I (29) 引导:编译时间 22:22:26
I (29) 引导:芯片修订版:v3.0
I (32) boot.esp32: SPI 速度:40MHz
I (37) boot.esp32: SPI 模式:DIO
I (41) boot.esp32: SPI 闪存大小:4MB
I (46) 引导:启用 RNG 早期熵源...
I (51) boot: Partition Table:
I (55) boot: ## Label Usage Type ST Offset Length
I (62) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (70) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (77) boot: 2 factory factory app 00 00 00010000 00177000
I (85) boot: End of partition table I
(89) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=3a7a8h (239528) map
I (184) ) esp_image: 段 1: paddr=0004a7d0 vaddr=3ffbdb60 size=0553ch ( 21820) 加载
I (193) esp_image: 段 2: paddr=0004fd14 vaddr=40080000 size=00304h ( 772) 加载
I (193) esp_image: 段 3: paddr=00050020 vaddr=400d0020 size=d4df8h (871928) 地图
I (515) esp_image: segment 4: paddr=00124e20 vaddr=40080304 size=1f044h (127044) load
I (583) boot: 从偏移量为 0x10000 的分区加载应用程序 I
(583) boot: 禁用 RNG 早期熵源...
I (595) cpu_start:Pro CPU 启动。
I (595) cpu_start: Starting app cpu, 入口点是 0x40081488
0x40081488: call_start_cpu1 at C:/Users/thier/esp/esp-idf/components/esp_system/port/cpu_start.c:142
I (0) cpu_start: App cpu向上。
I (611) cpu_start: Pro cpu start 用户代码
I (611) cpu_start: cpu freq: 160000000 Hz
I (612) cpu_start: 应用信息:
I (616) cpu_start: 项目名称:myTests2
I (621) cpu_start: App version: 1个
I (626) cpu_start: 编译时间: Mar 7 2023 11:09:36
I (632) cpu_start: ELF file SHA256: 60eaf2270d1522b2...
I (638) cpu_start: ESP-IDF: v5.0.1
I (643) cpu_start:最小芯片转速:v0.0
I (647) cpu_start:最大芯片转速:v3.99
I (652) cpu_start:芯片转速:v3.0
I (657) heap_init:正在初始化。可用于动态分配的 RAM:
I (664) heap_init:在 3FFAFF10 len 000000F0 (0 KiB):DRAM
I (670) heap_init:在 3FFB6388 len 00001C78 (7 KiB):DRAM
I (676) heap_init:在 3FFB9A20 len 00004108 (16) KiB):DRAM
I (682) heap_init:在 3FFCB1A8 len 00014E58 (83 KiB):DRAM
I (689) heap_init:在 3FFE0440 len 00003AE0 (14 KiB):D/IRAM
I(695)heap_init:在 3FFE4350 len 0001BCB0(111 KiB):D/IRAM
I(701)heap_init:在 4009F348 len 00000CB8(3 KiB):IRAM
I(709)spi_flash:检测到芯片:通用
I(712)spi_flash: flash io: dio
I (718) cpu_start: 在 PRO CPU 上启动调度程序。
I (0) cpu_start:在 APP CPU 上启动调度程序。
我 (728) gpio: GPIO[33]| 输入En:0| 输出En:0| 开漏:0| 上拉:1| 下拉:0| Intr:0
I (788) SSD1306: OLED 配置成功
I (918) wifi:wifi 驱动任务: 3ffcdc78, prio:23, stack:6656, core=0
I (918) system_api: Base MAC address is not set
I (918 ) system_api: 从 EFUSE
I (938) wifi:wifi firmware version: 17afb16读取默认基 MAC 地址
I (938) wifi:wifi 认证版本:v7.0
I (938) wifi:config NVS flash: enabled
I (938) wifi:config nano formating: disabled
I (938) wifi:Init data frame dynamic rx buffer num: 32
I (948) wifi:Init management frame dynamic rx buffer num: 32
I (948) wifi:Init management short buffer num: 32
I (958) wifi:Init dynamic tx buffer num: 32
我 (958) wifi:Init static rx缓冲区大小:1600
I (958) wifi:Init static rx buffer num: 10
I (968) wifi:Init dynamic rx buffer num: 32
I (968) wifi_init: rx ba win: 6
I (978) wifi_init: tcpip mbox: 32
I (978) wifi_init: udp mbox: 6
I (978) wifi_init: tcp mbox: 6
I (988) wifi_init: tcp tx win: 5744
I (988) wifi_init: tcp rx win: 5744
I (998) wifi_init: tcp mss: 1440
I (998) wifi_init: WiFi IRAM OP 启用
I (998) wifi_init: WiFi RX IRAM OP 启用
I (1008) phy_init: phy_version 4670 ,719f9f6,Feb 18 2021,17:07:07
I (1118) wifi:mode : sta (70:b8:f6:5c:db:88)
I (1118) wifi:enable tsf
I (1948) wifi_prov_scheme_ble: BT 内存发布
I (1948) BTDM_INIT:BT 控制器编译版本 [60aae55]
I (2338) wifi_prov_mgr:配置以服务名称开始:cube_boiler
I (43508) wifi <2,0>, old:<1,0>, ap:<255,255 >, sta:<2,0>, 教授:1
I (44288) wifi:state: init -> auth (b0)
I (44328) wifi:state: auth -> assoc (0)
I (44368) wifi:state : 关联 ->奔跑 (10)
I (44508) wifi:connected with MaBoiteLibre2, aid = 7, channel 2, BW20, bssid = 50:64:2b:e6:15:9e I (44508) wifi:security: WPA2-PSK, phy: bgn, rssi
: -62
I (44528) wifi:pm start, type: 1
I (44548) wifi:AP's beacon interval = 102400 us, DTIM period = 1
0
|
|
|
|