Frankthetech
Well-known member
I'm working on a T4.1 with the ethernet kit and ran into a issue sending data to the ethernet port, it seems that I'm send too much-too fast, if thats possible.
So using the following, (jBuffer) holds json data of about 96 bytes.
client.print(jBuffer); //this works inside a loop that repeats this until all the data fields are sent to the web client
OK works as expected, the client displays the json data as it should. The issue shows up as missing data fields when I send more then 30 sets of data.
So I debug by adding,
client.print(jBuffer);
Serial.print(jBuffer); //show the same json data as was sent to the client
All the data shows up on the serial monitor so I'm certain the data is all being sent. but the client is still missing everything after the 30th field. So I'm thinking maybe it's going too fast for the ethernet to keep up.
So slow it down a bit,
client.print(jBuffer);
delay(25); //slow down the output to ethernet
Serial.print(jBuffer); //show the same json data as was sent to the client
Now that fixed it and all the data is received at the client. Now I don't really want to code hard delays.
My question is does anyone know how to monitor the state of the transmit buffer so I can stop sending to it till theres room for more?
So using the following, (jBuffer) holds json data of about 96 bytes.
client.print(jBuffer); //this works inside a loop that repeats this until all the data fields are sent to the web client
OK works as expected, the client displays the json data as it should. The issue shows up as missing data fields when I send more then 30 sets of data.
So I debug by adding,
client.print(jBuffer);
Serial.print(jBuffer); //show the same json data as was sent to the client
All the data shows up on the serial monitor so I'm certain the data is all being sent. but the client is still missing everything after the 30th field. So I'm thinking maybe it's going too fast for the ethernet to keep up.
So slow it down a bit,
client.print(jBuffer);
delay(25); //slow down the output to ethernet
Serial.print(jBuffer); //show the same json data as was sent to the client
Now that fixed it and all the data is received at the client. Now I don't really want to code hard delays.
My question is does anyone know how to monitor the state of the transmit buffer so I can stop sending to it till theres room for more?