From e2b6375fac9fd4516bf774601099b289fe6ee66e Mon Sep 17 00:00:00 2001 From: "Justin E. Mann" Date: Thu, 17 Apr 2025 17:00:20 -0600 Subject: [PATCH] cleanup --- .../Telemetry/Sensor/RAK12035Sensor.cpp | 22 ++----------------- variants/rak4631_epaper/platformio.ini | 2 +- variants/rak4631_epaper_onrxtx/platformio.ini | 2 +- variants/rak_wismeshtap/platformio.ini | 2 +- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/modules/Telemetry/Sensor/RAK12035Sensor.cpp b/src/modules/Telemetry/Sensor/RAK12035Sensor.cpp index b31e34ee5..f3bd023e2 100644 --- a/src/modules/Telemetry/Sensor/RAK12035Sensor.cpp +++ b/src/modules/Telemetry/Sensor/RAK12035Sensor.cpp @@ -8,13 +8,13 @@ RAK12035Sensor::RAK12035Sensor() : TelemetrySensor(meshtastic_TelemetrySensorTyp int32_t RAK12035Sensor::runOnce() { + LOG_INFO("Init sensor: %s", sensorName); if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; } - sensor.set_sensor_addr(RAK120351_ADDR); - + delay(500); sensor.begin(nodeTelemetrySensorsMap[sensorType].first); // Get sensor firmware version uint8_t data = 0; @@ -92,27 +92,9 @@ bool RAK12035Sensor::getMetrics(meshtastic_Telemetry *measurement) LOG_ERROR("Failed to read sensor data"); return false; } - LOG_INFO("Successful read from sensor Temperature: %.2f, Moisture: %ld%", (double)(temp / 10), moisture); measurement->variant.environment_metrics.soil_temperature = (float)(temp / 10); measurement->variant.environment_metrics.soil_moisture = moisture; - LOG_INFO("Check if the original temperature and moisture (relative_humidity) are being used.. if not just use them for the " - "soil monitoring."); - - if (!measurement->variant.environment_metrics.has_temperature) { - LOG_INFO("Overwrite the temp metrics (not being set right now and this will allow the soil temp value to be used in the " - "client interface)."); - measurement->variant.environment_metrics.has_temperature = true; - measurement->variant.environment_metrics.temperature = (float)(temp / 10); - } - - if (!measurement->variant.environment_metrics.has_relative_humidity) { - LOG_INFO("Overwrite the moisture metrics (not being used for air humidity and this will allow the soil humidity to " - "appear in the client interfaces without adjustments)."); - measurement->variant.environment_metrics.has_relative_humidity = true; - measurement->variant.environment_metrics.relative_humidity = (float)moisture; - } - return true; } #endif diff --git a/variants/rak4631_epaper/platformio.ini b/variants/rak4631_epaper/platformio.ini index 9fe7ac1c7..35fba1a2c 100644 --- a/variants/rak4631_epaper/platformio.ini +++ b/variants/rak4631_epaper/platformio.ini @@ -17,7 +17,7 @@ lib_deps = melopero/Melopero RV3028@^1.1.0 rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2 beegee-tokyo/RAKwireless RAK12034@^1.0.0 - beegee-tokyo/RAK12035_SoilMoisture@^1.0.3 + beegee-tokyo/RAK12035_SoilMoisture@^1.0.4 debug_tool = jlink ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) ;upload_protocol = jlink diff --git a/variants/rak4631_epaper_onrxtx/platformio.ini b/variants/rak4631_epaper_onrxtx/platformio.ini index c5300243d..256b3b7d4 100644 --- a/variants/rak4631_epaper_onrxtx/platformio.ini +++ b/variants/rak4631_epaper_onrxtx/platformio.ini @@ -19,7 +19,7 @@ lib_deps = melopero/Melopero RV3028@^1.1.0 rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2 beegee-tokyo/RAKwireless RAK12034@^1.0.0 - beegee-tokyo/RAK12035_SoilMoisture@^1.0.3 + beegee-tokyo/RAK12035_SoilMoisture@^1.0.4 debug_tool = jlink ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) ;upload_protocol = jlink diff --git a/variants/rak_wismeshtap/platformio.ini b/variants/rak_wismeshtap/platformio.ini index 446ff43ec..421683f96 100644 --- a/variants/rak_wismeshtap/platformio.ini +++ b/variants/rak_wismeshtap/platformio.ini @@ -23,7 +23,7 @@ lib_deps = bodmer/TFT_eSPI beegee-tokyo/RAKwireless RAK12034@^1.0.0 beegee-tokyo/RAK14014-FT6336U @ 1.0.1 - beegee-tokyo/RAK12035_SoilMoisture@^1.0.3 + beegee-tokyo/RAK12035_SoilMoisture@^1.0.4 debug_tool = jlink ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) ;upload_protocol = jlink