arduino-LoRa icon indicating copy to clipboard operation
arduino-LoRa copied to clipboard

Add LoRaClass::rxSignalDetected().

Open toyo opened this issue 3 years ago • 10 comments

Added function LoRaClass::rxSignalDetected() returns true when LoRa carrier is detected.

If you want to avoid collision, you should not transmit during this function returns true.

toyo avatar Mar 27 '22 23:03 toyo

Thanks! Amazing, this function I searching 2years, is much better and simpler than CAD

bobricius avatar Jan 29 '23 22:01 bobricius

awesome! can you show some examples please? thanks

halukmy avatar Feb 16 '23 09:02 halukmy

Right, in addition to adding the function to API.md and example should be provided. It could be as simple as calling this function in the loop and displaying "Incoming message" if it returns true. In theory, a message should arrive after this becomes true.

morganrallen avatar Feb 17 '23 01:02 morganrallen

Wow, so great Pull Request. Hope it get reviewed and merged soon.

Let me test the Pull Request this weekend.

IoTThinks avatar Jan 23 '24 03:01 IoTThinks

Also trying to make some time to check this out. But also would like some clarification on this. @toyo are you using this to detect network activity? From my reading of the datasheet I feel like this isn't working the way some people think it is. Adding an example (and update API.md) to this PR would go a long way to getting it merged.

Quoting @bobricius from issue #514

this status bit is documented in datasheet with les than one sentence

While correct, this sentence reads...

The state of the LoRa modem is accessible with the ModemStatus bits in RegModemStat. They can mostly used for debug in Rx mode and the useful indicators are...

Note that it says for debug in Rx mode. I do not believe this method is actually used for activity detection, as I'm guessing you need to put the radio into RX mode first, so why not just use CAD(*)?

@IoTThinks

Hope it get reviewed and merged soon.

Feel free to amend this PR with an example and API update

*) CAD has been merged, but I realized last night a new release hasn't been made since it was. I will make a new release in the next day or so.

morganrallen avatar Jan 23 '24 18:01 morganrallen

@toyo are you using this to detect network activity?

Yes. works with SX1278. It returns true from when it has decoded preamble to the signal end. So, it returns false if it cannot decode preamble correctly.

toyo avatar Jan 23 '24 22:01 toyo

@toyo do you put it into receive mode first?

morganrallen avatar Jan 23 '24 22:01 morganrallen

@toyo do you put it into receive mode first?

Yes, of course.

toyo avatar Jan 23 '24 23:01 toyo