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

Serial Mode for Ecowitt WS85 weather station. #4296

Merged
merged 32 commits into from
Jul 21, 2024
Merged

Conversation

tavdog
Copy link
Contributor

@tavdog tavdog commented Jul 16, 2024

This PR adds a new SerialModule mode for the WS85 ultrasonic anemometer / weather station. Attaching the station via a serial connection allows for Meshtastic to read the weather data and transmit it at 5 minute intervals as Telemetry data to the mesh.

To enable this mode you must use the cli to issue meshtastic --set serial.mode 6 as this mode is not present in any of the other clients at the time of this PR.

tavdog added 27 commits July 8, 2024 23:39
…elem packet

also use the new ws85 serial mode (6).  must set it with cli. : meshtastic --set serial.mode 6
if (gotwind && millis() - lastAveraged > averageIntervalMillis) {
// calulate average and send to the mesh
float velAvg = 1.0 * velSum / velCount;
// float dirAvg = dirSum / dirCount; // TODO : this needs some trig to be accurate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment still accurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO comment is in fact old. I'll remove it.

#if !defined(TTGO_T_ECHO) && !defined(CANARYONE)
else {
else if ((moduleConfig.serial.mode == meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85)) {
static unsigned int lastAveraged = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the extensive parsing logic and math involved, I wonder if we should make a void function to extract this block to, so that it doesn't bloat runOnce()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure I can do that. All that logic is pretty confusing.

@thebentern thebentern merged commit fa66245 into meshtastic:master Jul 21, 2024
92 checks passed
@mikechristiansen
Copy link

@tavdog Love your work here. Just setting up a WS85 meshtastic station.
I see the serial data is reporting rain. Any idea how much work it would be to report this over the mesh? I guess this would require changes in the enviromental protobuffs?
Cheers, Mike.

@tavdog
Copy link
Contributor Author

tavdog commented Dec 19, 2024

@tavdog Any idea how much work it would be to report this over the mesh? I guess this would require changes in the enviromental protobuffs? Cheers, Mike.

Apparently the station reports RainIntSum and Rain values and I'm not sure what exactly that Sum interval is. But yes it would require adding those two items to the protobufs if we wanted to include the rain values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants