Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Luiz Henrique
#54185
martinayotte wrote:It has nothing with a library.
You simply need to create a for loop that will skip the unneeded characters until you find "\r\n\r\n" substring.
It can be done with something like (untested):
Code: Select allchar *ptr = buffer;
int len = strlen(buffer);
for (int = 0; i < len; i++) {
    if (strncmp(ptr++, "\r\n\r\n", 4) == 0) break;
}
ptr += 3;
Serial.println(ptr);


Hmmmm, ok, i will test this.
Just another question, this i put between that 2 lines, correct?

Code: Select alluint32_t len = wifi.recv(buffer, sizeof(buffer), 10000);


Your code


Code: Select all if (len > 0) {
        Serial.print("Received:[");
        for(uint32_t i = 0; i < len; i++) {
            Serial.print((char)buffer[i]);
        }
        Serial.print("]\r\n\r\n");
  }
User avatar
By martinayotte
#54186 Yes ! between the wifi.recv and the rest of the code.
But, as you can see, I've already printed the result with a single Serial.print(ptr), so no need to keep your "for loop" for printing, especially that printing one character at a time is pretty slow and useless... :ugeek:
User avatar
By Luiz Henrique
#54189
martinayotte wrote:Yes ! between the wifi.recv and the rest of the code.
But, as you can see, I've already printed the result with a single Serial.print(ptr), so no need to keep your "for loop" for printing, especially that printing one character at a time is pretty slow and useless... :ugeek:


Yes, that's is my problem. Can I change the library for ESP8266Wifi? https://github.com/esp8266/Arduino#installing-with-boards-manager

I don't understand how i change the Serial in this Library above for my case...