BLE: node unreachable on Linux after pairing — bluez auto-reconnect holds the single connection

Abierto Apto para principiantes
#972 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
82/100
Tipo de issue
Documentación
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
linux, python

Línea de trabajo

Encuentra el bloque de gestión del error DEVICE_NOT_FOUND de la CLI y las pistas existentes para solucionar problemas de Bluetooth; src/nimble/NimbleBluetooth.cpp ofrece contexto sobre el comportamiento de una sola conexión, pero no necesariamente es un archivo que deba modificarse. Añade un punto para Linux/bluez que explique la reconexión automática con dispositivos vinculados e incluya la solución alternativa con bluetoothctl disconnect y ReconnectMode=none. Done significa que el error de la CLI identifica claramente el caso de reconexión automática y proporciona una solución aplicable.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Environment: Ubuntu Linux with bluez, Meshtastic T3S3 on firmware 2.7.26, meshtastic CLI 2.7.8 from pip.
Repro
Step one. Pair and trust the node from the host, entering the PIN shown on the device screen:
bluetoothctl pair AA:BB:CC:DD:EE:FF
bluetoothctl trust AA:BB:CC:DD:EE:FF
Step two. Disconnect cleanly and reboot the machine, or let the node go to sleep.
Step three. Run the CLI:
meshtastic --ble name_or_address --info
The CLI reports "No Meshtastic BLE peripheral with identifier or address '...' found" (also seen as "Timed out waiting for connection completion"), and --ble-scan comes back empty. Meanwhile bluetoothctl info AA:BB:CC:DD:EE:FF shows "Connected: yes".
What I think is going on
This is the one-slot trap, not an adapter problem. Meshtastic nodes allow a single BLE connection and stop advertising while connected (single connectable advertising instance in src/nimble/NimbleBluetooth.cpp). bluez defaults to ReconnectMode=global, which silently reconnects bonded devices after a reboot or power event and never lets the slot go. Result: the node is connected-but-invisible. The CLI scan only sees advertising nodes, and this one isn't advertising.
Even published Linux guides run into it. This write-up (https://dustinrue.com/2025/12/connecting-to-a-meshtastic-node-using-bluetooth-from-linux/) hits the same behavior ("bluetoothctl staying connected to the node when it shouldn't have") and its advice is to reboot the machine, which works but masks the cause. As far as I can tell nobody has written down the mechanism, so it keeps catching people.
Workaround (verified)
In /etc/bluetooth/main.conf, under the General section, add:
ReconnectMode=none
then run:
systemctl restart bluetooth
The node stays free ("Connected: no") until a client actually connects, and the CLI connects normally.
Suggestion
The CLI already prints helpful hints for "BLE device not found", in the DEVICE_NOT_FOUND error handling block: Bluetooth disabled / deep sleep / out of range. A Linux-specific bonded auto-reconnect bullet would have saved me an afternoon. If a hint like that would be useful, I'm happy to open a small PR — a "Device is bonded and Bluetooth auto-reconnected (Linux/bluez)" bullet plus a bluetoothctl disconnect / ReconnectMode=none tip.

Lenguaje dominante
Python
Estrellas
855
Forks
355
Merge medio
3 d 3 h
PR fusionados (30 d)
12

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de meshtastic/python

Todos los issues de meshtastic/python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.