Skip to content

Fix broken join backoff #299

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

Merged
merged 2 commits into from
Mar 15, 2025

Conversation

Mr-HaleYa
Copy link
Contributor

Currently, the join backoff is broken. The defines for the join dutycycle are placeholder values that have been there since the library's creation. In the file where they are used (RegionCommon.c) they are

​#define BACKOFF_DC_1_HOUR       1
#define BACKOFF_DC_10_HOURS     2
#define BACKOFF_DC_24_HOURS     3

This is why there is no backoff regardless of how long the node has been running...
What they should be is defined in a different file, in (LoRaMac.c) they are defined again but NEVER used

/*!
 * LoRaMac duty cycle for the back-off procedure during the first hour.
 */
#define BACKOFF_DC_1_HOUR                           100

/*!
 * LoRaMac duty cycle for the back-off procedure during the next 10 hours.
 */
#define BACKOFF_DC_10_HOURS                         1000

/*!
 * LoRaMac duty cycle for the back-off procedure during the next 24 hours.
 */
#define BACKOFF_DC_24_HOURS                         10000

Almost all other repos that use the SemTech Lora library have the values that are in LoRaMac.c in RegionCommon.c. By doing that, join backoff can actually function.

Replace placeholder values with actual values for backoff define
Reduce magic number usage
Rename dutyCycle -> joinDutyCycle to keep clear its only for joining
These were in the wrong file and not doing anything
@Heltec-Aaron-Lee Heltec-Aaron-Lee merged commit e7066dd into HelTecAutomation:master Mar 15, 2025
@Mr-HaleYa Mr-HaleYa deleted the fix-backoff branch March 16, 2025 02:53
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.

2 participants