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

[LoRaWAN] Add methods to allow user-provided sleep function #1410

Merged
merged 5 commits into from
Feb 6, 2025

Conversation

jgromes
Copy link
Owner

@jgromes jgromes commented Feb 1, 2025

Discussed in #1401

cc @StevenCellist - so far I only used this function in the Rx windows, are there others where this would make sense? And should we add this to the reference example?

@jgromes jgromes marked this pull request as draft February 1, 2025 09:52
@jgromes jgromes self-assigned this Feb 1, 2025
@jgromes jgromes added the enhancement New feature or request label Feb 1, 2025
@StevenCellist
Copy link
Collaborator

We could a-synchronize the transmission calls - at SF9+ they could easily rise above the threshold too. Requires a pre-calculation of the timeout value but this is done anyway on Fixed bands (US915-style) for the Dwell time limits so I guess we can do that for Dynamic (EU868-style) as well.

@StevenCellist
Copy link
Collaborator

@jgromes I added a commit in the new branch. I know that that is not ideal, but given that I was working on that anyway (and needed asynchronous calls to work around an erroneous cast), I thought I'd add that there. Feel free to port that over if you want to close this first, otherwise we must merge this manually after the mode staging is done.

@michapr
Copy link

michapr commented Feb 5, 2025

@jgromes Would be nice to add this in reference example - of course with the "warning note" ... ;)

jgromes added a commit that referenced this pull request Feb 5, 2025
* [PHY] Add PHY support for staged modes

* [SX126x] Add support for staged Rx/Tx

* [PHY] Add missing virtual specifiers

* [SX126x] Add missing overrides

* [LoRaWAN] Use new stageMode and launchMode, reduce scanGuard

* [LoRaWAN] A-synchronize transmissions (#1410)

* [PHY] Pass mode config by reference

* [PHY] Add default implementation of start transmit/receive

* [SX126x] Implement staged modes

* [SX128x] Implement staged modes

* [SX127x] Implement staged modes

* [LR11x0] Implement staged modes

* [SX127x] Remove unused method from header

* [SX126x] Make array const

* Add new methods to keywords

---------

Co-authored-by: StevenCellist <[email protected]>
@jgromes jgromes marked this pull request as ready for review February 5, 2025 20:12
@StevenCellist
Copy link
Collaborator

@jgromes will you add it in the transmission as well, or shall I do that?

@jgromes
Copy link
Owner Author

jgromes commented Feb 5, 2025

@StevenCellist yes please! And anywhere else you find it appropriate.

@StevenCellist
Copy link
Collaborator

Turns out every one of the delays could potentially be longer than a few (tens of) milliseconds, so they're now all sleepDelay() :)
Time and tests will tell how useful / effective certain thresholds are.

@jgromes jgromes merged commit 8c2c7b6 into master Feb 6, 2025
31 checks passed
@jgromes jgromes deleted the lorawan-sleep branch February 6, 2025 06:00
@jgromes
Copy link
Owner Author

jgromes commented Feb 6, 2025

@StevenCellist thank you so much - indeed, we'll see how well this works ;)

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

Successfully merging this pull request may close these issues.

3 participants