From 440f3fd47f1e086003e84b4c607aa287d351ac72 Mon Sep 17 00:00:00 2001 From: "Justin E. Mann" Date: Mon, 5 May 2025 12:05:25 -0600 Subject: [PATCH] little bit of cleanup and recompile/upload/test on RAK WISBLAOCK STACK: RAK19007/RAK4631/RAK12035VB/RAK12500 looks like soil monitor is working correctly, new environmental metrics are comming thru [new protos soil_moisture, soil_temperature] and GPS is working again with the RAK 12500. improvements could be made around the configuration of the monitor. next steps include updating the client(s) to react to, log and display the new proto metrics for soil temp and humidity. --- src/modules/Telemetry/EnvironmentTelemetry.cpp | 10 +++++----- src/modules/Telemetry/Sensor/RAK12035Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/RAK12035Sensor.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index d6eb4590f..1e2d34e79 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -94,11 +94,11 @@ SHTC3Sensor shtc3Sensor; NullSensor shtc3Sensor; #endif -#if __has_include() && defined(RAK4630) +#if __has_include() && defined(RAK_4631) #include "Sensor/RAK12035Sensor.h" RAK12035Sensor rak12035Sensor; #else -NullSensor shtc3Sensor; +NullSensor rak12035Sensor; #endif #if __has_include() @@ -279,7 +279,7 @@ int32_t EnvironmentTelemetryModule::runOnce() result = rak9154Sensor.runOnce(); #endif -#ifdef RAK4630 +#if __has_include("RAK12035_SoilMoisture.h") && defined(RAK_4631) if (rak12035Sensor.hasSensor()) { result = rak12035Sensor.runOnce(); } @@ -613,7 +613,7 @@ bool EnvironmentTelemetryModule::getEnvironmentTelemetry(meshtastic_Telemetry *m valid = valid && rak9154Sensor.getMetrics(m); hasSensor = true; #endif -#ifdef RAK4630 +#if __has_include() && defined(RAK_4631) // Not really needed, but may as well just skip at a lower level it if no library or not a RAK_4631 if (rak12035Sensor.hasSensor()) { valid = valid && rak12035Sensor.getMetrics(m); hasSensor = true; @@ -834,7 +834,7 @@ AdminMessageHandleResult EnvironmentTelemetryModule::handleAdminMessageForModule if (result != AdminMessageHandleResult::NOT_HANDLED) return result; } -#ifdef RAK4630 +#if __has_include() && defined(RAK_4631) // Not really needed, but may as well just skip it at a lower level if no library or not a RAK_4631 if (rak12035Sensor.hasSensor()) { result = rak12035Sensor.handleAdminMessage(mp, request, response); if (result != AdminMessageHandleResult::NOT_HANDLED) diff --git a/src/modules/Telemetry/Sensor/RAK12035Sensor.cpp b/src/modules/Telemetry/Sensor/RAK12035Sensor.cpp index f3bd023e2..d1e9b3718 100644 --- a/src/modules/Telemetry/Sensor/RAK12035Sensor.cpp +++ b/src/modules/Telemetry/Sensor/RAK12035Sensor.cpp @@ -1,5 +1,5 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && defined(RAK4630) +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include("RAK12035_SoilMoisture.h") && defined(RAK_4631) #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "RAK12035Sensor.h" diff --git a/src/modules/Telemetry/Sensor/RAK12035Sensor.h b/src/modules/Telemetry/Sensor/RAK12035Sensor.h index 77ffe24fa..5d7082f20 100644 --- a/src/modules/Telemetry/Sensor/RAK12035Sensor.h +++ b/src/modules/Telemetry/Sensor/RAK12035Sensor.h @@ -2,7 +2,7 @@ #include "configuration.h" -#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && defined(RAK4630) +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include() && defined(RAK_4631) #ifndef _MT_RAK12035VBSENSOR_H #define _MT_RAK12035VBSENSOR_H #endif