Add Rust telemetry backend (bevo-rust) for Angelique#9
Draft
Copilot wants to merge 1 commit into
Draft
Conversation
…ackend Agent-Logs-Url: https://github.com/LonghornRacingElectric/BEVO-2025/sessions/5aa87122-f436-4f28-aea4-adbc9cc3040f Co-authored-by: samuelLi05 <183245889+samuelLi05@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
samuelLi05
March 29, 2026 01:39
View session
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.
Python's GIL prevents true concurrency in the existing
telemd/backend, making it unsuitable for high-frequency CAN telemetry. This replaces it with a Rust implementation using the lhre-2026 daemon-based architecture.Structure
Two binaries under
bevo-rust/, communicating over a Unix socket:publishd— connects to MQTT asBEVO-Angelique, optionally syncspacket_idfrom server viaclient-connections/server-communicationhandshake, writes startup semaphore, then forwards length-prefixed protobuf frames fromcandto theangeliquetopiccand— waits for semaphore, reads CAN frames fromcan0(or UDP mock viaCAND_USE_MOCK=1), decodes intoAngeliqueSensorDataprotobuf at configurable rate (default 100 Hz), broadcasts over Unix socket to all connected clientsCAN Decoding
Field mappings are ported 1:1 from
telemd/core/field_mappings.pyas a hardcodedmatchon CAN ID — no JSON config needed. TheCellAggregatormirrors Python'sCellDataAggregator, accumulating voltage (0x370–0x392) and temperature (0x470–0x486) frames and computing running averages:Proto
bevo-rust/proto/template.protois a copy oftelemd/protobuf/template.protowithpackage angelique;added for correct prost codegen. Compiled at build time viaprost-build.Concurrency model
Each daemon runs three threads: CAN reader → frame decoder/proto updater (shared
Mutex<AngeliqueSensorData>) → IPC broadcaster. The outbound MQTT queue drops frames on overflow rather than back-pressuring the encoder.Environment variables
CAND_USE_MOCK0can0CAND_CAN_INTERFACEcan0CAND_PUBLISH_HZ100PUBLISHD_MQTT_HOST192.168.1.109PUBLISHD_MQTT_PORT1883PUBLISHD_REQUIRE_SERVER_PACKET_ID0packet_id