Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting --ble crashed the python #550

Open
slash-bit opened this issue Apr 21, 2024 · 1 comment
Open

Connecting --ble crashed the python #550

slash-bit opened this issue Apr 21, 2024 · 1 comment

Comments

@slash-bit
Copy link

Hi, I get the following error when connecting via BLE to any of my nodes. Tried with name or address of the device .

PS C:\Users\v-b2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts> meshtastic --ble-scan
Found: name='0000_d46d' address='F9:D9:14:60:D4:6D'
BLE scan finished

PS C:\Users\v-b2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts> meshtastic --ble 0000_d46d --noproto
INFO file:client.py pair line:618 Paired to device with protection level <DevicePairingProtectionLevel.NONE: 1>.
WARNING file:mesh_interface.py _sendToRadio line:729 Not sending packet because protocol use is disabled by noProto
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in run_module_as_main
return run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\v-b2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts\meshtastic.exe_main
.py", line 7, in
File "C:\Users\v-b2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\meshtastic_main
.py", line 1475, in main
common()
File "C:\Users\v-b2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\meshtastic_main
.py", line 1011, in common
client = BLEInterface(args.ble, debugOut=logfile, noProto=args.noproto)
File "C:\Users\v-b2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\meshtastic\ble_interface.py", line 70, in init
self.client.start_notify(FROMNUM_UUID, self.from_num_handler)
File "C:\Users\v-b2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\meshtastic\ble_interface.py", line 207, in start_notify
self.async_await(self.bleak_client.start_notify(*args, **kwargs))
File "C:\Users\v-b2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\meshtastic\ble_interface.py", line 220, in async_await
return self.async_run(coro).result(timeout)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\concurrent\futures_base.py", line 458, in result
return self.__get_result()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\concurrent\futures_base.py", line 403, in __get_result
raise self.exception
File "C:\Users\v-b2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\bleak_init
.py", line 834, in start_notify
await self._backend.start_notify(characteristic, wrapped_callback, **kwargs)
File "C:\Users\v-b2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\bleak\backends\winrt\client.py", line 974, in start_notify
await winrt_char.write_client_characteristic_configuration_descriptor_async(
OSError: [WinError -2140864507] The attribute requires authentication before it can be read or written

@ianmcorvidae
Copy link
Contributor

It looks like you're not properly paired with the meshtastic node to me. Did you get asked to input a PIN at any point? I'm not very familiar with the Windows BLE stuff, so I'm not sure how exactly it's expected to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants