Skip to main content
added 137 characters in body; edited body
Source Link
ott--
  • 170
  • 1
  • 1
  • 7

In this loop

while(client.available()) { 
    Serial.write(client.read());
    buffer[ctr] = client.read();

you're using client.read() twice, so the buffer gets only every second character.

A solution could be:

while(client.available()) { 
    int c = client.read();
    Serial.write(c);
    buffer[ctr] = c;

In this loop

while(client.available()) { 
    Serial.write(client.read());
    buffer[ctr] = client.read();

you're using client.read() twice, so the buffer gets only every second character.

In this loop

while(client.available()) { 
    Serial.write(client.read());
    buffer[ctr] = client.read();

you're using client.read() twice, so the buffer gets only every second character.

A solution could be:

while(client.available()) { 
    int c = client.read();
    Serial.write(c);
    buffer[ctr] = c;
Source Link
ott--
  • 170
  • 1
  • 1
  • 7

In this loop

while(client.available()) { 
    Serial.write(client.read());
    buffer[ctr] = client.read();

you're using client.read() twice, so the buffer gets only every second character.