Skip to content

Conversation

@vasyl-ks
Copy link

Summary

Final integration of the vehicle telemetry system — combines Generator, Hub, Consumer, and WebSocket Frontend into a complete real-time telemetry and control platform with live visualization.

Implementation

  • Generator: emits mode-aware model.SensorData (speed, pressure, temperature) at sensor.intervalMilliSeconds; reacts to Command inputs (start, stop, accelerate, mode) and produces aggregated model.ResultData summaries via concurrent fan-out/fan-in processing.
  • Hub: central router connecting all components.
    • Streams ResultData to Frontend (WebSocket) and Consumer (UDP).
    • Routes Command messages from the Frontend to Generator (via channel) and Consumer (via TCP).
    • Manages WebSocket lifecycle, ensuring graceful connection and disconnection handling.
  • Consumer: listens for telemetry (UDP) and commands (TCP); auto-detects payload type; logs entries to structured .jsonl files under logs/data/ and logs/commands/, rotating after logger.maxLines.
  • Frontend: React + Vite + Tailwind dashboard visualizing live telemetry, connection status, and vehicle metrics; provides interactive command controls with toast feedback.
  • Configuration: config.LoadConfig() loads sensor ranges, processing windows, ports, mode ratios, and log rotation rules from config.json.
  • Integration Test: cmd/app/main_test.go simulates frontend interactions — connects via WebSocket, issues control commands, validates telemetry flow, and records session logs.
  • Startup: start.sh launches both backend (go run ./cmd/app/main.go) and frontend (npm run dev) for unified local development.

vasyl-ks and others added 20 commits October 11, 2025 20:53
…and adjust growth by mode

- Implement linear increase of pressure and temperature based on normalized speed ratio.
- Add mode-dependent growth factor (eco|normal|speed) to control how fast pressure and temperature rise.
- Ensure values remain within min/max limits to avoid unrealistic sensor outputs.
…ion completion

- Fixed a race condition where tests and other processes could start before
the configuration process had fully completed by introducing a shared
channel-based synchronization mechanism.
- Also refactored another initialization flow to use the same signaling
strategy for consistency across components.
…ation

Refactored the logging system to replace the single global logger with
dedicated loggers for main, data, and command outputs. Each logger now
writes to its own directory and automatically rotates files after
reaching the configured line limit.
- Added structured [INFO]/[ERROR] log format across components.
- Added startup logs for Hub, Consumer, and Generator.
- Added connection logs for UDP, TCP, and WebSocket.
- Rename ResultData fields
- Change WebSocket port from 10000 to 3000 in config
- Add structured logging with [INFO]/[ERROR] tags across hub and generator
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.

2 participants