diff --git a/debian/changelog b/debian/changelog index 035d5f0341..8b1799c52d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ -meshtasticd (2.5.19.0) UNRELEASED; urgency=medium +meshtasticd (2.5.20.0) UNRELEASED; urgency=medium * Initial packaging + * GitHub Actions Automatic version bump - -- Austin Lane Thu, 02 Jan 2025 12:00:00 +0000 \ No newline at end of file + -- Austin Lane Mon, 13 Jan 2025 19:24:14 +0000 diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index be5df6f636..2fc9bab0bc 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -222,7 +222,11 @@ void EnvironmentTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiSt } // Display "Env. From: ..." on its own - display->drawString(x, y, "Env. From: " + String(lastSender) + "(" + String(agoSecs) + "s)"); + display->drawString(x, y, "Env. From: " + String(lastSender) + " (" + String(agoSecs) + "s)"); + + // Prepare sensor data strings + String sensorData[10]; + int sensorCount = 0; if (lastMeasurement.variant.environment_metrics.has_temperature || lastMeasurement.variant.environment_metrics.has_relative_humidity) { @@ -232,48 +236,73 @@ void EnvironmentTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiSt String(UnitConversions::CelsiusToFahrenheit(lastMeasurement.variant.environment_metrics.temperature), 0) + "°F"; } - // Continue with the remaining details - display->drawString(x, y += _fontHeight(FONT_SMALL), - "Temp/Hum: " + last_temp + " / " + - String(lastMeasurement.variant.environment_metrics.relative_humidity, 0) + "%"); + sensorData[sensorCount++] = + "Temp/Hum: " + last_temp + " / " + String(lastMeasurement.variant.environment_metrics.relative_humidity, 0) + "%"; } if (lastMeasurement.variant.environment_metrics.barometric_pressure != 0) { - display->drawString(x, y += _fontHeight(FONT_SMALL), - "Press: " + String(lastMeasurement.variant.environment_metrics.barometric_pressure, 0) + "hPA"); + sensorData[sensorCount++] = + "Press: " + String(lastMeasurement.variant.environment_metrics.barometric_pressure, 0) + "hPA"; } if (lastMeasurement.variant.environment_metrics.voltage != 0) { - display->drawString(x, y += _fontHeight(FONT_SMALL), - "Volt/Cur: " + String(lastMeasurement.variant.environment_metrics.voltage, 0) + "V / " + - String(lastMeasurement.variant.environment_metrics.current, 0) + "mA"); + sensorData[sensorCount++] = "Volt/Cur: " + String(lastMeasurement.variant.environment_metrics.voltage, 0) + "V / " + + String(lastMeasurement.variant.environment_metrics.current, 0) + "mA"; } if (lastMeasurement.variant.environment_metrics.iaq != 0) { - display->drawString(x, y += _fontHeight(FONT_SMALL), "IAQ: " + String(lastMeasurement.variant.environment_metrics.iaq)); + sensorData[sensorCount++] = "IAQ: " + String(lastMeasurement.variant.environment_metrics.iaq); + } + + if (lastMeasurement.variant.environment_metrics.distance != 0) { + sensorData[sensorCount++] = "Water Level: " + String(lastMeasurement.variant.environment_metrics.distance, 0) + "mm"; + } + + if (lastMeasurement.variant.environment_metrics.weight != 0) { + sensorData[sensorCount++] = "Weight: " + String(lastMeasurement.variant.environment_metrics.weight, 0) + "kg"; + } + + if (lastMeasurement.variant.environment_metrics.radiation != 0) { + sensorData[sensorCount++] = "Rad: " + String(lastMeasurement.variant.environment_metrics.radiation, 2) + "µR/h"; } if (lastMeasurement.variant.environment_metrics.lux != 0) { - display->drawString(x, y += _fontHeight(FONT_SMALL), - "Illuminance: " + String(lastMeasurement.variant.environment_metrics.lux, 2) + "lx"); + sensorData[sensorCount++] = "Illuminance: " + String(lastMeasurement.variant.environment_metrics.lux, 2) + "lx"; } if (lastMeasurement.variant.environment_metrics.white_lux != 0) { - display->drawString(x, y += _fontHeight(FONT_SMALL), - "W_Lux: " + String(lastMeasurement.variant.environment_metrics.white_lux, 2) + "lx"); + sensorData[sensorCount++] = "W_Lux: " + String(lastMeasurement.variant.environment_metrics.white_lux, 2) + "lx"; } - if (lastMeasurement.variant.environment_metrics.distance != 0) - display->drawString(x, y += _fontHeight(FONT_SMALL), - "Water Level: " + String(lastMeasurement.variant.environment_metrics.distance, 0) + "mm"); + static int scrollOffset = 0; + static bool scrollingDown = true; + static uint32_t lastScrollTime = millis(); - if (lastMeasurement.variant.environment_metrics.weight != 0) - display->drawString(x, y += _fontHeight(FONT_SMALL), - "Weight: " + String(lastMeasurement.variant.environment_metrics.weight, 0) + "kg"); + // Draw up to 3 sensor data lines + int linesToShow = min(3, sensorCount); + for (int i = 0; i < linesToShow; i++) { + int index = (scrollOffset + i) % sensorCount; + display->drawString(x, y += _fontHeight(FONT_SMALL), sensorData[index]); + } - if (lastMeasurement.variant.environment_metrics.radiation != 0) - display->drawString(x, y += _fontHeight(FONT_SMALL), - "Rad: " + String(lastMeasurement.variant.environment_metrics.radiation, 2) + "µR/h"); + // Only scroll if there are more than 3 sensor data lines + if (sensorCount > 3) { + // Update scroll offset every 5 seconds + if (millis() - lastScrollTime > 5000) { + if (scrollingDown) { + scrollOffset++; + if (scrollOffset + linesToShow >= sensorCount) { + scrollingDown = false; + } + } else { + scrollOffset--; + if (scrollOffset <= 0) { + scrollingDown = true; + } + } + lastScrollTime = millis(); + } + } } bool EnvironmentTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *t) diff --git a/version.properties b/version.properties index 800529e398..4312ae59a5 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 5 -build = 19 +build = 20