Skip to content

Automatic ACK blocks interrupt handling #22

@nawbar23

Description

@nawbar23

When automatic ACK mode is turned on, _sendFrame is called from _interruptHandler. _sendFrame than contains:
with self._sendLock:
....self._setMode(RF69_MODE_TX)
....self._sendLock.wait(1.0)
self._setMode(RF69_MODE_RX)
which causes interrupt to hang for 1s and it is not possible to release lock as SEND_DONE interrupt is received only when wait expires.

Note time passed between 'Set mode to: 4' - RF69_MODE_TX and 'Set mode to: 3' - RF69_MODE_RX;
Note also that the second interrupt is handled just after previous is finished - after waiting 1s for sending and getting into reception mode (twice :-));

2022-05-08 00:00:36,267 - radio - DEBUG - 1976558656 - Interrupt handler: entering
2022-05-08 00:00:36,267 - radio - DEBUG - 1976558656 - Interrupt handler: Send lock notify_all
2022-05-08 00:00:36,268 - radio - DEBUG - 1976558656 - Set mode to: 1
2022-05-08 00:00:36,270 - radio - DEBUG - 1976558656 - replying to ack request
2022-05-08 00:00:36,271 - radio - DEBUG - 1976558656 - Incoming data packet
2022-05-08 00:00:36,271 - radio - DEBUG - 1976558656 - Interrupt handler: return: Sending an ack
2022-05-08 00:00:36,271 - radio - DEBUG - 1976558656 - Send ACK to: 11
2022-05-08 00:00:36,272 - radio - DEBUG - 1976558656 - Begin receive
2022-05-08 00:00:36,272 - radio - DEBUG - 1976558656 - Set mode to: 3
2022-05-08 00:00:36,274 - radio - DEBUG - 1976558656 - Send frame
2022-05-08 00:00:36,274 - radio - DEBUG - 1976558656 - Set mode to: 1
2022-05-08 00:00:36,276 - radio - DEBUG - 1976558656 - Set mode to: 4
2022-05-08 00:00:37,278 - radio - DEBUG - 1976558656 - Set mode to: 3
2022-05-08 00:00:37,280 - radio - DEBUG - 1976558656 - Begin receive
2022-05-08 00:00:37,281 - radio - DEBUG - 1976558656 - Set mode to: 3
2022-05-08 00:00:37,282 - radio - DEBUG - 1976558656 - Interrupt handler: entering
2022-05-08 00:00:37,282 - radio - DEBUG - 1976558656 - Interrupt handler: Send lock notify_all
2022-05-08 00:00:37,283 - radio - DEBUG - 1976558656 - Interrupt handler: return: RF69_MODE_RX && RF_IRQFLAGS2_PAYLOADREADY

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions