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

Space out periodic broadcasts of modules automatically #5931

Merged
merged 5 commits into from
Jan 26, 2025

Conversation

GUVWAF
Copy link
Member

@GUVWAF GUVWAF commented Jan 25, 2025

Some modules have by default the same broadcast interval (or multiples of each other) and are also started at the same time, resulting in them being sent quickly after each other, thereby making delivery harder considering the packets are being propagated through the mesh also.
I’ve seen a workaround of @b8b8 to set the intervals to, e.g., 3600, 3615, 3630 seconds, etc. With this PR, we space periodic broadcasts of modules by 15 seconds by letting them start 15 seconds after each other (which was manually done for NodeInfo, DeviceTelemetry and Position already).

@thebentern
Copy link
Contributor

Really great simple approach. This should effectively spread out a lot of airtime by staggering the intervalled broadcasts.

I was initially concerned with the usage in runOnce() for some of the modules, but looking at the context of it, you're using it inside of the if (firstTime) block, which should prevent inadvertently "stacking" the incremented intervals. I wonder if we should place a warning comment about this to prevent that issue from future consumers? 😅
Another related thought I'd like to pick your brain about as a long term idea is potentially rescheduling some of the broadcast intervals based on a trend of observed periods of dead space in the ch. utilization.

@GUVWAF
Copy link
Member Author

GUVWAF commented Jan 25, 2025

I wonder if we should place a warning comment about this to prevent that issue from future consumers?

Good point, added a warning for the function description.

Another related thought I'd like to pick your brain about as a long term idea is potentially rescheduling some of the broadcast intervals based on a trend of observed periods of dead space in the ch. utilization.

That's an interesting thought. I'm wondering if the dead spaces are common in larger meshes (where periodic broadcasts start becoming a problem), or it's already spread out quite well.
To take this into account we'd need to start storing more channel utilization history on-device though.

@b8b8
Copy link

b8b8 commented Jan 25, 2025

We actually switched to primes greater than 10 seconds apart but that can be switched to primes greater than 15 seconds apart as well. This was to eventually "effectively" spread one packet to ~15min, or all 4 packets sometime over the last hour as the time slowly drifts.
image

@thebentern thebentern merged commit 4747e73 into meshtastic:master Jan 26, 2025
56 checks passed
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.

3 participants