Closed PCov3r closed 3 years ago
I was wondering what would be the more effective/fastest way to check if received data got corrupted.
You automatically use CRC16 bit provided by the radio firmware. you could dedicate part of the payload to do a larger CRC scheme, and then reduce the radios builtin CRC to 8 bits (for better speed -- can't disable CRC when using ACK packets).
If I had to guess: one of your wires is loose or too long. Try lowering the SPI speed on the unit(s) experiencing currupted data.
RF24 radio(22, 0, 4000000); // uses 4MHz; defaults to 10MHz
I'm using nrf24l01+PA+LNA modules
Have you read the section about PA/LNA modules in our COMMON_ISSUES.md?
Thank you for your response.
I did all the things recommended in the common issues part. Think that's why I don't get that much corrupted data (something like 1/300 which is more than decent for my application).
My question was more about the receiver side. On the transmitter, I get "failed transmission" if the rpi didn't receive any data, or if the data got corrupted. But the RPi in itself doesn't know that he is copying corrupted data. radio.read() copy the data and it looks like sometimes there is a bit flipping.
Could be hardware related. But as the 2 modules are wrapped in electrical tape and tin foil inside antistatic bags + powered via an external power supply using adapters, I doubt it. In any case, as I plan to store the received data in a database, I would like to find a way to avoid copying these value with flipping bit.
I will try to change my configuration tomorrow, especially the power supply part and I'll tell you if it changes anything.
Thanks.
After a bit of trial and errors, the lowering of the SPI speed on RPi + changing to another channel did the trick !
Hello, I'm using nrf24l01+PA+LNA modules to transmit data from arduino to raspberry. All works great, I receive data from arduino and print them on my raspberry.
If my arduino fails to transmit, it shows an error message. And if there is some lost data on the way, it shows the error too. But my raspberry, even if the data are corrupted, he still shows it.
I was wondering what would be the more effective/fastest way to check if received data got corrupted. I first thought about sending the sum of all variables and check on the receiver side if we get the same sum, but I don't know if it's a good idea.
Please, let me know what you think. Thanks !
Here are the two scripts :
Arduino
RPi