Skip to content

Commit 1b45418

Browse files
committed
feat(MQTT): Send MapReporting immediately upon location fix
Do not update last_report_to_map when Map Report is attempted without a valid location, as this results in waiting up to an hour (or configured Map Report interval). That usually happens because most nodes do not keep GPS warm, so GPS usually locks after the first attempt at Map Report. This change also results in the log WARNing message getting spammed until a location is obtained, so remove the message for now. Signed-off-by: Andrew Yong <[email protected]>
1 parent e5ef90e commit 1b45418

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/mqtt/MQTT.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -844,11 +844,8 @@ void MQTT::perhapsReportToMap()
844844
if (Throttle::isWithinTimespanMs(last_report_to_map, map_publish_interval_msecs) && last_report_to_map != 0)
845845
return;
846846

847-
if (localPosition.latitude_i == 0 && localPosition.longitude_i == 0) {
848-
last_report_to_map = millis();
849-
LOG_WARN("MQTT Map report enabled, but no position available");
847+
if (localPosition.latitude_i == 0 && localPosition.longitude_i == 0)
850848
return;
851-
}
852849

853850
// Allocate MeshPacket and fill it
854851
meshtastic_MeshPacket *mp = packetPool.allocZeroed();

0 commit comments

Comments
 (0)