I'm trying to connect to a device via bluetooth, I use the contact --ble Meshtastic_xxxx command, the program starts up, but then crashes back to the terminal without any message.
It would be helpful to see why it closed up itsself, if there were any error.
Or to have a command option/parameter in order to enable this verbose debug log mode.
I have no issues connecting to my T-Echo, but I'm unable to connect to the Sensecap Indicator
I'm trying to connect to a device via bluetooth, I use the `contact --ble Meshtastic_xxxx` command, the program starts up, but then crashes back to the terminal without any message.
It would be helpful to see why it closed up itsself, if there were any error.
Or to have a command option/parameter in order to enable this verbose debug log mode.
I have no issues connecting to my T-Echo, but I'm unable to connect to the Sensecap Indicator
<!-- github-sync-id:3135004599 -->
The log is sent to a file in the contact directory. I really should allow the connection errors to print to the terminal. The reason you can't connect to the senscap is that the client API is in use by MUI. You can only have one connection at a time.
The log is sent to a file in the contact directory. I really should allow the connection errors to print to the terminal. The reason you can't connect to the senscap is that the client API is in use by MUI. You can only have one connection at a time.
<!-- github-comment-id:2960794907 -->
The log is sent to a file in the contact directory. I really should allow the connection errors to print to the terminal. The reason you can't connect to the senscap is that the client API is in use by MUI. You can only have one connection at a time.
Forgive me, I don't understand
So if I turn on the Indicator, MUI loads up, no other devices connected via BT, I would never be able to connect with the contact command via BT? But only with the serial USB
> The log is sent to a file in the contact directory. I really should allow the connection errors to print to the terminal. The reason you can't connect to the senscap is that the client API is in use by MUI. You can only have one connection at a time.
Forgive me, I don't understand
So if I turn on the Indicator, MUI loads up, no other devices connected via BT, I would never be able to connect with the contact command via BT? But only with the serial USB
<!-- github-comment-id:2962034548 -->
You would not be able to use any connection, Bluetooth, Serial or TCP while MUI is running. You can use Contact with the Indicator only if you boot in programming mode:
https://meshtastic.org/docs/software/meshtastic-ui/#bluetooth-programming-mode
<!-- github-comment-id:2962724616 -->
Yes, I confirm it was already rebooted in programming mode with the green screen, the bluetooth logo, the ">> Programming mode <<" and at the bottom the fixed "123456" PIN shown.
When I ran the contact --ble Meshtastic_xxxx command it started loading contact, but then it was quitted after some seconds
> You would not be able to use any connection, Bluetooth, Serial or TCP while MUI is running. You can use Contact with the Indicator only if you boot in programming mode: https://meshtastic.org/docs/software/meshtastic-ui/#bluetooth-programming-mode
Yes, I confirm it was already rebooted in programming mode with the green screen, the bluetooth logo, the ">> Programming mode <<" and at the bottom the fixed "123456" PIN shown.
When I ran the `contact --ble Meshtastic_xxxx` command it started loading contact, but then it was quitted after some seconds
<!-- github-comment-id:2962841060 -->
I honestly never use bluetooth on a desktop. Does your device connect to the web client with ble? Do you get any output with meshtastic --ble-scan?
I don't have an indicator but I was just now able to connect to my tdeck using contact --ble 'xDEC_a158'. It took a couple of tries.
I honestly never use bluetooth on a desktop. Does your device connect to the web client with ble? Do you get any output with `meshtastic --ble-scan`?
I don't have an indicator but I was just now able to connect to my tdeck using `contact --ble 'xDEC_a158'`. It took a couple of tries.
<!-- github-comment-id:2965249249 -->
I honestly never use bluetooth on a desktop. Does your device connect to the web client with ble? Do you get any output with meshtastic --ble-scan? I don't have an indicator but I was just now able to connect to my tdeck using contact --ble 'xDEC_a158'. It took a couple of tries.
TL;DR I solved it, look at the end
Goddamn, I guess some setting is messed up
meshtastic --ble-scan
INFO file:ble_interface.py scan line:116 Scanning for BLE devices (takes 10 seconds)...
Found: name='Meshtastic_729c' address='xxx'
BLE scan finished
and
❯ meshtastic --ble Meshtastic_729c --info
INFO file:ble_interface.py scan line:116 Scanning for BLE devices (takes 10 seconds)...
Traceback (most recent call last):
File "/Users/fab/.local/bin/meshtastic", line 8, in <module>
sys.exit(main())
~~~~^^
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/meshtastic/__main__.py", line 2062, in main
common()
~~~~~~^^
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/meshtastic/__main__.py", line 1237, in common
client = BLEInterface(
args.ble if args.ble != "any" else None,
...<2 lines>...
noNodes=args.no_nodes,
)
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/meshtastic/ble_interface.py", line 58, in __init__
self.client = self.connect(address)
~~~~~~~~~~~~^^^^^^^^^
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/meshtastic/ble_interface.py", line 167, in connect
client.connect()
~~~~~~~~~~~~~~^^
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/meshtastic/ble_interface.py", line 267, in connect
return self.async_await(self.bleak_client.connect(**kwargs))
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/meshtastic/ble_interface.py", line 296, in async_await
return self.async_run(coro).result(timeout)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
~~~~~~~~~~~~~~~~~^^
File "/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/bleak/__init__.py", line 615, in connect
return await self._backend.connect(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/bleak/backends/corebluetooth/client.py", line 136, in connect
await manager.connect(self._peripheral, disconnect_callback, timeout=timeout)
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/bleak/backends/corebluetooth/CentralManagerDelegate.py", line 171, in connect
await future
bleak.exc.BleakError: failed to connect: Error Domain=CBErrorDomain Code=14 "Peer removed pairing information" UserInfo={NSLocalizedDescription=Peer removed pairing information}
I fixed Bluetooth connection to SenseCAP Indicator:
Removed device from Mac's Bluetooth paired devices
Successfully connected with meshtastic --ble Meshtastic_729c --info
Seeing the error "BleakError: failed to connect: Error Domain=CBErrorDomain Code=14 'Peer removed pairing information'" was very helpful in diagnosing the issue. This is exactly why it would be better if these errors were shown directly in the terminal instead of just in log files.
The issue was caused by pairing conflicts. Using FIXED_PIN mode (123456) worked better than RANDOM_PIN for my firmware version.
> I honestly never use bluetooth on a desktop. Does your device connect to the web client with ble? Do you get any output with `meshtastic --ble-scan`? I don't have an indicator but I was just now able to connect to my tdeck using `contact --ble 'xDEC_a158'`. It took a couple of tries.
**TL;DR I solved it, look at the end**
Goddamn, I guess some setting is messed up
```
meshtastic --ble-scan
INFO file:ble_interface.py scan line:116 Scanning for BLE devices (takes 10 seconds)...
Found: name='Meshtastic_729c' address='xxx'
BLE scan finished
```
and
```
❯ meshtastic --ble Meshtastic_729c --info
INFO file:ble_interface.py scan line:116 Scanning for BLE devices (takes 10 seconds)...
Traceback (most recent call last):
File "/Users/fab/.local/bin/meshtastic", line 8, in <module>
sys.exit(main())
~~~~^^
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/meshtastic/__main__.py", line 2062, in main
common()
~~~~~~^^
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/meshtastic/__main__.py", line 1237, in common
client = BLEInterface(
args.ble if args.ble != "any" else None,
...<2 lines>...
noNodes=args.no_nodes,
)
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/meshtastic/ble_interface.py", line 58, in __init__
self.client = self.connect(address)
~~~~~~~~~~~~^^^^^^^^^
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/meshtastic/ble_interface.py", line 167, in connect
client.connect()
~~~~~~~~~~~~~~^^
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/meshtastic/ble_interface.py", line 267, in connect
return self.async_await(self.bleak_client.connect(**kwargs))
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/meshtastic/ble_interface.py", line 296, in async_await
return self.async_run(coro).result(timeout)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
~~~~~~~~~~~~~~~~~^^
File "/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/bleak/__init__.py", line 615, in connect
return await self._backend.connect(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/bleak/backends/corebluetooth/client.py", line 136, in connect
await manager.connect(self._peripheral, disconnect_callback, timeout=timeout)
File "/Users/fab/.local/pipx/venvs/meshtastic/lib/python3.13/site-packages/bleak/backends/corebluetooth/CentralManagerDelegate.py", line 171, in connect
await future
bleak.exc.BleakError: failed to connect: Error Domain=CBErrorDomain Code=14 "Peer removed pairing information" UserInfo={NSLocalizedDescription=Peer removed pairing information}
```
I fixed Bluetooth connection to SenseCAP Indicator:
1. Removed device from Mac's Bluetooth paired devices
2. Set fixed PIN via USB:
```
meshtastic -s --port /dev/cu.usbserial-11210 --set bluetooth.enabled true --set bluetooth.mode FIXED_PIN --set bluetooth.fixed_pin 123456
```
3. Verified settings with `--get bluetooth`
4. Successfully connected with `meshtastic --ble Meshtastic_729c --info`
Seeing the error "BleakError: failed to connect: Error Domain=CBErrorDomain Code=14 'Peer removed pairing information'" was very helpful in diagnosing the issue. This is exactly why it would be better if these errors were shown directly in the terminal instead of just in log files.
The issue was caused by pairing conflicts. Using FIXED_PIN mode (123456) worked better than RANDOM_PIN for my firmware version.
<!-- github-comment-id:2965543114 -->
I've made initial connection errors show in the console in #207
Hopefully this helps diagnose the app not launching when the node isn't connected.
I've made initial connection errors show in the console in #207
Hopefully this helps diagnose the app not launching when the node isn't connected.
<!-- github-comment-id:3082889845 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I'm trying to connect to a device via bluetooth, I use the
contact --ble Meshtastic_xxxxcommand, the program starts up, but then crashes back to the terminal without any message.It would be helpful to see why it closed up itsself, if there were any error.
Or to have a command option/parameter in order to enable this verbose debug log mode.
I have no issues connecting to my T-Echo, but I'm unable to connect to the Sensecap Indicator
The log is sent to a file in the contact directory. I really should allow the connection errors to print to the terminal. The reason you can't connect to the senscap is that the client API is in use by MUI. You can only have one connection at a time.
I usually have "tail -f contact/client.log" running in another terminal/pane.
Thanks, these are the logs:
Forgive me, I don't understand
So if I turn on the Indicator, MUI loads up, no other devices connected via BT, I would never be able to connect with the contact command via BT? But only with the serial USB
You would not be able to use any connection, Bluetooth, Serial or TCP while MUI is running. You can use Contact with the Indicator only if you boot in programming mode:
https://meshtastic.org/docs/software/meshtastic-ui/#bluetooth-programming-mode
Yes, I confirm it was already rebooted in programming mode with the green screen, the bluetooth logo, the ">> Programming mode <<" and at the bottom the fixed "123456" PIN shown.
When I ran the
contact --ble Meshtastic_xxxxcommand it started loading contact, but then it was quitted after some secondsI honestly never use bluetooth on a desktop. Does your device connect to the web client with ble? Do you get any output with
meshtastic --ble-scan?I don't have an indicator but I was just now able to connect to my tdeck using
contact --ble 'xDEC_a158'. It took a couple of tries.Huh, looks like it uses the short name? Also, try with single/double quotes around the device name.
TL;DR I solved it, look at the end
Goddamn, I guess some setting is messed up
and
I fixed Bluetooth connection to SenseCAP Indicator:
--get bluetoothmeshtastic --ble Meshtastic_729c --infoSeeing the error "BleakError: failed to connect: Error Domain=CBErrorDomain Code=14 'Peer removed pairing information'" was very helpful in diagnosing the issue. This is exactly why it would be better if these errors were shown directly in the terminal instead of just in log files.
The issue was caused by pairing conflicts. Using FIXED_PIN mode (123456) worked better than RANDOM_PIN for my firmware version.
I've made initial connection errors show in the console in #207
Hopefully this helps diagnose the app not launching when the node isn't connected.