From 9046a1f766aefdeea7124c2d29950c3c2aab1b58 Mon Sep 17 00:00:00 2001 From: Tavis Date: Thu, 11 Jul 2024 13:03:32 -1000 Subject: [PATCH] need to set the variant type for it to work. --- src/modules/SerialModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/SerialModule.cpp b/src/modules/SerialModule.cpp index e4221151f..a16eadd9f 100644 --- a/src/modules/SerialModule.cpp +++ b/src/modules/SerialModule.cpp @@ -308,6 +308,7 @@ int32_t SerialModule::runOnce() // make a telemetry packet with the data meshtastic_Telemetry m = meshtastic_Telemetry_init_zero; + m.which_variant = meshtastic_Telemetry_environment_metrics_tag; m.variant.environment_metrics.wind_speed = velAvg; m.variant.environment_metrics.wind_direction = dirAvg; m.variant.environment_metrics.wind_gust = gust; @@ -326,7 +327,7 @@ int32_t SerialModule::runOnce() p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &meshtastic_Telemetry_msg, &m); - LOG_INFO("payload : %s", p->decoded.payload.bytes); + LOG_INFO("payload size : %i\n", p->decoded.payload.size); p->to = NODENUM_BROADCAST; p->decoded.want_response = false; p->priority = meshtastic_MeshPacket_Priority_RELIABLE;