您好,我使用ESP8266模拟了一个Web服务器,当接收到HTTP命令是就返回一个网页(差不多400多KB)
假如我想发送一个400KB的文件,使用espconn_send()来传输,因为SRAM只有那么大,所以分配了4KB作为缓冲区,从FLASH中反复读取4KB,每次用espconn_send()发送4KB的数据。
因为发送成功一次就会进入一次回调函数,这样就跳出了刚才上传网页的那个函数,无法重进。不知道您对于这种是如何处理大的?(我目前是采用的定时器,定时回调重进网页上传函数)
但是这种方法有个很严重的问题,就是多次使用espconn_send()后,会出现某些包并未发送成功。
如每500ms 上传4KB数据,多次后,就会偶尔出现一包出错。
经过反复测试发现,就算延长等待时间,调成每5s上传4KB数据,依旧存在上述出错的问题!!
请问,对于这种问题,应该如何解决?
ESP8266模拟Web服务器,给浏览器传输大网页,espconn_send函数偶尔出现发包不成功
Who is online
Users browsing this forum: No registered users and 60 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.