ESP8266 as serial wifi module - expected performance? #6393
Replies: 1 comment
-
Posted at 2021-02-04 by AkosLukacs Found this comment at Internet / Transferring files:
Posted at 2021-02-04 by erikboto Thanks, this made a huge difference and I now get ~4.5kB/s instead. I wonder what the bottleneck is now, and if there's more tweaking that could be done. Posted at 2021-02-05 by @gfwilliams Glad you got this improved! I'm not sure how much room for improvement there is here - I just checked and it seems that the WiFi stack should be able to send data out in ~530 byte chunks, so it should mean data from the file goes straight out. Without digging down (you could attach a USB-TTL converter to the ESP8266 RX line and look at what's being sent and when) it's hard to know where the slowdown might be. Posted at 2021-02-05 by erikboto So I hooked up two USB-TTL converters and had a look at the traffic going to and from the ESP8266 and I have a few findings.
Just tweaking the chunksize so that 2048 bytes of data in sent in each AT+CIPSEND increases throughput to ~12kB/s, but in order to go above that I guess the logic needs to be rewritten to use AT+CIPSENDBUF instead so that the wifi connection have data to send at all times. I'll see if I have the possibility to make a working implementation of this. Posted at 2021-02-06 by @gfwilliams Nice - thanks for looking into that! As I remember the send buffer end up being allocated on the stack, which I think is why we don't allocate too much. However I think it would be pretty easy to make that configurable. In an idea world we'd actually have a shortcut for the JS interface that just pushed the entire send buffer - no matter how big - to the JS interface, and it could decide how much to send. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-02-04 by erikboto
I'm using a puck.js v2 + esp8266 (ESP-01) module on Serial1 to serve files stored on an SD-card.
While I understand that this will never be a super fast file transfer method, I wonder what kind of speed could be expected? I'm currently getting between 600-700 bytes/s, and increasing the UART speed from 115200->460800 didn't really make a difference so I suspect that the UART is not the bottleneck.
Example code:
Beta Was this translation helpful? Give feedback.
All reactions