0

I am trying to modify the example given in the this page to a basic throughput and BER test with two nRF24L01+ and Teensy 3.0 modules.

I want to modify the nrf24l01_send_string example in a way that I can remove the powerUp powerDown and delay and transmit the next packet purely based on the ACK received from the receiver. The problem is RF24 class does not seem to have a method to transmit ACK (not ACK+Payload) and the datasheet does give any information on the structure of the ACK message. The example works when powerUp and powerDown are removed, but I need to modify it to measure throughput by removing the delay.

  • 1
    You can't send the ACK manually. The module itself sends the ACK automatically (if enabled that is), once it receives the package. This way the sending module only need to be listening for the ACK for the shortest amount of time, reducing power usage. To attach data to the ACK package you need the writeAckPayload function. But you have to prepare this before any package is received. – Gerben Jan 21 '15 at 16:08
  • Thanks for the reply. The data string in the example in sent in a loop. I have to stop and listen to the ACK before resuming the loop. If I reduce the delay below 500 the arduino serial monitor hangs. Inorder to listen to the ACK using the read() function I need to know the structure of the ACK payload esp. the number of bytes in the ACK message. This information is not there in the documentation. Also, how do I find the CRC checksum after receiving the packet to calculate BER? – Naveen Jan 21 '15 at 21:54
  • You can use getPayloadSize to get the size. No way to get to the CRC, as the module handles the CRC and rejects messages with incorrect CRC. – Gerben Jan 22 '15 at 15:28
  • I'm sending 32 byte payload(in loop) with data rate set to 2MBPS and setRetries parameters of 0(250us) and 3(retries) respectively. The throughput I get is only 45 KBPS. The delay between consecutive 32 byte packets is 700us which works out to the above mentioned throughput. Is there any way to get closer to the set data rate of 2MBPS? – Naveen Jan 22 '15 at 21:11
  • You could try filling the buffer, instead of sending 1 packet at a time to the module. Use startWrite, instead of write. I think however that then you won't be able to determine is a packet was ACKed. – Gerben Jan 22 '15 at 21:37
1

@Gerben remarked:

You can't send the ACK manually. The module itself sends the ACK automatically (if enabled that is), once it receives the package. This way the sending module only need to be listening for the ACK for the shortest amount of time, reducing power usage. To attach data to the ACK package you need the writeAckPayload function. But you have to prepare this before any package is received

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.