How to send packets every 10ms per TCP
Posted: Tue Sep 07, 2021 2:04 pm
Hi,
i have written a Code which sends Sensordata to Matlab and saves it there for plotting etc. .
My Problem is i want a sending rate of at least 10ms but the fastest transmission rate i can reach is 60-70ms per Packet. I already disabled Nagle but nothing changed.
I post the relevant parts:
It seems like there is a hardcoded delay in the library.
Thank you for your help.
i have written a Code which sends Sensordata to Matlab and saves it there for plotting etc. .
My Problem is i want a sending rate of at least 10ms but the fastest transmission rate i can reach is 60-70ms per Packet. I already disabled Nagle but nothing changed.
I post the relevant parts:
Code: Select all
void loop()
{
client = server.available();
//Check if client is available
if (client)
{
Serial.println("Client vorhanden");
// while client is connected
while (client.connected())
{
startStopTransmission();
if (transmission)
{
if (tenmsFlag)
{
readSensorData();
double Values[] = {acc_x, acc_y, acc_z, eul_x, eul_y, eul_z};
client.write((uint8_t *)Values, sizeof Values);
client.flush();
tenmsFlag = false;
}
}
}
}
}
It seems like there is a hardcoded delay in the library.
Thank you for your help.