I trying to programm an real time system to control Model railroads.
The Problem is that with the non-Os sdk i am to slow with the sending data.
I send a testpaket like this "char testpaket[4] = {122,5,5,122};"
I try it with this code:
for(int i = 0 ; i < MAXSC ; i++)
{
int stamp = 0;
for(int j = 0 ; j < 200 ; j++)
{
testpaket[5] = 1 + j;
beforesend = millis();
/*
function send paket to the Station
*/
TKDClient[i].println(testpaket);
TKDClient[i].flush();
delay(10);
/*
time mesurement
*/
aftersend = millis() - beforesend;
testpaket[4] = millis() - beforesend;
stamp += aftersend;
Serial.println(stamp);
if(stamp > 1000)
{
Serial.println("bin raus");
int stamp = 0;
break;
}
The Result is i send 4 Packets in 1 second. This is very slow.
After this i read i shold take the freeRTOS.
Now my questions are:
How many packets can i send with this sdk in 1 second. Is there any docu our else i can read what is possible?
Hi community !
Thx for the answers gbafamily.
Okay now i can send 8 Pakets within a second. Great but the problem is i ned more, exactly i need 100.
now my questons are:
1. Is this posible to send 100 or more packets with 5 Byte within a second.
2. Is there any documentation who can I read what the maximal package rate is. (in real workspace)
3. Is it better to use a RTOS to send more packets in one second.
The for your attention !
Oliver