Description
Describe the bug
CC1101::receive
will always return ERR_RX_TIMEOUT
.
This is because GDO0 will always stay high after a packet is received.
I have tracked it down to this change.
https://github.com/jgromes/RadioLib/pull/279/files#diff-8f4be18065fcaf0dcbf0cc902df2a1669a8dc78b86f344d2c0a3804d09b8240dR331
CC1101_REG_IOCFG0
was changed from CC1101_GDOX_SYNC_WORD_SENT_OR_RECEIVED
(0x06) to CC1101_GDOX_RX_FIFO_FULL_OR_PKT_END
(0x01) which seems to be causing the issue.
According to the datasheet 0x01 "De-asserts when the RX FIFO is empty." it says nothing about de-asserting on packet end. Maybe there was some confusion from the name and comment for CC1101_GDOX_RX_FIFO_FULL_OR_PKT_END
?
The behavior of 0x01 causes CC1101::receive to time out while waiting for packet end, since GDO0 won't actually de-assert on packet end.
To Reproduce
Run CC1101_Transmit.ino
and CC1101_Receive.ino
from the examples. CC1101_Receive.ino
won't print Data: Hello World!
as expected.
Replacing CC1101_GDOX_RX_FIFO_FULL_OR_PKT_END
with CC1101_GDOX_SYNC_WORD_SENT_OR_RECEIVED
in CC1101::startReceive
causes the Hello World
packets to be received, but I'm also receiving a lot of junk data, so the fix is likely more complicated.
Expected behavior
When running CC1101_Transmit.ino
and CC1101_Receive.ino
, CC1101_Receive.ino
should correctly receive the hello world packets and not anything else.
Additional info:
- MCU: Arduino pro mini transmitter, ESP32 receiver
- Wireless module type: CC1101 (likely clone).
- Library version 4.5.0
- Possibly related issue: CC1101 + ESP32 receiving random junk data #345. That issue also mentions CC1101_Receive returning error -6.