USB companion radio firmware on Heltec V4.3: when the name has length 6, APP_START requests stall

Offen
#3,894 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
arduino, c, cpp
Bereich
embedded-iot

Rechercherichtung

Start by reproducing with the reporter's shell script against a Heltec V4.3 running the companion USB firmware, using meshcli to set a six-character name and then time the infos command. The reporter links a 64-byte SELF_INFO reply for APP_START to the USB serial layer, so the serial transmit path is the place to look. Done means infos responds in milliseconds for a six-character name as it does for seven, and the fix is confirmed on hardware.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

I am using a Heltec V4.3 OLED board with Companion radio USB v1.18.0-81dbae5 (14) firmware (heltec_v4_companion_radio_usb) and meshcli v1.6.10 on Ubuntu 26.04.

When the name has length of 6 characters, requesting "infos" via USB takes up to ~20 seconds instead of the usual milliseconds with other name lengths.

Reproducer script:

#!/bin/bash

PORT=${1:-/dev/ttyACM0}

for name in abcdef abcdefg; do
  echo
  echo "=== name '$name'"
  uv run meshcli -s "$PORT" set name "$name"
  sleep 5
  for i in 1 2 3; do
    echo "run $i:"
    time uv run meshcli -s "$PORT" infos >/dev/null
    sleep 1
  done
done

Output:

=== name 'abcdef'
INFO:meshcore:Serial Connection started
INFO:meshcore:Connected to abcdefg running on a v1.18.0-81dbae5 (14) fw.
ok
run 1:
INFO:meshcore:Serial Connection started
INFO:meshcore:No response from meshcore node, trying to force DTR = True
INFO:meshcore:Serial Connection started
INFO:meshcore:Connected to abcdef running on a v1.18.0-81dbae5 (14) fw.

real    0m18.138s
user    0m0.099s
sys     0m0.021s
run 2:
INFO:meshcore:Serial Connection started
INFO:meshcore:No response from meshcore node, trying to force DTR = True
INFO:meshcore:Serial Connection started
INFO:meshcore:Connected to abcdef running on a v1.18.0-81dbae5 (14) fw.

real    0m7.542s
user    0m0.104s
sys     0m0.019s
run 3:
INFO:meshcore:Serial Connection started
INFO:meshcore:No response from meshcore node, trying to force DTR = True
INFO:meshcore:Serial Connection started
INFO:meshcore:No response from meshcore node, trying to invert dtr (now False)
INFO:meshcore:Serial Connection started
ERROR:meshcore:No response from meshcore node, disconnecting
ERROR:meshcore:Are you sure your node is a serial companion ?
ERROR:meshcore:To connect to a repeater, use -r option.

real    0m8.127s
user    0m0.084s
sys     0m0.030s

=== name 'abcdefg'
INFO:meshcore:Serial Connection started
INFO:meshcore:No response from meshcore node, trying to force DTR = True
INFO:meshcore:Serial Connection started
INFO:meshcore:Connected to abcdef running on a v1.18.0-81dbae5 (14) fw.
ok
run 1:
INFO:meshcore:Serial Connection started
INFO:meshcore:Connected to abcdefg running on a v1.18.0-81dbae5 (14) fw.

real    0m0.116s
user    0m0.095s
sys     0m0.019s
run 2:
INFO:meshcore:Serial Connection started
INFO:meshcore:Connected to abcdefg running on a v1.18.0-81dbae5 (14) fw.

real    0m0.115s
user    0m0.094s
sys     0m0.018s
run 3:
INFO:meshcore:Serial Connection started
INFO:meshcore:Connected to abcdefg running on a v1.18.0-81dbae5 (14) fw.

real    0m0.115s
user    0m0.089s
sys     0m0.023s

Note now with name length 7, the infos command takes about 100 ms (as expected), but with length 6 it can take up to ~20 s. This causes timeouts when trying to use this MeshCore device with Home Assistant (i.e. Home Assistant fails to connect to the device due to these timeouts).

An investigation performed by an AI agent suggests that this issue happens because when the name has length 6, the APP_START reply SELF_INFO payload has size 64 bytes, and the USB interface treats it as if the host is about to send more data (i.e. it waits and does not transmit it over USB).
A fork of MeshCore called Offband seems to had faced a similar issue and fixed it downstream: https://github.com/OffbandMesh/meshcore-firmware/issues/1037, https://github.com/OffbandMesh/meshcore-firmware/issues/1093.

Possibly related: MeshCore #3751 (ESP32-S3 HWCDC TX race on core 2.0.17, fixed by arduino-esp32 #12606 in core 3.3.9). That PR also has the ISR send a terminating ZLP once the TX ring is empty, so moving to core 3.3.9 or later may fix this too. Not tested.

Vorherrschende Sprache
C
Sterne
3.9k
Forks
1.5k
Ø Merge
2 T. 19 Std.
Gemergte PRs (30 T.)
61

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus meshcore-dev/MeshCore

Alle Issues in meshcore-dev/MeshCore

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.