From 83cac93ca8ff1099064b0597f62c66699d5f0402 Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Fri, 27 Feb 2026 19:16:55 +0800 Subject: [PATCH 1/2] fix(MQTT): Send first MapReport as soon as possible (#8872) * fix(MQTT): First MapReport does not get sent Throttle::isWithinTimespanMs(last_report_to_map, map_publish_interval_msecs) is used to maintain the map reporting interval, but because last_report_to_map has an initial value of 0, the map report routine does not start until the system millis() time has passed map_publish_interval_msecs. Fix this by adding a check that last_report_to_map is not 0. Signed-off-by: Andrew Yong * 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 * feat(MQTT): Throttled warning when position is not available for MapReport Signed-off-by: Andrew Yong --------- Signed-off-by: Andrew Yong --- src/mqtt/MQTT.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 2c10c4b2b..3e039a86b 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -53,6 +53,9 @@ static uint8_t bytes[meshtastic_MqttClientProxyMessage_size + 30]; // 12 for cha static bool isMqttServerAddressPrivate = false; static bool isConnected = false; +static uint32_t lastPositionUnavailableWarning = 0; +static const uint32_t POSITION_UNAVAILABLE_WARNING_INTERVAL_MS = 15000; // 15 seconds + inline void onReceiveProto(char *topic, byte *payload, size_t length) { const DecodedServiceEnvelope e(payload, length); @@ -845,12 +848,14 @@ void MQTT::perhapsReportToMap() map_position_precision = default_map_position_precision; } - if (Throttle::isWithinTimespanMs(last_report_to_map, map_publish_interval_msecs)) + if (Throttle::isWithinTimespanMs(last_report_to_map, map_publish_interval_msecs) && last_report_to_map != 0) return; if (localPosition.latitude_i == 0 && localPosition.longitude_i == 0) { - last_report_to_map = millis(); - LOG_WARN("MQTT Map report enabled, but no position available"); + if (Throttle::isWithinTimespanMs(lastPositionUnavailableWarning, POSITION_UNAVAILABLE_WARNING_INTERVAL_MS) == false) { + LOG_WARN("MQTT Map report enabled, but no position available"); + lastPositionUnavailableWarning = millis(); + } return; } From 857c7b3a3ad24638e9be1b367431d744a1b9f0f1 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 27 Feb 2026 17:07:03 -0600 Subject: [PATCH 2/2] Don't launch canned message when waking screen or silencing notification (#9762) * Don't launch canned message when waking screen or silencing notification * Add screen ifdefs * Get the #if right --------- Co-authored-by: Ben Meadors --- src/input/InputBroker.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/input/InputBroker.cpp b/src/input/InputBroker.cpp index c0a56233f..acf79f149 100644 --- a/src/input/InputBroker.cpp +++ b/src/input/InputBroker.cpp @@ -100,13 +100,28 @@ void InputBroker::processInputEventQueue() int InputBroker::handleInputEvent(const InputEvent *event) { - powerFSM.trigger(EVENT_INPUT); // todo: not every input should wake, like long hold release +#if HAS_SCREEN + bool screenWasOff = false; + if (screen) { + screenWasOff = !screen->isScreenOn(); + } +#endif + powerFSM.trigger(EVENT_INPUT); if (event && event->inputEvent != INPUT_BROKER_NONE && externalNotificationModule && moduleConfig.external_notification.enabled && externalNotificationModule->nagging()) { externalNotificationModule->stopNow(); + // If this turns off a notification, don't further process the event + return 0; } +#if HAS_SCREEN + if (screen && screenWasOff) { + // If the screen was off, it is in the process of turning on, and we just drop the event + return 0; + } +#endif + this->notifyObservers(event); return 0; }