Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LoRaClass::rxSignalDetected(). #574

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

toyo
Copy link

@toyo toyo commented Mar 27, 2022

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.

@bobricius
Copy link

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

@halukmy
Copy link

halukmy commented Feb 16, 2023

awesome! can you show some examples please? thanks

@morganrallen
Copy link
Collaborator

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.

@IoTThinks
Copy link
Collaborator

IoTThinks commented Jan 23, 2024

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

Let me test the Pull Request this weekend.

@morganrallen
Copy link
Collaborator

morganrallen commented Jan 23, 2024

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.

@toyo
Copy link
Author

toyo commented Jan 23, 2024

@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.

@morganrallen
Copy link
Collaborator

@toyo do you put it into receive mode first?

@toyo
Copy link
Author

toyo commented Jan 23, 2024

@toyo do you put it into receive mode first?

Yes, of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants