Skip to content

Repeat calls to methods using IRQ causes lockup #25

@CraigBurden

Description

@CraigBurden

Repeated calls to the .request(LoRa.RX_CONTINUOUS) method causes main thread to lockup.
This is because of the use of the following on ln551 in SX127x.py:

if isinstance(self._monitoring, Thread):
                self._monitoring.join()

The monitoring thread has no way to exit and by default .join() is a blocking call. The timeout passed to the monitor_continuous method is ~1000s, so the main thread will block until this timeout is reached. To fix this you need to provide a way for the monitor_continuous method to exit when requested to do so. This should be done either with a ThreadEvent that is used to break out of the while loop or simply a class attribute to do the same.

I have not yet tested this, but I assume that this issue will occur anytime that .request() or .endPacket() is called anything other than the first time as the same lines exist on ln474.

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