Very Slow TCP and Client Connection
Posted: Sun Jan 17, 2016 6:23 pm
MY esp modules tcp transmission is very slow. please refer the following code
But if I comment " line = String(adc) ", i.e. if I return same value what I received it boost its speed. what could be possible mistakes.
P.S. TCP client program is working fine, I have tested that client program with server written in lua language.
Code: Select all
void loop(void) {
if (!serverClient.connected()) {
delay(100);
serverClient = server.available();
}
if (serverClient.connected()) {
int adc = analogRead(A0);
Serial.write("\nwaiting for input");
String line = serverClient.readStringUntil('\n');
Serial.write("\nSending ADC value to client");
line = String(adc); // if I comment this line, its speed is much enough to gain 50 sample/second
serverClient.println(line);
Serial.write("\nADC Value sent");
delay(100);
}
}
But if I comment " line = String(adc) ", i.e. if I return same value what I received it boost its speed. what could be possible mistakes.
P.S. TCP client program is working fine, I have tested that client program with server written in lua language.