mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
Serial Mode for Ecowitt WS85 weather station. (#4296)
* protobufs * initial mods, not tested * manual telem packet creation, compiles. * add gust and lull computation * telem packet is getting fired off * new pb ? * pb and gust lull * need to set the variant type for it to work. * add gust and lull to mqtt json output. * parse bat voltage and cap voltage and send the larger of the two in telem packet also use the new ws85 serial mode (6). must set it with cli. : meshtastic --set serial.mode 6 * set hard coded average/transmit interval to 5 minutes. * proper direction averging with trig. * Update protobufs * sweep some crud * read in 512 bytes at a time and break and clear serial input if we got wind data * factor out sendTelemetry function * Revert "factor out sendTelemetry function" This reverts commitb61ba1a3c5. * Reapply "factor out sendTelemetry function" This reverts commitd0af9cfd7d. * update protobufs * put WS85 Serial2 is tcho and canaryone exclusion #ifdef * include GeoCoord.h so dr-dev will compile. * remove old TODO comment. * breakout WS85 serial operation to it's own function called processWXSerial() * canaryone and t-echo exclusion for Serial2 --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
@@ -673,8 +673,10 @@ std::string MQTT::meshPacketToJson(meshtastic_MeshPacket *mp)
|
||||
msgPayload["lux"] = new JSONValue(decoded->variant.environment_metrics.lux);
|
||||
msgPayload["white_lux"] = new JSONValue(decoded->variant.environment_metrics.white_lux);
|
||||
msgPayload["iaq"] = new JSONValue((uint)decoded->variant.environment_metrics.iaq);
|
||||
msgPayload["wind_speed"] = new JSONValue((uint)decoded->variant.environment_metrics.wind_speed);
|
||||
msgPayload["wind_speed"] = new JSONValue(decoded->variant.environment_metrics.wind_speed);
|
||||
msgPayload["wind_direction"] = new JSONValue((uint)decoded->variant.environment_metrics.wind_direction);
|
||||
msgPayload["wind_gust"] = new JSONValue(decoded->variant.environment_metrics.wind_gust);
|
||||
msgPayload["wind_lull"] = new JSONValue(decoded->variant.environment_metrics.wind_lull);
|
||||
} else if (decoded->which_variant == meshtastic_Telemetry_power_metrics_tag) {
|
||||
msgPayload["voltage_ch1"] = new JSONValue(decoded->variant.power_metrics.ch1_voltage);
|
||||
msgPayload["current_ch1"] = new JSONValue(decoded->variant.power_metrics.ch1_current);
|
||||
|
||||
Reference in New Issue
Block a user