Chat freely about anything...

User avatar
By MichaelP
#81370 I'm trying to send data from ESP8266 to a smartphone via TCP sockets.
Hardware: NodeMCU with ESP8266MOD, various Android and iOS phones

I'm sending 1000 blocks of 1024bytes from ESP8266 to the smartphone and can achieve data rates around 1Mbit/s which I find extremely slow. Using the exact same ESP8266 firmware but a Windows10 PC or Raspberry Pi as receiver, I see data rates of 2 Mbit/s. Still not fast, but at least twice the speed I get if the receiver is a smartphone. Oddly enough the data rate is the same for iOS and Android phones.

I've tried already different buffer sizes (below and above the MTU of 1460), WiFi channels, WiFi output power without any significant change in the overal data rate.
I'd be glad if somebody could have a look at the Arduino- and Android-project to tell me if I'm doing something wrong and how to achieve faster transfer speed: https://www.dropbox.com/s/iu8egzqqskcfd ... o.zip?dl=0

I have decided to setup the smartphone as a hotspot, to rule out the WiFi router as bottleneck.
(Using the WiFi router actually reduced the speed a little bit)
If you want to try the project, please setup the Android phone as hotspot and enter the hotspot credentials in the Arduino project:
const char* ssid = "??????????";
const char* password = "??????";
const char* host = "192.168.43.1"; // please enter here the IP address of the hotspot
User avatar
By eriksl
#81415 Are you sure? With all sorts of optimisations and elimination of the espconn layer I can achieve 700 kByte per second. I don't think any higher than that is feasible.

Remember it's just a microcontroller, not a high end cpu and the WLAN hardware is also very simple. It's designed to exchange some control info, not huge amounts of data.
User avatar
By MichaelP
#81419 I would be absolutely delighted to achieve 700kBytes/s = 5,6 Mbit/s, but I can only get ~1Mbit/s.

Could you please share some information regarding your optimisations?

My main loop is very simple:
Code: Select allvoid loop() {
 if (loopcounter<1000)
 {
  client.write(Post_Buffer,BUFFER_SIZE);
  loopcounter++;
 }
}