Meshtastic-Android icon indicating copy to clipboard operation
Meshtastic-Android copied to clipboard

[Bug]: Unable to change Map Reporting Interval (MQTT settings)

Open Nevermore-42 opened this issue 1 year ago • 4 comments

Contact Details

Discord nevermore42_

What happened?

The android client no longer allows changing the default value of the Map Reporting Interval under the MQTT settings. I've tried multiple entries, below and above the default 3600s, but everytime it displays error message as in the attached imaged (not allowing you to save changes)

Image

App Version

2.6.16

Phone

Pixel 7, Android 15

Device

Lilygo T-Echo

Firmware

2.6.11.60ec05e Alfa

Relevant log output


Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

Nevermore-42 avatar Jun 15 '25 16:06 Nevermore-42

One hour is the correct lower limit.

garthvh avatar Jun 15 '25 19:06 garthvh

One hour is the correct lower limit.

Thing is that if you try to set 2h, 12h (43200 as in the screenshot in the issue)... You just can't.

The app only allows 3600 as value.

skgsergio avatar Jun 15 '25 21:06 skgsergio

I could be wrong as I don't know Kotlin but my 2 cents:

The EditTextPreference component in MapReportingPreference for the reporting interval calls onValueChanged to onPublishIntervalSecsChanged1 which is passed as a parameter to MapReportingPreference2.

However, in MQTTConfigItemList when MapReportingPreference is called it doesn't pass a vale for publishIntervalSecs nor a function for onPublishIntervalSecsChanged3 so this interval is effectively not being used nor saved if I'm understanding it correctly.

diff --git a/app/src/main/java/com/geeksville/mesh/ui/radioconfig/components/MQTTConfigItemList.kt b/app/src/main/java/com/geeksville/mesh/ui/radioconfig/components/MQTTConfigItemList.kt
index f459331f..e7475ee2 100644
--- a/app/src/main/java/com/geeksville/mesh/ui/radioconfig/components/MQTTConfigItemList.kt
+++ b/app/src/main/java/com/geeksville/mesh/ui/radioconfig/components/MQTTConfigItemList.kt
@@ -233,6 +233,13 @@ fun MQTTConfigItemList(
                         mapReportSettings = settings
                     }
                 },
+                publishIntervalSecs = mqttInput.mapReportSettings.publishIntervalSecs,
+                onPublishIntervalSecsChanged = {
+                    val settings = mqttInput.mapReportSettings.copy { publishIntervalSecs = it }
+                    mqttInput = mqttInput.copy {
+                        mapReportSettings = settings
+                    }
+                },
                 enabled = enabled,
                 focusManager = focusManager
             )

Maybe?

skgsergio avatar Jun 16 '25 10:06 skgsergio

cc @jamesarich as it seems this commit is where the fetch and storage of the value was lost https://github.com/meshtastic/Meshtastic-Android/commit/3115bbe58daf0ebe104b3875b244f0da8944d32f#diff-d4e50a3c3218f66e33ac5cd4820bde36532276da0ffec200636ac0c76f6e7e3a

skgsergio avatar Jun 16 '25 13:06 skgsergio