jeelabs / jeelib

JeeLib for Arduino IDE: Ports, RF12, and RF69 drivers from JeeLabs
https://jeelabs.org/202x/sw/jeelib/
The Unlicense
490 stars 215 forks source link

RFM69 Short packet receipt hang #88

Closed JohnOH closed 6 years ago

JohnOH commented 8 years ago

I think there is a problem with short non jeenode packets passing into the driver. When rf12_len contains a large value but the actual packet length is short, around 5 bytes then TXRECV doesn't appear to exit. This is a placeholder don't do anything on it since my testing and workaround is with RFxConsole. I think master branch will also be suffering.

JohnOH commented 8 years ago
case TXRECV:
    if (rxfill >= rf12_len + 5 || rxfill >= RF_MAX) {

The above line in RF69::recvDone_compat, part of RF69.cpp I think has a problem. If a noise packet arrives and places a valid length value in rf12_len but doesn't provide sufficient bytes into the FIFO to satisfy the above condition then the RF69::recvDone_compat code will loop unpredictably.

My workaround involves a flag named rxdone set within RF69::interrupt_compat of the RFxConsole_rework branch.

jcw commented 6 years ago

I'll leave this open, but am un-assigning myself from this issue. Won't be touching this code any day soon, not even sure it's still relevant. Feel free to close or elaborate if needed.