完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
IDF版本V4.3.1(事实上V4.3.4也一样的),现象:1,使用TCP或UDP通讯时,接收数据很慢,最长延时1s,有时候又很快,感觉刚好卡在某个时间点就快。2,数据量很小,几个字节。3,发送几乎没有延时。4,使用网络ping,平均4ms。有几点需要说明:1,我的代码是在esp32 d0wd v3一直量产使用的,没有这个问题。2,更换使用v4.3.1examplesprotocolssocketstcp_server例程,也是同样问题。3,硬件使用自己设计主板,芯片ESP32-C3,和NodeMCU ESP-C3-13/13U-Kit(板载安信可ESP-C3-13,芯片C3FN4),两个硬件平台上,均表现一致。
以下为tcp server例程启动: ESP-ROM:esp32c3-api1-20210207 Build:Feb 7 2021 rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT) SPIWP:0xee mode:DIO, clock div:1 load:0x3fcd6100,len:0x1778 load:0x403ce000,len:0x8dc load:0x403d0000,len:0x2984 entry 0x403ce000 [0;32mI (30) boot: ESP-IDF v4.3.1-dirty 2nd stage bootloader[0m [0;32mI (30) boot: compile time 09:20:54[0m [0;32mI (30) boot: chip revision: 3[0m [0;32mI (33) 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 (47) boot: Enabling RNG early entropy source...[0m [0;32mI (52) boot: Partition Table:[0m [0;32mI (56) 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: En d of partition table[0m [0;32mI (89) esp_image: segment 0: paddr=00010020 vaddr=3c080020 size=140c0h ( 82112) map[0m [0;32mI (110) esp_image: segment 1: paddr=000240e8 vaddr=3fc8dc00 size=03140h ( 12608) load[0m [0;32mI (113) esp_image: segment 2: paddr=00027230 vaddr=40380000 size=08de8h ( 36328) load[0m [0;32mI (123) esp_image: segment 3: paddr=00030020 vaddr=42000020 size=7ac68h (502888) map[0m [0;32mI (200) esp_image: segment 4: paddr=000aac90 vaddr=40388de8 size=04c18h ( 19480) load[0m [0;32mI (204) esp_image: segment 5: paddr=000af8b0 vaddr=50000000 size=00010h ( 16) load[0m [0;32mI (210) boot: Loaded app from partition at offset 0x10000[0m [0;32mI (212) boot: Disabling RNG early entropy source...[0m [0;32mI (228) cpu_start: Pro cpu up.[0m [0;32mI (241) cpu_start: Pro cpu start user code[0m [0;32mI (241) cpu_start: cpu freq: 160000000[0m [0;32mI (241) cpu_start: Application information:[0m [0;32mI (244) cpu_start: Project name: tcp_server[0m [0;32mI (249) cpu_start: App version: 1[0m [0;32mI (253) cpu_start: Compile time: Jan 18 2023 12:22:31[0m [0;32mI (259) cpu_start: ELF file SHA256: 2b4dfc118119d540...[0m [0;32mI (265) cpu_start: ESP-IDF: v4.3.1-dirty[0m [0;32mI (271) heap_init: Initializing. RAM available for dynamic allocation:[0m [0;32mI (278) heap_init: At 3FC94DC0 len 0002B240 (172 KiB): DRAM[0m [0;32mI (284) heap_in it: At 3FCC0000 len 0001F060 (124 KiB): STACK/DRAM[0m [0;32mI (291) heap_init: At 50000010 len 00001FF0 (7 KiB): RTCRAM[0m [0;32mI (298) spi_flash: detected chip: generic[0m [0;32mI (302) spi_flash: flash io: dio[0m [0;33mW (306) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.[0m [0;32mI (319) sleep: Configure to isolate all GPIO pins in sleep state[0m [0;32mI (326) sleep: Enable automatic switching of GPIO sleep configuration[0m [0;32mI (333) cpu_start: Starting scheduler.[0m [0;32mI (341) pp: pp rom version: 9387209[0m [0;32mI (341) net80211: net80211 rom version: 9387209[0m I (351) wifi:wifi driver task: 3fc9e024, prio:23, stack:6656, core=0 [0;32mI (351) system_api: Base MAC address is not set[0m [0;32mI (361) system_api: read default base MAC address from EFUSE[0m I (361) wifi:wifi firmware version: 88c8747 I (371) wifi:wifi certification version: v7.0 I (371) wifi:config NVS flash: en abled I (371) wifi:config nano formating: disabled I (381) wifi:Init data frame dynamic rx buffer num: 32 I (381) wifi:Init management frame dynamic rx buffer num: 32 I (391) wifi:Init management short buffer num: 32 I (391) wifi:Init dynamic tx buffer num: 32 I (401) wifi:Init static tx FG buffer num: 2 I (401) wifi:Init static rx buffer size: 1600 I (401) wifi:Init static rx buffer num: 10 I (411) wifi:Init dynamic rx buffer num: 32 [0;32mI (411) wifi_init: rx ba win: 6[0m [0;32mI (421) wifi_init: tcpip mbox: 32[0m [0;32mI (421) wifi_init: udp mbox: 6[0m [0;32mI (421) wifi_init: tcp mbox: 6[0m [0;32mI (431) wifi_init: tcp tx win: 5744[0m [0;32mI (431) wifi_init: tcp rx win: 5744[0m [0;32mI (441) wifi_init: tcp mss: 1440[0m [0;32mI (441) wifi_init: WiFi IRAM OP enabled[0m [0;32mI (441) wifi_init: WiFi RX IRAM OP enabled[0m [0;32mI (451) example_connect: Connecting to qixin...[0m [0;32mI (451) phy_init: phy_version 500,985899c,Apr 19 2021,16:05:08[0m I (591) wifi:set rx active PTI: 0, rx ack PTI: 0, and default PTI: 0 I (591) wifi:mode : sta (84:f7:03:3a:6e:fc) I (591) wifi:enable tsf [0;32mI (591) example_connect: Waiting for IP(s)[0m I (2641) wifi:new:<2,1>, old:<1,0>, ap:<255,255>, sta:<2,1>, prof:1 I (3211) wifi:state: init -> auth (b0) I (3241) wifi:state: auth -> assoc (0) I (3251) wifi:state: assoc -> run (10) I (3351) wifi:connected with qixin, aid = 11, channel 2, 40U, bssid = a8:02:db:e0:86:3e I (3351) wifi:security: WPA2-PSK, phy: bgn, rssi: -30 I (3361) wifi:pm start, type: 1 I (3361) wifi:set rx beacon pti, rx_bcn_pti: 0, bcn_timeout: 0, mt_pti: 25000, mt_time: 10000 I (3441) wifi:BcnInt:102400, DTIM:1 [0;32mI (5341) example_connect: Got IPv6 event: Interface "example_connect: sta" address: fe80:0000:0000:0000:86f7:03ff:fe3a:6efc, type: ESP_IP6_ADDR_IS_LINK_LOCAL[0m W (5441) wifi:idx:0 (ifx:0, a8:02:db:e0:86:3e), tid:0, ssn:2, winSize:64 [0;32mI (6341) esp_netif_handlers: example_connect: sta ip: 192.168.2.43, mask: 255.255.255.0, gw: 192.168.2.1[0m [0;32mI (6341) example_connect: Got IPv4 event: Interface "example_connect: sta" address: 192.168.2.43[0m [0;32mI (6341) example_connect: Connected to example_connect: sta[0m [0;32mI (6351) example_connect: - IPv4 address: 192.168.2.43[0m [0;32mI (6361) example_connect: - IPv6 address: fe80:0000:0000:0000:86f7:03ff:fe3a:6efc, type: ESP_IP6_ADDR_IS_LINK_LOCAL[0m [0;32mI (6371) example: Socket created[0m [0;32mI (6371) example: Socket bound, port 8000[0m [0;32mI (6381) example: Socket listening[0m [0;32mI (16041) example: Socket accepted ip address: 192.168.2.100[0m [0;32mI (18901) example: Received 9 bytes: 123456789[0m [0;32mI (20161) example: Received 9 bytes: 123456789[0m [0;32mI (22391) example: Received 9 bytes: 123456789[0m [0;32mI (24331) example: Received 9 bytes: 123456789[0m [0;32mI (26481) example: Received 9 bytes: 123456789[0m [0;33mW (30991) example: Connection closed[0m [0;32mI (30991) example: Socket listening[0m 以下为收发数据: 以下是ping测试网络延时(在我的硬件主板上,延时更低): |
|
相关推荐
1个回答
|
|
根据您提供的信息,我将分析可能导致接收慢的原因,并提供一些建议来解决这个问题。
1. 软件问题:可能是ESP32-C3的TCP/IP堆栈实现与ESP32-D0WD V3有所不同,导致接收性能下降。您可以尝试更新到最新版本的ESP-IDF,看看是否有所改善。 2. 硬件问题:ESP32-C3与ESP32-D0WD V3在硬件上可能存在差异,这可能影响到接收性能。请检查您的硬件设计,确保没有信号完整性问题。 3. 网络环境:网络环境可能影响接收速度。您提到使用网络ping的平均延迟为4ms,但TCP/IP通信可能受到其他因素的影响,如拥塞控制、数据包丢失等。请检查您的网络环境,确保网络稳定。 4. 代码实现:请检查您的TCP服务器代码,确保没有实现上的问题。例如,检查接收缓冲区的大小、接收数据的处理逻辑等。 5. 任务调度:ESP32-C3可能在处理多个任务时,调度策略与ESP32-D0WD V3不同。请检查您的任务调度设置,确保TCP服务器任务能够及时处理接收到的数据。 6. 驱动问题:请检查您的ESP32-C3驱动是否正确安装和配置。错误的驱动设置可能会影响通信性能。 7. 干扰:电磁干扰可能会影响无线通信性能。请检查您的硬件设计,确保没有电磁干扰问题。 为了解决这个问题,您可以尝试以下步骤: 1. 更新ESP-IDF到最新版本。 2. 检查硬件设计,确保信号完整性。 3. 检查网络环境,确保网络稳定。 4. 检查TCP服务器代码,确保没有实现上的问题。 5. 检查任务调度设置,确保TCP服务器任务能够及时处理接收到的数据。 6. 检查驱动安装和配置。 7. 检查硬件设计,确保没有电磁干扰问题。 |
|
|
|
只有小组成员才能发言,加入小组>>
1002 浏览 1 评论
554浏览 6评论
463浏览 5评论
有没有办法在不使用混杂模式的情况下实现Wifi驱动程序接收缓冲区访问中断呢?
447浏览 5评论
448浏览 4评论
422浏览 4评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-29 18:19 , Processed in 1.021466 second(s), Total 81, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号