Post topics, source code that relate to the Arduino Platform

User avatar
By laxmimerit
#39106 However when I tried to connect two esp together programmed in Lua It worked perfectly. now the problem is I am unable to interface SD card in lua. SD card examples are already in arduino but Server is not working in Arduino. Bad Luck on mine :cry: :cry:
User avatar
By WereCatf
#39107
laxmimerit wrote:Yes, I tried but It did not work. Any Other suggestion?


If there is no delay when you just reply back with the string the client sent, then it should work equally well if you reply back with another string that's the same length, but different content.

Did you pad the string to the same length? Have you actually checked what line even contains and its length after you've read it from the client and before you changed it? Maybe you've been replying back with an empty string and that's the issue? You're only giving us fragments of information here, you know.
User avatar
By laxmimerit
#39108
WereCatf wrote: You're only giving us fragments of information here, you know.

Here is Client side code. I am first sending hello to server and then expecting to receive data.
Code: Select allString myString = "hello";
void loop() { 
  if (client.available()) {
    client.print(myString);
    client.print('\n');
    String line = client.readStringUntil('\n');
    Serial.print("Received: ");
    Serial.println(line);
    delay(100);
  }
}


I am receiving exactly same at the server side what I am sending to server. And yess string lengths are same what I am sending back to client but different content.