I'm back here to get rid of another (and I hope one of the last) problem I have on my project.
I'm trying to send a message from a Uno (Tx) to a Nano (Rx) wireless. I therefore use two NRF24L01 modules to communicate between the Arduinos. Everything is working well, until I try to disable the CRC implemented in the NRF24, and the auto-ack at the same time.
When disabled, I receive no more. I don't really understand what the auto-ack is, and I just want to transmit the message with my own CRC algorithm (which works well). Do you know how I can disable CRC/auto-ack and still receive the message sent ?
It is used to send an acknowledgment message from the Rx back to the Tx indicating that a message has been received. This can be used with a timeout at the Tx to resend a message or take other actions if it is not acknowledged by the Rx
One legit application, is getting as close to promiscuous mode as possible.
If you set up 2 byte addresses, and set the top byte to the correct preamble byte,
you can receive packets to all pipe addresses that start with a specific byte.
Six addresses with the same MSB can be scanned at the same time.
I added my own CRC to the packet. The point is, I actually need to prove that my algorithm works. Which means, I have to send messages with and without CRC (my own) and compare the number of errors. If it seems strange to you, let's say it is purely academical.
Well, it doesn't work for me. As soon as I disable auto-ack and CRC, Rx Output is an empty byte, whereas it is exactly what I expect when auto-ack/CRC is enabled.
For testing the algorithm, I would introduce errors on the sending side,
while using the built-in CRC to deliver that deliberately damaged packet intact to the receiver.
The setup I used for the sniffer was
void radioSetup() {
printf_begin();
radio.begin();
radio.setChannel(radioChannel);
radio.setDataRate(radioSpeed);
radio.setAddressWidth(adrBytes);
radio.setPayloadSize(packetSize);
radio.setAutoAck(false);
radio.disableCRC();
setupAddresses();
radio.startListening();
}
void setupAddresses() {
for (byte i = 0; i < 6; i++) {
if (i < numAdrs) {
radio.openReadingPipe(i, adr + adrBytes * i);
} else {
radio.closeReadingPipe(i);
}
}
}
I agree and I did something very similar for LoRa recently.
At a basic level it was to do with being able to have a 'relaible' packet, one that the receiver could be sure was destined for it, rather than from some foriegn source, and thus had invalid data.
A CRC of the data payload was appended to the end of the packet. The receiver could then generate its own CRC of the payload and compare it with the one appended to the packet end.
Checking for errors was easy enough, just alter the payload or appended CRC just before transmit or just after receipt to see if the error was detected.
Normal CRC checking was left on, why would you want to check your added CRC if the packet was aleready corrupt ?
But I'm then unable to get stistics on the failing rates or the to evaluate which settings are making the signal worse. I'll remember it though, if I can't have it work without.
I use Python to receive, print, and store the messages, as for my CRC and a Huffmann code algorithm. WHen I ask Python to return what the Rx has received, it rteturns an emty byte. With auto-ack on, it returns what I expect.
Well, it has nothing to do with the Python driver, since it works with the NRF24's CRC.
I don't know what decimal value is attached to this byte. What I can tell is that a byte object in Python is written b'value' and, with auto-ack off, Python returns b''.