PC board: an unreachable MQTT broker blocks the whole firmware

オープン
#89 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
embedded-iot

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
1
フォーク
0
平均マージ
13時間 27分
マージ済み PR(30日)
31

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OpenCarControls/firmware のほかの issue

OpenCarControls/firmware の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。