[Bug]: Bluetooth connection non-functional after commands sent via Serial interface
Category
Serial
Hardware
Rak4631
Is this bug report about any UI component firmware like InkHUD or Meshtatic UI (MUI)?
- [ ] Meshtastic UI aka MUI colorTFT
- [ ] InkHUD ePaper
- [ ] OLED slide UI on any display
Firmware Version
2.6.11.60ec05e
Description
Issue: The Bluetooth connection becomes non-functional after commands are sent via Serial interface, both via meshtastic CLI or meshtastic Python library.
When I send a command via Serial, the Bluetooth connection becomes non-functional and subsequent connection attempts will fail When I am connected to a node via Bluetooth App, and I send a command via Serial, the App gets disconnected (yellow connection icon) with a "Not connected" status, and subsequent attempt to reconnect will fail. After a while the App reports "Connected to radio, but it is sleeping" The Serial connection continues to work. meshtastic --reboot via Serial does not solve the issue
Tested with: RAK4631 and Seeedstudio XIAO nRF52 KIT - Firmware 2.6.11.60ec05e and 2.7.15.567b8ea, Android App v2.7.7 (29319424)
Steps to reproduce: 1) Connect to a node via Bluetooth with the Android App 2) Connect the Serial data cable 3) Issue a command i.e. meshtastic --sendtext "This is a test" 4) Notice the Android App gets disconnected 5) Attempts to reconnect will fail, unless node powered-off/powered-on
Relevant log output
The Serial API connection will override the Bluetooth API connection and will hang onto that lock for a bit. It should eventually heal but takes a bit of time.
@Xaositek After more than 2 hours the App still in Connected to radio, but it is still sleeping, no way to interact with the node via Bluetooth. Should I wait more (how many hours?) or I can consider the connection dead? Is there any tunable parameter I can adjust to make it safely reconnect?
Testing on both:
- Seeed Studio XIAO nRF52840
- RAK 4630 on a RAK19007 WisBlock base board
Sounds like the Bluetooth API once overwrote isn't coming back alive.
For reference I can have my iPhone attached to my Heltec T114 (Bluetooth API), issue a command over the serial connection, the iOS app will disconnect for about 10-15 seconds and then go back through the recommunicating process and everything stays healthy.
Thank you @Xaositek,
After your note I have retested everything with both the Android v2.7.7 (29319424) and iPhone v 2.7.5 (1683) App, with Seeed Studio XIAO nRF52840 and RAK 4630 on Firmware 2.6.11.60ec05e, and I confirm I have the same very same behavior.
If I am connected with the App via Bluetooth, and issue a command via Serial (I used meshtastic --nodes) then the App gets disconnected, does not reconnect automatically (I waited 1h+), and there's no way to reconnect. The Serial interface remains fully operational, --reboot via Serial does not solve the problem. The only way to reconnect via Bluetooth is by disconnecting and reconnecting reconnect the power.
Hence I confirm, for the tests I am doing, this is definitely a bug in the firmware.
The issue persists with firmware v2.7.15.567b8ea
I imagine this is unrelated to #8878. It's about how the firmware tries to stick to only one connection type. Did you try switching off the Android bluetooth and switching it on? Because maybe it's the UI application that lacks the ability to disconnect and connect again with bluetooth, taking over serial.
Did you try switching off the Android bluetooth and switching it on? Because maybe it's the UI application that lacks the ability to disconnect and connect again with bluetooth, taking over serial.
Yes I did but it doesn't solve the issue. Thanks anyway,