esp32c3唤醒深度睡眠之后,如何连接WiFi?

fst202130609
Posts: 171
Joined: Thu Sep 23, 2021 10:03 am

esp32c3唤醒深度睡眠之后,如何连接WiFi?

Postby fst202130609 » Fri Feb 11, 2022 1:28 am

我使用GPIO2来唤醒深度睡眠,唤醒之后使用wifi_init_sta()函数想连接WiFi,发现一直复位,如何解决这个问题?
switch (esp_sleep_get_wakeup_cause()) {
case ESP_SLEEP_WAKEUP_GPIO: {
uint64_t wakeup_pin_mask = esp_sleep_get_gpio_wakeup_status();
if (wakeup_pin_mask != 0) {
int pin = __builtin_ffsll(wakeup_pin_mask) - 1;
printf("Wake up from GPIO %d\n", pin);

wifi_init_sta();
} else {
printf("Wake up from GPIO\n");
}
break;
}

ESP_ICY
Posts: 404
Joined: Mon Aug 23, 2021 11:10 am

Re: esp32c3唤醒深度睡眠之后,如何连接WiFi?

Postby ESP_ICY » Fri Feb 11, 2022 7:20 am

一直复位的 LOG 信息是什么样子的

fst202130609
Posts: 171
Joined: Thu Sep 23, 2021 10:03 am

Re: esp32c3唤醒深度睡眠之后,如何连接WiFi?

Postby fst202130609 » Tue Feb 15, 2022 2:45 am

ESP_ICY wrote:
Fri Feb 11, 2022 7:20 am
一直复位的 LOG 信息是什么样子的
已经解决连接WiFi的事情了,但连接成功WiFi之后无法连接aws的任务,程序一直复位,报错的日志为:

rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x1730
load:0x403ce000,len:0x8d4
load:0x403d0000,len:0x293c
entry 0x403ce000
[0;32mI (30) boot: ESP-IDF v4.3-dirty 2nd stage bootloader[0m
[0;32mI (30) boot: compile time 10:02:26[0m
[0;32mI (30) boot: chip revision: 3[0m
[0;32mI (32) boot.esp32c3: SPI Speed : 80MHz[0m
[0;32mI (37) boot.esp32c3: SPI Mode : DIO[0m
[0;32mI (42) boot.esp32c3: SPI Flash Size : 2MB[0m
[0;32mI (46) boot: Enabling RNG early entropy source...[0m
[0;32mI (52) boot: Partition Table:[0m
[0;32mI (55) boot: ## Label Usage Type ST Offset Length[0m
[0;32mI (63) boot: 0 nvs WiFi data 01 02 00009000 00006000[0m
[0;32mI (70) boot: 1 phy_init RF data 01 01 0000f000 00001000[0m
[0;32mI (78) boot: 2 factory factory app 00 00 00010000 00100000[0m
[0;32mI (85) boot: End of partition table[0m
[0;32mI (89) esp_image: segment 0: paddr=00010020 vaddr=3c0b0020 size=1d1f8h (119288) map[0m
[0;32mI (116) esp_image: segment 1: paddr=0002d220 vaddr=3fc8e400 size=02df8h ( 11768) load[0m
[0;32mI (119) esp_image: segment 2: paddr=00030020 vaddr=42000020 size=a88e8h (690408) map[0m
[0;32mI (230) esp_image: segment 3: paddr=000d8910 vaddr=3fc911f8 size=00750h ( 1872) load[0m
[0;32mI (231) esp_image: segment 4: paddr=000d9068 vaddr=40380000 size=0e358h ( 58200) load[0m
[0;31mE (246) esp_image: invalid segment length 0x10050263[0m
[0;31mE (246) boot: Factory app partition is not bootable[0m
[0;31mE (247) boot: No bootable app partitions in the partition table[0m
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xc (SPI_FAST_FLASH_BOOT)

Who is online

Users browsing this forum: No registered users and 78 guests