Hello
i did a conversation chat room with both transceivers being receivers and transmitters at the same time.
The problem is that i don't know how to calculate RTT and PLR in my code :c
I'm not sure that the library you are using makes that all visible to you because the handling of re-trys etc. is done at a low level.
Have a look at the product specification: nRF24 Series - Nordic Semiconductor - nordicsemi.com
May be you can get something by sending a block of data, setting a timer, and waiting for the acknowlegement.
OK. I see that this is school work from your other posts.
But, anyway I don't believe that your get information about the automatic packet loss / re-transmit handling.
However, you can do something like this:
Continually transmit packets which include a serial number which you increment by one each time.
On the receiver side, simply look for gaps. That is where the serial number of the packet just received is more than one increment higher than in the previous packet received. From that, work out the proportion of missing packets.
Maybe this gets you started with the measurement of lost packets:
// transmitter code fragment - lost packets :
const unsigned long intervalMs = 10 ;Â
unsigned long lastTrasmitAtMs = 0 ;
unsigned long serialNumber = 1 ;
loop() {
 // sends 6000 packets @ 10 mS intervals. Duration = approx 1 minute
 if ( serialNumber < 6000 && millis() - lastTrasmitAtMs > interval ) {
  lastTrasmitAtMs += intervalMs ;
  radio.write( &serialNumber, sizeof( serialNumber ) );
  serialNumber++;
 }
}
// receiver code - lost packets
unsigned long serialNumber ;
unsigned long serialNumberPrevious = 0Â ;
unsigned long missingPackets ;
loop() {
  radio.read( &serialNumber, sizeof( serialNumber ) );
  missingPackets = serialNumber - serialNumberPrevious - 1 ;
  // prints a message when a loss of a packet or group of packets is discovered.
  if ( missingPackets > 0 ) {
   Serial.print ( "lost packets= " ) ;
   Serial.print ( missingPackets ) ;
  }
  serialNumberPrevious = serialNumber ;
 }
}
I know basically nothing about arduino because i just started learning it by myself.
My teachers don't help me either. They say that i have to search on internet for information that I don't find.
Yet I have to do a Chat room and on top of that i have to get RTT and PLR.
I thought this forum would help me to find an answear for my questions. But this is a complete waist of time.
I really wanted to learn more about arduino with all of you, but you choose to ignore me
I thought this forum would help me to find an [answer] for my questions. But this is a complete [waste] of time.
I really wanted to learn more about arduino with all of you, but you choose to ignore me.
Well that all sounds a bit like a dramatic outburst of frustration, but anyway:
If you cant use 'ack' to measure the round trip delivery time, then you have to devise your own method of achieving the same thing.
You have to send a message from A to B. A sets a timer when it sends the message. B accepts the message and sends a response back to A. A records the time it receives the response back from B. The difference between these two times, that is the time of the sending of the original message and the time of receiving the response back, is the round trip delivery time.
This is not a trivial exercise, but it is also not extremely difficult. Do you have to show a complete working solution or only show the outline of a solution ?
One thing is clear. This is not a project for a complete beginner with Arduino. You started off using terms like RTT so I guess your course has an element of communications in it and is not at a basic level.
Anyway, you asked (PM) about the "serialNumber" in post #5. This is simply a number which starts at 0 the first time it used. It is incremented by one each time it is used. The idea is that the receiver notices if packets are dropped. For example, if the last packet received has a serial number 57 and the next received has a serial number of 60, the receiver 'knows' that 2 packets, that is packets 58 and 59 have been dropped.
A slightly easier way of doing this has occurred to me:
The transmitter part continually sends packets at say every 10 mS. The content is irrelevant.
The receiver part, on receiving a packet, sets a timer say lastPacketReceivedAtMs = millis() ;
The value of the formula: millis() - lastPacketReceivedAtMs is continually checked and if it is greater that the 10 mS transmission interval, that indicates a lost packet. The number of missing packets can be determined by dividing the previous formula by 10.