dragino / RadioHead

Radiohead library
Other
29 stars 14 forks source link

how to disable CRC check in RF95? #1

Open desword opened 6 years ago

desword commented 6 years ago

Now I want to keep all of the packets received at the LG01 or LoRa shield. However, in current implementation of RadioHead, with enabling CRC, only packets that pass CRC check will be keeped.

I have tried my best to disable CRC but it can not work. I have looked up from the datasheet sx1276_77_78_79 to find the register, and modify the corresponding value for RxPayloadCrcOn in RegModemConfig2(0x1E). According to the description,

Enable CRC generation and check on payload: 0 -> CRC disable 1 -> CRC enable If CRC is needed, RxPayloadCrcOn should be set:

Then it should be worked when I add a new function like this.

void RH_RF95::setCRCState(int8_t crcState) { spiWrite(RH_RF95_REG_1E_MODEM_CONFIG2, (spiRead(RH_RF95_REG_1E_MODEM_CONFIG2) & 0xfb) | ((crcState << 2) & 0x04)); }

According to the output from the serial, I have successfully modified the value of RxPayloadCrcOn from 1 to 0. However, when I recompile the sketch of LoRa_simple_client_arduino and LoRa_Simple_server_Yun. The LoRa shield can not received the packets from the LG01 anymore.

Therefore, how to disable CRC check correctly?

mrx23dot commented 7 months ago

on rxdone simply ignore crcerror