PC board: an unreachable MQTT broker blocks the whole firmware

Đang mở
#89 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
embedded-iot

Hướng nghiên cứu

Start with boards/pc/src/network.rs and trace mqtt_driver_task and how the PC board runs tasks on its Embassy executor. Compare its connection path with the other stream code that uses Embassy timers. Done means an unreachable broker no longer blocks the BLE HTTP server, CAN, or vehicle tasks while MQTT retries; the issue does not name specific tests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Problem

mqtt_driver_task on the PC board (boards/pc/src/network.rs) opens the broker connection with a blocking std::net::TcpStream::connect. The PC board runs every task on one Embassy executor thread, so while that connect waits, nothing else runs: no BLE test HTTP server, no CAN, no vehicle tasks, no state publishing.

A refused connection returns at once, so a local broker that is down is fine. An address that doesn't answer (a host that is off or not on the network) leaves the connect waiting for the OS TCP timeout, more than a minute on Linux. Then the 5 s retry starts it again, so the firmware is blocked almost all the time.

This hits anyone running the PC board straight from config.toml.example: its broker_url is mqtt://192.168.0.100:1883, which usually doesn't answer. The log stops at MQTT: connecting to 192.168.0.100:1883 and the BLE HTTP mock on port 4242 refuses connections. Found while testing #74 end to end on virtual-car; pointing broker_url at a closed local port (mqtt://127.0.0.1:1) works around it.

Proposal

  • Connect without blocking the executor: a non-blocking socket polled with Embassy timers (like the rest of the stream), or the connect on a separate thread with the result handed back.
  • Bound the connect with a timeout (a few seconds), then retry as today.
  • Optionally make the example config's broker one that fails fast, or document that the PC board needs a reachable broker or a closed local port.

Done when

With an unreachable broker, the PC board's BLE HTTP server, CAN and vehicle tasks keep working while MQTT retries.

Ngôn ngữ chính
Rust
Star
1
Fork
0
Merge trung bình
13 giờ 27 phút
Pull request đã merge (30 ngày)
31

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OpenCarControls/firmware

Tất cả issue của OpenCarControls/firmware

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.