Hi
I am using Blynk Local Server Version 0.39.2
I’ve noticed for a while that when I make a Blynk API call and process the returned messages that I always hit my client TIMEOUT. I’ve realized that the text/string returned from Blynk Server does not have a ‘\n’ end of line marker.
I just wanted to confirm is this by design ? (perhaps I’m doing something wrong)
I’m using the following code to read the result and it obvious reading it by I always hit the TIMEOUT as indicate in commented code extract below.
client.setTimeout(4000);
while (client.connected())
{
line = client.readStringUntil('\n'); // *** this works fine .. reads in the http header info
if (line.startsWith("content-length"))
{
Serial.println("found content-length");
}
if (line == "\r")
{
Serial.println("--- All headers received --- ");
Serial.println(line);
break;
}
} // end of while loop
client.setTimeout(4000);
line = client.readStringUntil('\n'); // *** this is where I read the Blynk Server content and find the '\n" is never found and thus I hit the 4000 ms client timeout.