准备先使用例程先测试一下再移植该例程,wifi连接上后,http连接失败,打印信息如下:
Code: Select all
I (880) wifi:mode : sta (7c:9e:bd:39:0d:7c)
I (880) wifi:enable tsf
I (890) example_connect: Waiting for IP(s)
I (2940) wifi:new:<6,2>, old:<1,0>, ap:<255,255>, sta:<6,2>, prof:1
I (3670) wifi:state: init -> auth (b0)
I (3690) wifi:state: auth -> assoc (0)
I (3720) wifi:state: assoc -> run (10)
I (3730) wifi:connected with E880-IR01, aid = 3, channel 6, 40D, bssid = 54:75:95:2d:6c:26
I (3730) wifi:security: WPA2-PSK, phy: bgn, rssi: -45
I (3730) wifi:pm start, type: 1
W (3750) wifi:<ba-add>idx:0 (ifx:0, 54:75:95:2d:6c:26), tid:0, ssn:0, winSize:64
I (3800) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (4670) esp_netif_handlers: example_connect: sta ip: 192.168.1.192, mask: 255.255.255.0, gw: 192.168.1.1
I (4670) example_connect: Got IPv4 event: Interface "example_connect: sta" address: 192.168.1.192
I (5670) example_connect: Got IPv6 event: Interface "example_connect: sta" address: fe80:0000:0000:0000:7e9e:bdff:fe39:0d7c, type: ESP_IP6_ADDR_IS_LINK_LOCAL
I (5670) example_connect: Connected to example_connect: sta
I (5680) example_connect: - IPv4 address: 192.168.1.192
I (5680) example_connect: - IPv6 address: fe80:0000:0000:0000:7e9e:bdff:fe39:0d7c, type: ESP_IP6_ADDR_IS_LINK_LOCAL
I (5690) wifi:Set ps type: 0
E (6060) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x2700
I (6070) esp-tls-mbedtls: Failed to verify peer certificate!
E (6070) esp-tls: Failed to open new connection
E (6070) TRANSPORT_BASE: Failed to open a new connection
E (6080) HTTP_CLIENT: Connection failed, sock < 0
E (6080) esp_https_ota: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT
E (6090) esp_https_ota: Failed to establish HTTP connection
E (6100) simple_ota_example: Firmware upgrade failed