Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: RAK4631- AirQualityTelemetry - RAK12039 PM sensor #5582

Closed
beegee-tokyo opened this issue Dec 15, 2024 · 0 comments · Fixed by #5584
Closed

[Bug]: RAK4631- AirQualityTelemetry - RAK12039 PM sensor #5582

beegee-tokyo opened this issue Dec 15, 2024 · 0 comments · Fixed by #5584
Labels
bug Something isn't working

Comments

@beegee-tokyo
Copy link
Contributor

beegee-tokyo commented Dec 15, 2024

Category

Other

Hardware

Rak4631

Firmware Version

2.5.15.79da236

Description

RAK12039 PM values transmitted and decoded have all PM values set to 0 when sent to MQTT broker.

Reason:
Most likely a change in the protobuf (not sure) where additional "has_pmxxx_standard" and "has_pmxxx_environmental" validator fields were added to the air_quality_metrics structure.
But AirQualityTelemetry.cpp does not set these validation fields to true.

This results in sending all PM values as 0 to the MQTT broker.

Fix:
In AirQualityTelemetry.cpp ==> bool AirQualityTelemetryModule::getAirQualityTelemetry(meshtastic_Telemetry *m) the validation markers need to be set to true.

    m->variant.air_quality_metrics.pm10_standard = data.pm10_standard;
    m->variant.air_quality_metrics.pm25_standard = data.pm25_standard;
    m->variant.air_quality_metrics.pm100_standard = data.pm100_standard;

    m->variant.air_quality_metrics.pm10_environmental = data.pm10_env;
    m->variant.air_quality_metrics.pm25_environmental = data.pm25_env;
    m->variant.air_quality_metrics.pm100_environmental = data.pm100_env;

changed to

    m->variant.air_quality_metrics.has_pm10_standard = true;
    m->variant.air_quality_metrics.pm10_standard = data.pm10_standard;
    m->variant.air_quality_metrics.has_pm25_standard = true;
    m->variant.air_quality_metrics.pm25_standard = data.pm25_standard;
    m->variant.air_quality_metrics.has_pm100_standard = true;
    m->variant.air_quality_metrics.pm100_standard = data.pm100_standard;

    m->variant.air_quality_metrics.has_pm10_environmental = true;
    m->variant.air_quality_metrics.pm10_environmental = data.pm10_env;
    m->variant.air_quality_metrics.has_pm25_environmental = true;	
    m->variant.air_quality_metrics.pm25_environmental = data.pm25_env;
    m->variant.air_quality_metrics.has_pm100_environmental = true;	
    m->variant.air_quality_metrics.pm100_environmental = data.pm100_env;

fixes the problem and PM air quality values are sent over MQTT.

Relevant log output

No response

@beegee-tokyo beegee-tokyo added the bug Something isn't working label Dec 15, 2024
@beegee-tokyo beegee-tokyo changed the title [Bug]: RAK4631- Air QualitTelemetry - RAK12039 PM sensor [Bug]: RAK4631- AirQualityTelemetry - RAK12039 PM sensor Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant