Add AS3935 lightning sensor telemetry fields - #981
Draft
ndoo wants to merge 3 commits into
Draft
Conversation
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Jul 7, 2026
Adds lightning_strike_count_1h and lightning_distance_km to EnvironmentMetrics (reset on a rolling ~1h window, matching the rainfall_1h precedent), and an AS3935 entry to TelemetrySensorType, to support meshtastic/firmware#10774. Assisted-by: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Andrew Yong <me@ndoo.sg>
ndoo
force-pushed
the
feat/as3935-lightning-sensor
branch
from
July 7, 2026 18:57
83a364c to
f10075c
Compare
caveman99
approved these changes
Aug 12, 2026
caveman99
marked this pull request as ready for review
August 12, 2026 07:13
Contributor
Author
|
Do not merge unless anyone has tested |
caveman99
marked this pull request as draft
August 12, 2026 07:14
Member
I have one of those sensors incoming, but i wanted to keep the pr's fresh. |
ndoo
pushed a commit
to meshmy/meshtastic-firmware
that referenced
this pull request
Aug 12, 2026
Conflict resolutions: - configuration.h: keep the DS248X and HM330X addresses, append the AS3935 addresses - ScanI2C.h: keep DS248X and HM330X in DeviceType, append AS3935 - EnvironmentTelemetry.cpp: keep the display-source refactor from develop, keep IMMEDIATE_SEND_MAX_STALENESS_MS, drop the duplicate environmentTelemetryModule definition - EnvironmentTelemetry.h: drop the duplicate extern environmentTelemetryModule declaration - protobufs: take develop (84bfb0f); meshtastic/protobufs#981 supplies the AS3935 fields Note: protobufs#981 as it stands assigns lightning_strike_count_1h = 24, lightning_distance_km = 25 and AS3935 = 55, which collide with adc_voltage_ch0, adc_voltage_ch1 and HM330X on protobufs master. It needs renumbering before merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds the schema needed to support an AS3935 lightning-detection sensor in
meshtastic/firmware(companion firmware PR: meshtastic/firmware#10931, branchfeat/as3935-lightning-sensoronmesh-malaysia/meshtastic-firmware).In
meshtastic/telemetry.proto:EnvironmentMetrics.lightning_strike_count_1h(uint32, field 24) — lightning strikes detected in the last hour, matching therainfall_1hnaming convention.EnvironmentMetrics.lightning_distance_km(float, field 25) — estimated distance to the leading edge of the storm for the most recently detected strike in the current window, valid only when a genuine strike (not noise/disturber) was classified.TelemetrySensorType.AS3935(enum value 55).Field numbers were the next free slots in both
EnvironmentMetrics(last used: 23,one_wire_temperature) andTelemetrySensorType(last used: 54,SPA06).Checklist before merging
Note: this repo's
developbranch (notmaster) is whatmeshtastic/firmware's owndevelopbranch submodule-pins to — this PR targetsdevelopaccordingly.