[Feature request] Have a command parameter to enable verbose logs #59

Closed
opened 2026-10-05 03:18:12 +02:00 by adam · 10 comments
Owner

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 -->
adam closed this issue 2026-10-05 03:18:12 +02:00
Author
Owner

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 -->
Author
Owner

I usually have "tail -f contact/client.log" running in another terminal/pane.

I usually have "tail -f contact/client.log" running in another terminal/pane. <!-- github-comment-id:2960797880 -->
Author
Owner

I usually have "tail -f contact/client.log" running in another terminal/pane.

Thanks, these are the logs:

tail -n 100 /opt/homebrew/lib/python3.11/site-packages/contact/client.log

2025-06-11 00:21:42,307 - ERROR - Fatal error: invalid literal for int() with base 10: ''
2025-06-11 00:21:42,316 - ERROR - Traceback: Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 125, in start
    curses.wrapper(main)
  File "/opt/homebrew/Cellar/python@3.11/3.11.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 102, in main
    main_ui(stdscr)
  File "/opt/homebrew/lib/python3.11/site-packages/contact/ui/contact_ui.py", line 150, in main_ui
    handle_backtick(stdscr)
  File "/opt/homebrew/lib/python3.11/site-packages/contact/ui/contact_ui.py", line 360, in handle_backtick
    settings_menu(stdscr, interface_state.interface)
  File "/opt/homebrew/lib/python3.11/site-packages/contact/ui/control_ui.py", line 457, in settings_menu
    new_value = current_value if new_value is None else int(new_value)
                                                        ^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

2025-06-11 00:43:12,061 - CRITICAL - Fatal error initializing interface: failed to connect: Error Domain=CBErrorDomain Code=14 "Peer removed pairing information" UserInfo={NSLocalizedDescription=Peer removed pairing information}
2025-06-11 00:43:12,061 - ERROR - Uncaught exception: 'NoneType' object has no attribute 'localNode'
2025-06-11 00:43:12,074 - ERROR - Traceback: Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 99, in main
    initialize_globals(args)
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 66, in initialize_globals
    if interface_state.interface.localNode.localConfig.lora.region == 0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'localNode'

2025-06-11 00:43:12,074 - ERROR - Console output:


2025-06-11 00:43:12,075 - ERROR - Fatal error: 'NoneType' object has no attribute 'localNode'
2025-06-11 00:43:12,089 - ERROR - Traceback: Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 125, in start
    curses.wrapper(main)
  File "/opt/homebrew/Cellar/python@3.11/3.11.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 99, in main
    initialize_globals(args)
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 66, in initialize_globals
    if interface_state.interface.localNode.localConfig.lora.region == 0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'localNode'

2025-06-11 00:43:31,814 - CRITICAL - Fatal error initializing interface: failed to connect: Error Domain=CBErrorDomain Code=14 "Peer removed pairing information" UserInfo={NSLocalizedDescription=Peer removed pairing information}
2025-06-11 00:43:31,815 - ERROR - Uncaught exception: 'NoneType' object has no attribute 'localNode'
2025-06-11 00:43:31,818 - ERROR - Traceback: Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 99, in main
    initialize_globals(args)
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 66, in initialize_globals
    if interface_state.interface.localNode.localConfig.lora.region == 0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'localNode'

2025-06-11 00:43:31,818 - ERROR - Console output:


2025-06-11 00:43:31,819 - ERROR - Fatal error: 'NoneType' object has no attribute 'localNode'
2025-06-11 00:43:31,820 - ERROR - Traceback: Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 125, in start
    curses.wrapper(main)
  File "/opt/homebrew/Cellar/python@3.11/3.11.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 99, in main
    initialize_globals(args)
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 66, in initialize_globals
    if interface_state.interface.localNode.localConfig.lora.region == 0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'localNode'

2025-06-11 00:48:19,198 - CRITICAL - Fatal error initializing interface: failed to connect: Error Domain=CBErrorDomain Code=14 "Peer removed pairing information" UserInfo={NSLocalizedDescription=Peer removed pairing information}
2025-06-11 00:48:19,200 - ERROR - Uncaught exception: 'NoneType' object has no attribute 'localNode'
2025-06-11 00:48:19,202 - ERROR - Traceback: Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 99, in main
    initialize_globals(args)
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 66, in initialize_globals
    if interface_state.interface.localNode.localConfig.lora.region == 0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'localNode'

2025-06-11 00:48:19,202 - ERROR - Console output:


2025-06-11 00:48:19,202 - ERROR - Fatal error: 'NoneType' object has no attribute 'localNode'
2025-06-11 00:48:19,203 - ERROR - Traceback: Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 125, in start
    curses.wrapper(main)
  File "/opt/homebrew/Cellar/python@3.11/3.11.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 99, in main
    initialize_globals(args)
  File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 66, in initialize_globals
    if interface_state.interface.localNode.localConfig.lora.region == 0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'localNode'

