diff --git a/core/resources/src/commonMain/composeResources/values/strings.xml b/core/resources/src/commonMain/composeResources/values/strings.xml index 84e153e434..768e5585fa 100644 --- a/core/resources/src/commonMain/composeResources/values/strings.xml +++ b/core/resources/src/commonMain/composeResources/values/strings.xml @@ -1159,8 +1159,8 @@ Cannot reach broker (TCP) Timed out after %1$d ms TLS handshake failed: %1$s - MQTT proxy on this phone - This phone relays MQTT traffic for the connected device. Turn off to cut the relay immediately without changing the device's MQTT setting — useful when MQTT traffic is overwhelming the connection. Turn back on to resume relaying. + MQTT proxy in this app + This app relays MQTT traffic for the connected device. Turn off to cut the relay immediately without changing the device's MQTT setting, which helps when MQTT traffic is overwhelming the connection. Turn back on to resume relaying. Connected Connecting… Disconnected @@ -1785,7 +1785,7 @@ Time Timeout Timestamp - When this phone relays MQTT it always connects to mqtt.meshtastic.org over TLS. This setting applies when the radio reaches the broker over its own Wi-Fi or Ethernet. + When this app relays MQTT it always connects to mqtt.meshtastic.org over TLS. This setting applies when the radio reaches the broker over its own Wi-Fi or Ethernet. Toggle my position Trace Route diff --git a/desktopApp/src/main/kotlin/org/meshtastic/desktop/di/DesktopStubsModule.kt b/desktopApp/src/main/kotlin/org/meshtastic/desktop/di/DesktopStubsModule.kt index c15033acc6..6882a7da06 100644 --- a/desktopApp/src/main/kotlin/org/meshtastic/desktop/di/DesktopStubsModule.kt +++ b/desktopApp/src/main/kotlin/org/meshtastic/desktop/di/DesktopStubsModule.kt @@ -18,7 +18,6 @@ package org.meshtastic.desktop.di import org.koin.core.annotation.Module import org.koin.core.annotation.Single -import org.meshtastic.core.network.repository.MQTTRepository import org.meshtastic.core.repository.AppWidgetUpdater import org.meshtastic.core.repository.LocationRepository import org.meshtastic.core.repository.MeshLocationManager @@ -27,7 +26,6 @@ import org.meshtastic.core.repository.PlatformAnalytics import org.meshtastic.desktop.stub.NoopAppWidgetUpdater import org.meshtastic.desktop.stub.NoopCompassHeadingProvider import org.meshtastic.desktop.stub.NoopLocationRepository -import org.meshtastic.desktop.stub.NoopMQTTRepository import org.meshtastic.desktop.stub.NoopMagneticFieldProvider import org.meshtastic.desktop.stub.NoopMeshLocationManager import org.meshtastic.desktop.stub.NoopMeshWorkerManager @@ -39,8 +37,7 @@ import org.meshtastic.feature.node.compass.PhoneLocationProvider /** * Stubs for interfaces whose only real implementation needs Android APIs — WorkManager, widgets, location, sensors and - * analytics. [MQTTRepository] is the exception: it has a working `commonMain` implementation, and this binding - * deliberately shadows it because desktop does not run the MQTT bridge. + * analytics. */ @Module class DesktopStubsModule { @@ -55,8 +52,6 @@ class DesktopStubsModule { @Single fun locationRepository(): LocationRepository = NoopLocationRepository() - @Single fun mqttRepository(): MQTTRepository = NoopMQTTRepository() - @Single fun compassHeadingProvider(): CompassHeadingProvider = NoopCompassHeadingProvider() @Single fun phoneLocationProvider(): PhoneLocationProvider = NoopPhoneLocationProvider() diff --git a/desktopApp/src/main/kotlin/org/meshtastic/desktop/stub/NoopStubs.kt b/desktopApp/src/main/kotlin/org/meshtastic/desktop/stub/NoopStubs.kt index f2d3a1d0e0..2d8827d937 100644 --- a/desktopApp/src/main/kotlin/org/meshtastic/desktop/stub/NoopStubs.kt +++ b/desktopApp/src/main/kotlin/org/meshtastic/desktop/stub/NoopStubs.kt @@ -31,7 +31,6 @@ import org.meshtastic.core.model.ConnectionState import org.meshtastic.core.model.DeviceType import org.meshtastic.core.model.InterfaceId import org.meshtastic.core.model.MeshActivity -import org.meshtastic.core.network.repository.MQTTRepository import org.meshtastic.core.repository.AppWidgetUpdater import org.meshtastic.core.repository.DataPair import org.meshtastic.core.repository.Location @@ -45,9 +44,6 @@ import org.meshtastic.core.repository.RadioSessionContext import org.meshtastic.core.repository.RadioSessionLease import org.meshtastic.core.repository.ReceivedRadioFrame import org.meshtastic.core.repository.TransportDisconnectReason -import org.meshtastic.mqtt.MqttException -import org.meshtastic.proto.MqttClientProxyMessage -import org.meshtastic.mqtt.ConnectionState as MqttConnectionState import org.meshtastic.proto.Position as ProtoPosition /** @@ -173,19 +169,3 @@ class NoopLocationRepository : LocationRepository { } // endregion - -// region Network Stubs (MQTT — not yet available on Desktop) - -class NoopMQTTRepository : MQTTRepository { - override fun disconnect() {} - - override val proxyMessageFlow: Flow = emptyFlow() - - override fun publish(topic: String, data: ByteArray, retained: Boolean) {} - - override val connectionState = MutableStateFlow(MqttConnectionState.Disconnected.Idle) - - override val subscriptionRefusal = MutableStateFlow(null) -} - -// endregion diff --git a/desktopApp/src/test/kotlin/org/meshtastic/desktop/di/DesktopKoinTest.kt b/desktopApp/src/test/kotlin/org/meshtastic/desktop/di/DesktopKoinTest.kt index 9ab331e0aa..3e6e5a6e1e 100644 --- a/desktopApp/src/test/kotlin/org/meshtastic/desktop/di/DesktopKoinTest.kt +++ b/desktopApp/src/test/kotlin/org/meshtastic/desktop/di/DesktopKoinTest.kt @@ -26,8 +26,6 @@ import org.koin.plugin.module.dsl.koinApplication import org.koin.test.verify.verify import org.meshtastic.core.ble.BleLogFormat import org.meshtastic.core.ble.BleLogLevel -import org.meshtastic.core.network.repository.MQTTRepository -import org.meshtastic.desktop.stub.NoopMQTTRepository import org.meshtastic.feature.docs.translation.DocTranslationService import org.meshtastic.feature.docs.translation.NoOpDocTranslator import org.meshtastic.feature.messaging.translation.MessageTranslationService @@ -67,12 +65,10 @@ class DesktopKoinTest { @Test fun `desktop bindings win over the shared graph`() { // @Configuration modules load before the ones listed in @KoinApplication, and Koin is last-wins, so which - // binding survives is ordering-dependent. MQTTRepository is the live case: core:network commonMain declares - // MQTTRepositoryImpl, and desktop must shadow it. verify() only checks definitions exist, never who won. + // binding survives is ordering-dependent. verify() only checks definitions exist, never who won. val app = koinApplication() try { val koin = app.koin - assertIs(koin.get()) assertIs(koin.get()) assertIs(koin.get()) } finally { diff --git a/docs/en/user/mqtt.md b/docs/en/user/mqtt.md index 2773e32603..7ac83df679 100644 --- a/docs/en/user/mqtt.md +++ b/docs/en/user/mqtt.md @@ -48,13 +48,13 @@ A gateway node with internet access (Wi-Fi or Ethernet) publishes mesh messages | **JSON output enabled** | Also publish and consume the `/2/json/` topic. Deprecated in the protobuf schema, but still the only toggle for this behavior — and the app's own proxy honors it | Disabled | | **TLS enabled** | Secure connection to broker | Disabled | | **Map reporting** | Report position to public map | Disabled | -| **Proxy to client enabled** | Relay MQTT through the connected phone | Disabled | +| **Proxy to client enabled** | Relay MQTT through the connected app | Disabled | ### Connection Status and Test Connection -The top of the MQTT settings screen shows the status of the relay this phone runs — +The top of the MQTT settings screen shows the status of the relay this app runs: **Connected**, **Connecting**, **Reconnecting**, **Disconnected**, or **Inactive**. It reads -**Inactive** whenever the phone is not relaying, which includes the normal case of a radio +**Inactive** whenever the app is not relaying, which includes the normal case of a radio reaching the broker over its own Wi-Fi or Ethernet. The radio's own connection to the broker is not reported here. @@ -62,19 +62,17 @@ not reported here. distinguishes the failure modes: the hostname not resolving, the TCP connection being refused, TLS failing, the attempt timing out, or the broker rejecting your credentials with a reason. -### MQTT Proxy on This Phone +### MQTT Proxy in This App -If your radio has no internet access of its own, it can use the connected phone as its MQTT gateway: enable **MQTT** and **Proxy to client enabled** in the module config, and the app relays MQTT traffic between the radio and the broker over your phone's internet connection. +If your radio has no internet access of its own, it can use the app as its MQTT gateway: enable **MQTT** and **Proxy to client enabled** in the module config, and the app relays MQTT traffic between the radio and the broker over your phone's or computer's internet connection. -> ℹ️ **Note:** The proxy relay is mobile-only. On the Desktop app the MQTT settings are present, but no relay runs behind them. - -The **MQTT proxy on this phone** toggle at the top of the MQTT settings screen shows whether this relay is running and lets you cut it off (or restart it) immediately — without editing and re-saving the radio's MQTT configuration. +The **MQTT proxy in this app** toggle at the top of the MQTT settings screen shows whether this relay is running and lets you cut it off (or restart it) immediately, without editing and re-saving the radio's MQTT configuration. ### Default Meshtastic Broker The community maintains a public broker at `mqtt.meshtastic.org`. This is intended for general use and testing. -When this phone relays MQTT for the radio, connections to that broker always use TLS on port 8883 even if **TLS enabled** is off — that upgrade is the app's own, and the switch says so. A radio that reaches the broker over its own Wi-Fi or Ethernet forces nothing: it uses **TLS enabled** as stored, so turn it on yourself or the radio connects in the clear on port 1883. For any other broker the toggle decides in both cases (port 8883 with TLS, 1883 without). +When this app relays MQTT for the radio, connections to that broker always use TLS on port 8883 even if **TLS enabled** is off. That upgrade is the app's own, and the switch says so. A radio that reaches the broker over its own Wi-Fi or Ethernet forces nothing: it uses **TLS enabled** as stored, so turn it on yourself or the radio connects in the clear on port 1883. For any other broker the toggle decides in both cases (port 8883 with TLS, 1883 without). > 🔒 **Privacy:** Messages on the public broker are readable by anyone subscribed. Always use channel encryption for private communications. diff --git a/docs/en/user/settings-module-admin.md b/docs/en/user/settings-module-admin.md index cdf1253340..82451c6043 100644 --- a/docs/en/user/settings-module-admin.md +++ b/docs/en/user/settings-module-admin.md @@ -46,8 +46,8 @@ Bridges mesh messages to and from an MQTT broker for internet connectivity. This | JSON output enabled | Publish and consume MQTT messages as JSON. Marked deprecated in the protobuf schema, but it is still the only toggle for this behavior and the firmware still honors it | | TLS enabled | Use secure connection | | Root topic | Base MQTT topic path | -| Proxy to client enabled | Let a connected phone carry the node's MQTT traffic, instead of the node reaching the broker itself | -| MQTT proxy on this phone | The phone-side half of **Proxy to client enabled**: whether this phone acts as that relay. See [MQTT](mqtt) | +| Proxy to client enabled | Let the connected app carry the node's MQTT traffic, instead of the node reaching the broker itself | +| MQTT proxy in this app | The app-side half of **Proxy to client enabled**: whether this app acts as that relay. See [MQTT](mqtt) | | Map reporting | Publish position to the public map — see the Map reporting group that follows | Turning **Map reporting** on reveals a consent card headed *Consent to Share Unencrypted Node Data