From 3398a52a346263ff88a441e325d549242691aae7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 17 May 2025 06:15:44 -0500 Subject: [PATCH 1/4] Update meshtastic/device-ui digest to 55f7152 (#6830) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index b78ecdc1a..d5a954a80 100644 --- a/platformio.ini +++ b/platformio.ini @@ -108,7 +108,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/7dee10ad31a0c6ea04880cba399e240be743d752.zip + https://github.com/meshtastic/device-ui/archive/55f71527f3137ed4eabc258498d5c6ad9f610674.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From a50a94150aba14aaba1639412c535e8f6e99a4ad Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 17 May 2025 10:44:02 -0500 Subject: [PATCH 2/4] [create-pull-request] automated change (#6834) Co-authored-by: jp-bennett <5630967+jp-bennett@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/telemetry.pb.h | 27 ++++++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/protobufs b/protobufs index 4eb0aebae..475694e62 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 4eb0aebaef1304a5516b6fa864cb4c55daed9147 +Subproject commit 475694e62b0fdac3469abc15c6d66d05fc9ad69a diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 1c5eb4843..4cce7ca33 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -89,7 +89,9 @@ typedef enum _meshtastic_TelemetrySensorType { /* RAKWireless RAK12035 Soil Moisture Sensor Module */ meshtastic_TelemetrySensorType_RAK12035 = 37, /* MAX17261 lipo battery gauge */ - meshtastic_TelemetrySensorType_MAX17261 = 38 + meshtastic_TelemetrySensorType_MAX17261 = 38, + /* PCT2075 Temperature Sensor */ + meshtastic_TelemetrySensorType_PCT2075 = 39 } meshtastic_TelemetrySensorType; /* Struct definitions */ @@ -310,6 +312,9 @@ typedef struct _meshtastic_HostMetrics { uint16_t load5; /* Host system fifteen minute load in 1/100ths */ uint16_t load15; + /* Optional User-provided string for arbitrary host system information + that doesn't make sense as a dedicated entry. */ + pb_callback_t user_string; } meshtastic_HostMetrics; /* Types of Measurements the telemetry module is equipped to handle */ @@ -350,8 +355,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_MAX17261 -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_MAX17261+1)) +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_PCT2075 +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_PCT2075+1)) @@ -370,7 +375,7 @@ extern "C" { #define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0} -#define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0} +#define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0, {{NULL}, NULL}} #define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}} #define meshtastic_Nau7802Config_init_default {0, 0} #define meshtastic_DeviceMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0} @@ -379,7 +384,7 @@ extern "C" { #define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0} -#define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0} +#define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0, {{NULL}, NULL}} #define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}} #define meshtastic_Nau7802Config_init_zero {0, 0} @@ -452,6 +457,7 @@ extern "C" { #define meshtastic_HostMetrics_load1_tag 6 #define meshtastic_HostMetrics_load5_tag 7 #define meshtastic_HostMetrics_load15_tag 8 +#define meshtastic_HostMetrics_user_string_tag 9 #define meshtastic_Telemetry_time_tag 1 #define meshtastic_Telemetry_device_metrics_tag 2 #define meshtastic_Telemetry_environment_metrics_tag 3 @@ -556,8 +562,9 @@ X(a, STATIC, OPTIONAL, UINT64, diskfree2_bytes, 4) \ X(a, STATIC, OPTIONAL, UINT64, diskfree3_bytes, 5) \ X(a, STATIC, SINGULAR, UINT32, load1, 6) \ X(a, STATIC, SINGULAR, UINT32, load5, 7) \ -X(a, STATIC, SINGULAR, UINT32, load15, 8) -#define meshtastic_HostMetrics_CALLBACK NULL +X(a, STATIC, SINGULAR, UINT32, load15, 8) \ +X(a, CALLBACK, OPTIONAL, STRING, user_string, 9) +#define meshtastic_HostMetrics_CALLBACK pb_default_field_callback #define meshtastic_HostMetrics_DEFAULT NULL #define meshtastic_Telemetry_FIELDLIST(X, a) \ @@ -607,16 +614,16 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg; #define meshtastic_Nau7802Config_fields &meshtastic_Nau7802Config_msg /* Maximum encoded size of messages (where known) */ -#define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_Telemetry_size +/* meshtastic_HostMetrics_size depends on runtime parameters */ +/* meshtastic_Telemetry_size depends on runtime parameters */ +#define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_EnvironmentMetrics_size #define meshtastic_AirQualityMetrics_size 78 #define meshtastic_DeviceMetrics_size 27 #define meshtastic_EnvironmentMetrics_size 113 #define meshtastic_HealthMetrics_size 11 -#define meshtastic_HostMetrics_size 62 #define meshtastic_LocalStats_size 60 #define meshtastic_Nau7802Config_size 16 #define meshtastic_PowerMetrics_size 30 -#define meshtastic_Telemetry_size 120 #ifdef __cplusplus } /* extern "C" */ From 5b312ab9175402d41cafe1c0a29f4c6a45f8c3a2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 17 May 2025 12:29:18 -0500 Subject: [PATCH 3/4] [create-pull-request] automated change (#6836) Co-authored-by: jp-bennett <5630967+jp-bennett@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/telemetry.pb.cpp | 4 ++-- src/mesh/generated/meshtastic/telemetry.pb.h | 17 +++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/protobufs b/protobufs index 475694e62..d8b709aa5 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 475694e62b0fdac3469abc15c6d66d05fc9ad69a +Subproject commit d8b709aa5da85959a80a06a6624761678a96f9c0 diff --git a/src/mesh/generated/meshtastic/telemetry.pb.cpp b/src/mesh/generated/meshtastic/telemetry.pb.cpp index b54cbb00e..345d7a157 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.cpp +++ b/src/mesh/generated/meshtastic/telemetry.pb.cpp @@ -24,10 +24,10 @@ PB_BIND(meshtastic_LocalStats, meshtastic_LocalStats, AUTO) PB_BIND(meshtastic_HealthMetrics, meshtastic_HealthMetrics, AUTO) -PB_BIND(meshtastic_HostMetrics, meshtastic_HostMetrics, AUTO) +PB_BIND(meshtastic_HostMetrics, meshtastic_HostMetrics, 2) -PB_BIND(meshtastic_Telemetry, meshtastic_Telemetry, AUTO) +PB_BIND(meshtastic_Telemetry, meshtastic_Telemetry, 2) PB_BIND(meshtastic_Nau7802Config, meshtastic_Nau7802Config, AUTO) diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 4cce7ca33..4071c611e 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -314,7 +314,8 @@ typedef struct _meshtastic_HostMetrics { uint16_t load15; /* Optional User-provided string for arbitrary host system information that doesn't make sense as a dedicated entry. */ - pb_callback_t user_string; + bool has_user_string; + char user_string[200]; } meshtastic_HostMetrics; /* Types of Measurements the telemetry module is equipped to handle */ @@ -375,7 +376,7 @@ extern "C" { #define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_default {false, 0, false, 0, false, 0} -#define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0, {{NULL}, NULL}} +#define meshtastic_HostMetrics_init_default {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""} #define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}} #define meshtastic_Nau7802Config_init_default {0, 0} #define meshtastic_DeviceMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0} @@ -384,7 +385,7 @@ extern "C" { #define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_HealthMetrics_init_zero {false, 0, false, 0, false, 0} -#define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0, {{NULL}, NULL}} +#define meshtastic_HostMetrics_init_zero {0, 0, 0, false, 0, false, 0, 0, 0, 0, false, ""} #define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}} #define meshtastic_Nau7802Config_init_zero {0, 0} @@ -563,8 +564,8 @@ X(a, STATIC, OPTIONAL, UINT64, diskfree3_bytes, 5) \ X(a, STATIC, SINGULAR, UINT32, load1, 6) \ X(a, STATIC, SINGULAR, UINT32, load5, 7) \ X(a, STATIC, SINGULAR, UINT32, load15, 8) \ -X(a, CALLBACK, OPTIONAL, STRING, user_string, 9) -#define meshtastic_HostMetrics_CALLBACK pb_default_field_callback +X(a, STATIC, OPTIONAL, STRING, user_string, 9) +#define meshtastic_HostMetrics_CALLBACK NULL #define meshtastic_HostMetrics_DEFAULT NULL #define meshtastic_Telemetry_FIELDLIST(X, a) \ @@ -614,16 +615,16 @@ extern const pb_msgdesc_t meshtastic_Nau7802Config_msg; #define meshtastic_Nau7802Config_fields &meshtastic_Nau7802Config_msg /* Maximum encoded size of messages (where known) */ -/* meshtastic_HostMetrics_size depends on runtime parameters */ -/* meshtastic_Telemetry_size depends on runtime parameters */ -#define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_EnvironmentMetrics_size +#define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_Telemetry_size #define meshtastic_AirQualityMetrics_size 78 #define meshtastic_DeviceMetrics_size 27 #define meshtastic_EnvironmentMetrics_size 113 #define meshtastic_HealthMetrics_size 11 +#define meshtastic_HostMetrics_size 264 #define meshtastic_LocalStats_size 60 #define meshtastic_Nau7802Config_size 16 #define meshtastic_PowerMetrics_size 30 +#define meshtastic_Telemetry_size 272 #ifdef __cplusplus } /* extern "C" */ From 61e4eb12e63db87d9f7839d29f5042d329b8e32f Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 17 May 2025 14:02:39 -0500 Subject: [PATCH 4/4] Use the _init_zero macro correctly for HostMetrics (#6837) --- src/modules/Telemetry/HostMetrics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/Telemetry/HostMetrics.cpp b/src/modules/Telemetry/HostMetrics.cpp index 655be4b25..d1e5bdd00 100644 --- a/src/modules/Telemetry/HostMetrics.cpp +++ b/src/modules/Telemetry/HostMetrics.cpp @@ -69,8 +69,9 @@ meshtastic_MeshPacket *HostMetricsModule::allocReply() meshtastic_Telemetry HostMetricsModule::getHostMetrics() { std::string file_line; - meshtastic_Telemetry t = meshtastic_HostMetrics_init_zero; + meshtastic_Telemetry t = meshtastic_Telemetry_init_zero; t.which_variant = meshtastic_Telemetry_host_metrics_tag; + t.variant.host_metrics = meshtastic_HostMetrics_init_zero; if (access("/proc/uptime", R_OK) == 0) { std::ifstream proc_uptime("/proc/uptime");