From 6506de9ab163a4de049cec1baf26352cdb443fb3 Mon Sep 17 00:00:00 2001 From: andrekir Date: Thu, 12 Dec 2024 06:59:52 -0300 Subject: [PATCH 1/8] 2.5.14 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 27092f63a..14b474443 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "com.geeksville.mesh" minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works) targetSdk 34 - versionCode 30513 // format is Mmmss (where M is 1+the numeric major number - versionName "2.5.13" + versionCode 30514 // format is Mmmss (where M is 1+the numeric major number + versionName "2.5.14" testInstrumentationRunner "com.geeksville.mesh.TestRunner" // per https://developer.android.com/studio/write/vector-asset-studio From 22fafe8033b3b3b4cfb215362cad5df1c0c3f67d Mon Sep 17 00:00:00 2001 From: andrekir Date: Fri, 13 Dec 2024 16:00:11 -0300 Subject: [PATCH 2/8] refactor: remove protobuf dependency from `HardwareModel` --- .../geeksville/mesh/model/DeviceHardware.kt | 72 ++++++++++--------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/model/DeviceHardware.kt b/app/src/main/java/com/geeksville/mesh/model/DeviceHardware.kt index eb137599e..5be868cb5 100644 --- a/app/src/main/java/com/geeksville/mesh/model/DeviceHardware.kt +++ b/app/src/main/java/com/geeksville/mesh/model/DeviceHardware.kt @@ -17,6 +17,7 @@ package com.geeksville.mesh.model +import androidx.annotation.DrawableRes import com.geeksville.mesh.MeshProtos.HardwareModel import com.geeksville.mesh.R import kotlinx.serialization.Serializable @@ -29,7 +30,7 @@ data class DeviceHardware( val supportLevel: Int? = null, val displayName: String, val tags: List? = listOf(), - val image: Int, + @DrawableRes val image: Int, val requiresDfu: Boolean? = null, ) @@ -54,44 +55,45 @@ data class DeviceHardwareDto( supportLevel = supportLevel, displayName = displayName, tags = tags, - image = HardwareModel.forNumber(hwModel).getDeviceVectorImage(), + image = getDrawableFrom(hwModel), requiresDfu = requiresDfu ) } @Suppress("CyclomaticComplexMethod") -private fun HardwareModel.getDeviceVectorImage(): Int = when (this) { - HardwareModel.DIY_V1 -> R.drawable.hw_diy - HardwareModel.HELTEC_HT62 -> R.drawable.hw_heltec_ht62_esp32c3_sx1262 - HardwareModel.HELTEC_MESH_NODE_T114 -> R.drawable.hw_heltec_mesh_node_t114 - HardwareModel.HELTEC_V3 -> R.drawable.hw_heltec_v3 - HardwareModel.HELTEC_VISION_MASTER_E213 -> R.drawable.hw_heltec_vision_master_e213 - HardwareModel.HELTEC_VISION_MASTER_E290 -> R.drawable.hw_heltec_vision_master_e290 - HardwareModel.HELTEC_VISION_MASTER_T190 -> R.drawable.hw_heltec_vision_master_t190 - HardwareModel.HELTEC_WIRELESS_PAPER -> R.drawable.hw_heltec_wireless_paper - HardwareModel.HELTEC_WIRELESS_TRACKER -> R.drawable.hw_heltec_wireless_tracker - HardwareModel.HELTEC_WIRELESS_TRACKER_V1_0 -> R.drawable.hw_heltec_wireless_tracker_v1_0 - HardwareModel.HELTEC_WSL_V3 -> R.drawable.hw_heltec_wsl_v3 - HardwareModel.NANO_G2_ULTRA -> R.drawable.hw_nano_g2_ultra - HardwareModel.RPI_PICO -> R.drawable.hw_pico - HardwareModel.NRF52_PROMICRO_DIY -> R.drawable.hw_promicro - HardwareModel.RAK11310 -> R.drawable.hw_rak11310 - HardwareModel.RAK4631 -> R.drawable.hw_rak4631 - HardwareModel.RPI_PICO2 -> R.drawable.hw_rpipicow - HardwareModel.SENSECAP_INDICATOR -> R.drawable.hw_seeed_sensecap_indicator - HardwareModel.SEEED_XIAO_S3 -> R.drawable.hw_seeed_xiao_s3 - HardwareModel.STATION_G2 -> R.drawable.hw_station_g2 - HardwareModel.T_DECK -> R.drawable.hw_t_deck - HardwareModel.T_ECHO -> R.drawable.hw_t_echo - HardwareModel.T_WATCH_S3 -> R.drawable.hw_t_watch_s3 - HardwareModel.TBEAM -> R.drawable.hw_tbeam - HardwareModel.LILYGO_TBEAM_S3_CORE -> R.drawable.hw_tbeam_s3_core - HardwareModel.TLORA_C6 -> R.drawable.hw_tlora_c6 - HardwareModel.TLORA_T3_S3 -> R.drawable.hw_tlora_t3s3_v1 - HardwareModel.TLORA_V2_1_1P6 -> R.drawable.hw_tlora_v2_1_1_6 - HardwareModel.TLORA_V2_1_1P8 -> R.drawable.hw_tlora_v2_1_1_8 - HardwareModel.TRACKER_T1000_E -> R.drawable.hw_tracker_t1000_e - HardwareModel.WIO_WM1110 -> R.drawable.hw_wio_tracker_wm1110 - HardwareModel.WISMESH_TAP -> R.drawable.hw_rak_wismeshtap +@DrawableRes +private fun getDrawableFrom(hwModel: Int): Int = when (hwModel) { + HardwareModel.DIY_V1_VALUE -> R.drawable.hw_diy + HardwareModel.HELTEC_HT62_VALUE -> R.drawable.hw_heltec_ht62_esp32c3_sx1262 + HardwareModel.HELTEC_MESH_NODE_T114_VALUE -> R.drawable.hw_heltec_mesh_node_t114 + HardwareModel.HELTEC_V3_VALUE -> R.drawable.hw_heltec_v3 + HardwareModel.HELTEC_VISION_MASTER_E213_VALUE -> R.drawable.hw_heltec_vision_master_e213 + HardwareModel.HELTEC_VISION_MASTER_E290_VALUE -> R.drawable.hw_heltec_vision_master_e290 + HardwareModel.HELTEC_VISION_MASTER_T190_VALUE -> R.drawable.hw_heltec_vision_master_t190 + HardwareModel.HELTEC_WIRELESS_PAPER_VALUE -> R.drawable.hw_heltec_wireless_paper + HardwareModel.HELTEC_WIRELESS_TRACKER_VALUE -> R.drawable.hw_heltec_wireless_tracker + HardwareModel.HELTEC_WIRELESS_TRACKER_V1_0_VALUE -> R.drawable.hw_heltec_wireless_tracker_v1_0 + HardwareModel.HELTEC_WSL_V3_VALUE -> R.drawable.hw_heltec_wsl_v3 + HardwareModel.NANO_G2_ULTRA_VALUE -> R.drawable.hw_nano_g2_ultra + HardwareModel.RPI_PICO_VALUE -> R.drawable.hw_pico + HardwareModel.NRF52_PROMICRO_DIY_VALUE -> R.drawable.hw_promicro + HardwareModel.RAK11310_VALUE -> R.drawable.hw_rak11310 + HardwareModel.RAK4631_VALUE -> R.drawable.hw_rak4631 + HardwareModel.RPI_PICO2_VALUE -> R.drawable.hw_rpipicow + HardwareModel.SENSECAP_INDICATOR_VALUE -> R.drawable.hw_seeed_sensecap_indicator + HardwareModel.SEEED_XIAO_S3_VALUE -> R.drawable.hw_seeed_xiao_s3 + HardwareModel.STATION_G2_VALUE -> R.drawable.hw_station_g2 + HardwareModel.T_DECK_VALUE -> R.drawable.hw_t_deck + HardwareModel.T_ECHO_VALUE -> R.drawable.hw_t_echo + HardwareModel.T_WATCH_S3_VALUE -> R.drawable.hw_t_watch_s3 + HardwareModel.TBEAM_VALUE -> R.drawable.hw_tbeam + HardwareModel.LILYGO_TBEAM_S3_CORE_VALUE -> R.drawable.hw_tbeam_s3_core + HardwareModel.TLORA_C6_VALUE -> R.drawable.hw_tlora_c6 + HardwareModel.TLORA_T3_S3_VALUE -> R.drawable.hw_tlora_t3s3_v1 + HardwareModel.TLORA_V2_1_1P6_VALUE -> R.drawable.hw_tlora_v2_1_1_6 + HardwareModel.TLORA_V2_1_1P8_VALUE -> R.drawable.hw_tlora_v2_1_1_8 + HardwareModel.TRACKER_T1000_E_VALUE -> R.drawable.hw_tracker_t1000_e + HardwareModel.WIO_WM1110_VALUE -> R.drawable.hw_wio_tracker_wm1110 + HardwareModel.WISMESH_TAP_VALUE -> R.drawable.hw_rak_wismeshtap else -> R.drawable.hw_unknown } From 193ee727b5909308d99ed7475da4a0d77dc1757e Mon Sep 17 00:00:00 2001 From: andrekir Date: Sat, 14 Dec 2024 05:59:41 -0300 Subject: [PATCH 3/8] feat(serial): send heartbeat to keep connection alive closes #456 --- .../repository/radio/RadioInterfaceService.kt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/geeksville/mesh/repository/radio/RadioInterfaceService.kt b/app/src/main/java/com/geeksville/mesh/repository/radio/RadioInterfaceService.kt index 2b629cd69..b6963a233 100644 --- a/app/src/main/java/com/geeksville/mesh/repository/radio/RadioInterfaceService.kt +++ b/app/src/main/java/com/geeksville/mesh/repository/radio/RadioInterfaceService.kt @@ -23,6 +23,7 @@ import androidx.core.content.edit import androidx.lifecycle.Lifecycle import androidx.lifecycle.coroutineScope import com.geeksville.mesh.CoroutineDispatchers +import com.geeksville.mesh.MeshProtos import com.geeksville.mesh.android.BinaryLogFile import com.geeksville.mesh.android.BuildUtils import com.geeksville.mesh.android.GeeksvilleApplication @@ -110,8 +111,20 @@ class RadioInterfaceService @Inject constructor( }.launchIn(processLifecycle.coroutineScope) } - companion object : Logging { + companion object { const val DEVADDR_KEY = "devAddr2" // the new name for devaddr + private const val HEARTBEAT_INTERVAL_MILLIS = 5 * 60 * 1000L + } + + private var lastHeartbeatMillis = 0L + private fun keepAlive(now: Long) { + if (now - lastHeartbeatMillis > HEARTBEAT_INTERVAL_MILLIS) { + info("Sending ToRadio heartbeat") + val heartbeat = MeshProtos.ToRadio.newBuilder() + .setHeartbeat(MeshProtos.Heartbeat.getDefaultInstance()).build() + handleSendToRadio(heartbeat.toByteArray()) + lastHeartbeatMillis = now + } } /** @@ -184,6 +197,10 @@ class RadioInterfaceService @Inject constructor( receivedPacketsLog.flush() } + if (radioIf is SerialInterface) { + keepAlive(System.currentTimeMillis()) + } + // ignoreException { debug("FromRadio: ${MeshProtos.FromRadio.parseFrom(p)}") } processLifecycle.coroutineScope.launch(dispatchers.io) { From ef9a1e49ac851c19f76b6a4fef2ab4a943964bce Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 19:54:16 +0000 Subject: [PATCH 4/8] chore(deps): update com.google.firebase:firebase-bom to v33.7.0 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 14b474443..76cf5406c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -239,7 +239,7 @@ dependencies { implementation 'com.github.mik3y:usb-serial-for-android:3.8.1' // For Firebase Crashlytics & Analytics - googleImplementation platform('com.google.firebase:firebase-bom:33.5.1') + googleImplementation platform('com.google.firebase:firebase-bom:33.7.0') googleImplementation 'com.google.firebase:firebase-crashlytics' googleImplementation 'com.google.firebase:firebase-analytics' From d2a70b15c08557f26ebf9956f5aa8b6c711183ae Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 22:14:38 +0000 Subject: [PATCH 5/8] chore(deps): update protobuf_version to v4.29.1 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f82d8d8e5..989829e77 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { useCrashlytics = false kotlin_version = '2.0.21' hilt_version = '2.52' - protobuf_version = '4.28.3' + protobuf_version = '4.29.1' } repositories { From 7a321ecc912aa2a1dea09870fd206a3990f1e1e1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 09:18:32 +0000 Subject: [PATCH 6/8] chore(deps): update hilt_version to v2.53.1 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 989829e77..4243d631e 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { ext { useCrashlytics = false kotlin_version = '2.0.21' - hilt_version = '2.52' + hilt_version = '2.53.1' protobuf_version = '4.29.1' } From 84e418391881cafb5a8bc7c5e4f712ffe140c3f0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:15:25 +0000 Subject: [PATCH 7/8] chore(deps): update nav_version to v2.8.5 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 76cf5406c..1cf6553f5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -184,7 +184,7 @@ dependencies { kspAndroidTest "com.google.dagger:hilt-compiler:$hilt_version" // Navigation - def nav_version = "2.8.4" + def nav_version = "2.8.5" implementation "androidx.navigation:navigation-compose:$nav_version" androidTestImplementation "androidx.navigation:navigation-testing:$nav_version" From 066e44ae00f981393633704d260ce4c53a181edb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:15:29 +0000 Subject: [PATCH 8/8] chore(deps): update androidx.compose:compose-bom to v2024.12.01 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 1cf6553f5..f1a03d1fb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -189,7 +189,7 @@ dependencies { androidTestImplementation "androidx.navigation:navigation-testing:$nav_version" // Compose - def composeBom = platform('androidx.compose:compose-bom:2024.11.00') + def composeBom = platform('androidx.compose:compose-bom:2024.12.01') implementation composeBom androidTestImplementation composeBom