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]: RAK12039 Particulate Matter Sensor data is not added in MeshPacketSerializer #4390

Closed
beegee-tokyo opened this issue Aug 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@beegee-tokyo
Copy link
Contributor

Category

Other

Hardware

Other

Firmware Version

2.4.0.46d7b82

Description

The sensor data from the RAK12039 are not created in the JSON serializer for MQTT output.
Two changes are required:
(1) Change in telemetry.pb.h (it says it is automatically generated, but I don't know how and where)
Change uint32_t values to uint16_t values in the meshtastic_AirQualityMetric

/* Air quality metrics */
typedef struct _meshtastic_AirQualityMetrics {
    /* Concentration Units Standard PM1.0 */
    uint16_t pm10_standard;
    /* Concentration Units Standard PM2.5 */
    uint16_t pm25_standard;
    /* Concentration Units Standard PM10.0 */
    uint16_t pm100_standard;
    /* Concentration Units Environmental PM1.0 */
    uint16_t pm10_environmental;
    /* Concentration Units Environmental PM2.5 */
    uint16_t pm25_environmental;
    /* Concentration Units Environmental PM10.0 */
    uint16_t pm100_environmental;
    /* 0.3um Particle Count */
    uint16_t particles_03um;
    /* 0.5um Particle Count */
    uint16_t particles_05um;
    /* 1.0um Particle Count */
    uint16_t particles_10um;
    /* 2.5um Particle Count */
    uint16_t particles_25um;
    /* 5.0um Particle Count */
    uint16_t particles_50um;
    /* 10.0um Particle Count */
    uint16_t particles_100um;
} meshtastic_AirQualityMetrics;

(2) Change in MeshPacketSerializer.cpp
Add air quality metrics to the serializer

                } else if (decoded->which_variant == meshtastic_Telemetry_air_quality_metrics_tag) {
                    msgPayload["pm10"] = new JSONValue(decoded->variant.air_quality_metrics.pm10_standard);
                    msgPayload["pm25"] = new JSONValue(decoded->variant.air_quality_metrics.pm25_standard);
                    msgPayload["pm100"] = new JSONValue(decoded->variant.air_quality_metrics.pm100_standard);
                    msgPayload["pm10_e"] = new JSONValue(decoded->variant.air_quality_metrics.pm10_environmental);
                    msgPayload["pm25_e"] = new JSONValue(decoded->variant.air_quality_metrics.pm25_environmental);
                    msgPayload["pm100_e"] = new JSONValue(decoded->variant.air_quality_metrics.pm100_environmental);

Result of change: Meshtastic Device
image

Created with RAKwireless Meshtastic devices:

  • WisMesh Hub (coming soon)
  • WisMesh Pocket + RAK1906
  • WisBlock based indoor air quality device (RAK19001 + RAK4631 + RAK1901 + RAK1903 + RAK12039)
  • WisBlock base MQTT gateway (RAK19007 + RAK11200 + RAk13300)
  • NodeRED parser and forwarder to InfluxDB and Grafana visualization

image

Relevant log output

No response

@beegee-tokyo beegee-tokyo added the bug Something isn't working label Aug 5, 2024
caveman99 added a commit that referenced this issue Aug 28, 2024
geeksville pushed a commit to geeksville/Meshtastic-esp32 that referenced this issue Aug 28, 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

No branches or pull requests

1 participant