How is the TCP transmission speed for ESP8266 based programmable controller

After a series of adjustment and optimizations, the TCP communication of a simple programmable controller based on ESP8266 reaches a very good speed, including:
1) Adjusting the priority of the main task and the LWIP task
2) State machine optimization …


This content originally appeared on DEV Community and was authored by zhuyue

After a series of adjustment and optimizations, the TCP communication of a simple programmable controller based on ESP8266 reaches a very good speed, including:
1) Adjusting the priority of the main task and the LWIP task
2) State machine optimization for data processing of the main task
3) Solving the fast communication crash problem by increasing the kernel lock of LWIP
4) Using signal trigger to achieve 10ms tick scheduling for the main task, while providing an interface for LWIP to actively wake up
...
The web page file is about 90kByte in total, and pc tool transfers the binary to ascii data, doubling the amount of data to 180kByte;
The pc tool will write the data, and then read out the same comparison, so the effective data transferred in both directions is 360kByte, plus 0.6 times the HTTP header data, a total of 576kByte of data transferred in both directions.

The whole download process erases flash once, which takes 54.6ms, writes flash 354 times, which takes 4.0ms each time, and reads flash 354 times, which takes 0.5ms each time;
The total elapsed time for flash operation is 1.6s;

The elapsed time for complete download is 7.7s, deducting the flash operation time of 1.6s, the transmission elapsed time is 6.1s;

According to this calculation, the transmission speed of TCP can reach 755kb/s;
There are still optimization problems.
The response of TCP is sent in two packages, which can be optimized to be sent in a single package;

And if you comment out the code that wakes up the main task after LWIP receives the data.
xSemaphoreGive(xBinarySemaphore).
Two full downloads were tested, taking 9360ms and 9371ms respectively;

if with the code, also tested twice, taking 7762ms and 7821ms respectively;

How is the performance for such speed?
A special ESP8266 module is sold in Taobao online shop and has a quite good selling quantity, it claimed to achieve high-speed communication with up to 800kb and suitable to transmit real-time audio signals;
I think with these optimizations, current simple controllers can also reach this level.

Image description

Image description


This content originally appeared on DEV Community and was authored by zhuyue


Print Share Comment Cite Upload Translate Updates
APA

zhuyue | Sciencx (2024-10-21T04:09:50+00:00) How is the TCP transmission speed for ESP8266 based programmable controller. Retrieved from https://www.scien.cx/2024/10/21/how-is-the-tcp-transmission-speed-for-esp8266-based-programmable-controller/

MLA
" » How is the TCP transmission speed for ESP8266 based programmable controller." zhuyue | Sciencx - Monday October 21, 2024, https://www.scien.cx/2024/10/21/how-is-the-tcp-transmission-speed-for-esp8266-based-programmable-controller/
HARVARD
zhuyue | Sciencx Monday October 21, 2024 » How is the TCP transmission speed for ESP8266 based programmable controller., viewed ,<https://www.scien.cx/2024/10/21/how-is-the-tcp-transmission-speed-for-esp8266-based-programmable-controller/>
VANCOUVER
zhuyue | Sciencx - » How is the TCP transmission speed for ESP8266 based programmable controller. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/21/how-is-the-tcp-transmission-speed-for-esp8266-based-programmable-controller/
CHICAGO
" » How is the TCP transmission speed for ESP8266 based programmable controller." zhuyue | Sciencx - Accessed . https://www.scien.cx/2024/10/21/how-is-the-tcp-transmission-speed-for-esp8266-based-programmable-controller/
IEEE
" » How is the TCP transmission speed for ESP8266 based programmable controller." zhuyue | Sciencx [Online]. Available: https://www.scien.cx/2024/10/21/how-is-the-tcp-transmission-speed-for-esp8266-based-programmable-controller/. [Accessed: ]
rf:citation
» How is the TCP transmission speed for ESP8266 based programmable controller | zhuyue | Sciencx | https://www.scien.cx/2024/10/21/how-is-the-tcp-transmission-speed-for-esp8266-based-programmable-controller/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.