> I usually have "tail -f contact/client.log" running in another terminal/pane. Thanks, these are the logs: ``` tail -n 100 /opt/homebrew/lib/python3.11/site-packages/contact/client.log 2025-06-11 00:21:42,307 - ERROR - Fatal error: invalid literal for int() with base 10: '' 2025-06-11 00:21:42,316 - ERROR - Traceback: Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 125, in start curses.wrapper(main) File "/opt/homebrew/Cellar/python@3.11/3.11.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/curses/__init__.py", line 94, in wrapper return func(stdscr, *args, **kwds) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 102, in main main_ui(stdscr) File "/opt/homebrew/lib/python3.11/site-packages/contact/ui/contact_ui.py", line 150, in main_ui handle_backtick(stdscr) File "/opt/homebrew/lib/python3.11/site-packages/contact/ui/contact_ui.py", line 360, in handle_backtick settings_menu(stdscr, interface_state.interface) File "/opt/homebrew/lib/python3.11/site-packages/contact/ui/control_ui.py", line 457, in settings_menu new_value = current_value if new_value is None else int(new_value) ^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '' 2025-06-11 00:43:12,061 - CRITICAL - Fatal error initializing interface: failed to connect: Error Domain=CBErrorDomain Code=14 "Peer removed pairing information" UserInfo={NSLocalizedDescription=Peer removed pairing information} 2025-06-11 00:43:12,061 - ERROR - Uncaught exception: 'NoneType' object has no attribute 'localNode' 2025-06-11 00:43:12,074 - ERROR - Traceback: Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 99, in main initialize_globals(args) File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 66, in initialize_globals if interface_state.interface.localNode.localConfig.lora.region == 0: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'localNode' 2025-06-11 00:43:12,074 - ERROR - Console output: 2025-06-11 00:43:12,075 - ERROR - Fatal error: 'NoneType' object has no attribute 'localNode' 2025-06-11 00:43:12,089 - ERROR - Traceback: Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 125, in start curses.wrapper(main) File "/opt/homebrew/Cellar/python@3.11/3.11.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/curses/__init__.py", line 94, in wrapper return func(stdscr, *args, **kwds) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 99, in main initialize_globals(args) File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 66, in initialize_globals if interface_state.interface.localNode.localConfig.lora.region == 0: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'localNode' 2025-06-11 00:43:31,814 - CRITICAL - Fatal error initializing interface: failed to connect: Error Domain=CBErrorDomain Code=14 "Peer removed pairing information" UserInfo={NSLocalizedDescription=Peer removed pairing information} 2025-06-11 00:43:31,815 - ERROR - Uncaught exception: 'NoneType' object has no attribute 'localNode' 2025-06-11 00:43:31,818 - ERROR - Traceback: Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 99, in main initialize_globals(args) File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 66, in initialize_globals if interface_state.interface.localNode.localConfig.lora.region == 0: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'localNode' 2025-06-11 00:43:31,818 - ERROR - Console output: 2025-06-11 00:43:31,819 - ERROR - Fatal error: 'NoneType' object has no attribute 'localNode' 2025-06-11 00:43:31,820 - ERROR - Traceback: Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 125, in start curses.wrapper(main) File "/opt/homebrew/Cellar/python@3.11/3.11.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/curses/__init__.py", line 94, in wrapper return func(stdscr, *args, **kwds) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 99, in main initialize_globals(args) File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 66, in initialize_globals if interface_state.interface.localNode.localConfig.lora.region == 0: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'localNode' 2025-06-11 00:48:19,198 - CRITICAL - Fatal error initializing interface: failed to connect: Error Domain=CBErrorDomain Code=14 "Peer removed pairing information" UserInfo={NSLocalizedDescription=Peer removed pairing information} 2025-06-11 00:48:19,200 - ERROR - Uncaught exception: 'NoneType' object has no attribute 'localNode' 2025-06-11 00:48:19,202 - ERROR - Traceback: Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 99, in main initialize_globals(args) File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 66, in initialize_globals if interface_state.interface.localNode.localConfig.lora.region == 0: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'localNode' 2025-06-11 00:48:19,202 - ERROR - Console output: 2025-06-11 00:48:19,202 - ERROR - Fatal error: 'NoneType' object has no attribute 'localNode' 2025-06-11 00:48:19,203 - ERROR - Traceback: Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 125, in start curses.wrapper(main) File "/opt/homebrew/Cellar/python@3.11/3.11.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/curses/__init__.py", line 94, in wrapper return func(stdscr, *args, **kwds) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 99, in main initialize_globals(args) File "/opt/homebrew/lib/python3.11/site-packages/contact/__main__.py", line 66, in initialize_globals if interface_state.interface.localNode.localConfig.lora.region == 0: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'localNode' ``` <!-- github-comment-id:2962022745 -->
Author
Owner

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 -->
Author
Owner

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

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 -->
Author
Owner

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

> 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 -->
Author
Owner

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 -->
Author
Owner

Huh, looks like it uses the short name? Also, try with single/double quotes around the device name.

Huh, looks like it uses the short name? Also, try with single/double quotes around the device name. <!-- github-comment-id:2965252492 -->
Author
Owner

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
  1. Verified settings with --get bluetooth
  2. 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 -->
Author
Owner

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 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/contact#59