Send environment telemetry every minute (#1808)

This commit is contained in:
Ben Meadors
2022-10-16 11:36:38 -05:00
committed by GitHub
parent d8f44d7b1b
commit fc57a9daa4
3 changed files with 28 additions and 14 deletions

View File

@@ -15,8 +15,9 @@ int32_t DeviceTelemetryModule::runOnce()
{
#ifndef ARCH_PORTDUINO
uint32_t now = millis();
if ((lastSentToMesh == 0 || (now - lastSentToMesh) >= getConfiguredOrDefaultMs(moduleConfig.telemetry.device_update_interval))
&& airTime->channelUtilizationPercent() < max_channel_util_percent) {
if ((lastSentToMesh == 0 ||
(now - lastSentToMesh) >= getConfiguredOrDefaultMs(moduleConfig.telemetry.device_update_interval)) &&
airTime->channelUtilizationPercent() < max_channel_util_percent) {
sendTelemetry();
lastSentToMesh = now;
} else if (service.isToPhoneQueueEmpty()) {