Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

BLE notifications get silently truncated when the negotiated MTU is too small

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

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

@Tichael がすでに取り組んでいます。

2026年10月21日 から。

  • #52 @Tichael による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
flutter, rust

調査の方向性

Start with the BLE TX task in boards/esp/src/ble/transport.rs around lines 638 and 666, then check how trouble-host handles notifications in gatt::assemble and how the mobile app handles the requested MTU in mobile-app/lib/providers/ble_connection_provider.dart. The issue suggests waiting for the MTU exchange event and checking each payload against the negotiated MTU; done means oversized messages are never silently truncated and a small MTU is logged on both sides.

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

説明

Problem
BLE messages aren't fragmented: every message must fit in one ATT packet, at most ble.payload.max_message_bytes (244 bytes, from an ATT MTU of 247). The firmware never checks the MTU that was actually negotiated:

  • After the link is encrypted, the TX task sleeps 500 ms and assumes the MTU exchange is done by then (boards/esp/src/ble/transport.rs:638). Nothing confirms it.
  • trouble-host 0.6 trims a notification to the connection's ATT MTU without returning an error (gatt::assemble in trouble-host-0.6.0/src/gatt.rs:644). So notify(...) at transport.rs:666 reports success while the app receives a cut-off protobuf it can't decode.
  • The app requests kBleAttMtu (mobile-app/lib/providers/ble_connection_provider.dart:219). When it gets less, it only logs a warning.

When it happens
The MTU exchange takes longer than 500 ms, or the phone negotiates less than 247. Some Android phones do; iOS picks its own MTU, which matters if iOS is ever supported. State updates near the worst-case size are then lost silently.

Ideas

  • Wait for the MTU-exchange event instead of sleeping.
  • Before each notify, compare the payload with conn.raw().att_mtu() - 3 and drop or log anything that doesn't fit, rather than sending a truncated message.
  • Longer term: BLE fragmentation (https://github.com/OpenCarControls/contracts/issues/5) removes the limit.

Done when
No message is ever sent truncated, and an MTU that's too small is visible in the logs on both sides.

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

環境構築

Codespaces で開く

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

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

はじめの一歩

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

OpenCarControls/firmware のほかの issue

OpenCarControls/firmware の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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