-
Notifications
You must be signed in to change notification settings - Fork 964
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
Conversation
src/modules/SerialModule.cpp
Outdated
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
src/modules/SerialModule.cpp
Outdated
#if !defined(TTGO_T_ECHO) && !defined(CANARYONE) | ||
else { | ||
else if ((moduleConfig.serial.mode == meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85)) { | ||
static unsigned int lastAveraged = 0; |
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
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.
@tavdog Love your work here. Just setting up a WS85 meshtastic station. |
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. |
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.