question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bluetooth related errors when testing with nrf52 dev board

See original GitHub issue

While testing the nrf52 dev board I found it to be inconsistent. The following logs are the most common errors which all appear to point back to the gatt-python/gatt/gatt_linux.py file.

The following exceptions are found the the nuimo_app.log file:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/gatt/gatt_linux.py", line 274, in _connect
    self._object.Connect()
  File "/usr/lib/python3.5/site-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python3.5/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownObject: Method "Connect" with signature "" on interface "org.bluez.Device1" doesn't exist

and

  File "/usr/lib/python3.5/site-packages/nuimo/nuimo.py", line 135, in connect_failed
    self.listener.connect_failed(error)
  File "/home/root/senic-hub/senic_hub/nuimo_app/__init__.py", line 38, in connect_failed
    self.controller.connect()
  File "/usr/lib/python3.5/site-packages/nuimo/nuimo.py", line 130, in connect
    super().connect()
  File "/usr/lib/python3.5/site-packages/gatt/gatt_linux.py", line 269, in connect
    self._connect()
  File "/usr/lib/python3.5/site-packages/gatt/gatt_linux.py", line 279, in _connect
    self.connect_failed(errors.Failed("Device does not exist, check adapter name and MAC address."))

The following exceptions are found the the senic_hub.log file:

2017-11-13 14:18:00,279 ERROR [waitress] Exception when serving /-/confnuimos
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/waitress/channel.py", line 338, in service
    task.service()
  File "/usr/lib/python3.5/site-packages/waitress/task.py", line 169, in service
    self.execute()
  File "/usr/lib/python3.5/site-packages/waitress/task.py", line 399, in execute
    app_iter = self.channel.server.application(env, start_response)
  File "/usr/lib/python3.5/site-packages/raven/middleware.py", line 98, in __call__
    iterable = self.application(environ, start_response)
  File "/usr/lib/python3.5/site-packages/pyramid/router.py", line 236, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/usr/lib/python3.5/site-packages/pyramid/router.py", line 211, in invoke_subrequest
    response = handle_request(request)
  File "/usr/lib/python3.5/site-packages/pyramid/tweens.py", line 51, in excview_tween
    request_iface=request_iface.combined
  File "/usr/lib/python3.5/site-packages/pyramid/view.py", line 547, in _call_view
    response = view_callable(context, request)
  File "/usr/lib/python3.5/site-packages/pyramid/viewderivers.py", line 413, in viewresult_to_response
    result = view(context, request)
  File "/usr/lib/python3.5/site-packages/pyramid/tweens.py", line 22, in excview_tween
    response = handler(request)
  File "/usr/lib/python3.5/site-packages/pyramid/router.py", line 158, in handle_request
    view_name
  File "/usr/lib/python3.5/site-packages/pyramid/view.py", line 547, in _call_view
    response = view_callable(context, request)
  File "/usr/lib/python3.5/site-packages/pyramid/config/views.py", line 182, in __call__
    return view(context, request)
  File "/usr/lib/python3.5/site-packages/pyramid/viewderivers.py", line 393, in attr_view
    return view(context, request)
  File "/usr/lib/python3.5/site-packages/pyramid/viewderivers.py", line 371, in predicate_wrapper
    return view(context, request)
  File "/usr/lib/python3.5/site-packages/pyramid/viewderivers.py", line 442, in rendered_view
    result = view(context, request)
  File "/usr/lib/python3.5/site-packages/pyramid/viewderivers.py", line 147, in _requestonly_view
    response = view(request)
  File "/usr/lib/python3.5/site-packages/cornice/service.py", line 493, in wrapper
    response = view_(request)
  File "/home/root/senic-hub/senic_hub/backend/views/nuimos.py", line 102, in get_configured_nuimos
    config['nuimos'][mac_address]['is_connected'] = controller.is_connected()
  File "/usr/lib/python3.5/site-packages/gatt/gatt_linux.py", line 342, in is_connected
    return self._properties.Get('org.bluez.Device1', 'Connected') == 1
  File "/usr/lib/python3.5/site-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3.5/site-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python3.5/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownObject: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
papapumpkinscommented, Nov 23, 2017

[UPDATE 5, 23-11-17][11:38PM] [NRF52] Some good news! With some fixes in the Zephyr code, the BT Module can be made to connect to more than one devices simultaneously. Following are the mods that got it working for me:

  • Add in ..zephyr/samples/bluetooth/hci_uart/nrf5.conf:
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_MAX_CONN=16
CONFIG_BT_MAX_PAIRED=16
  • Note that the above specs should be exactly in the same order as above. Might not work if you shuffle them.
  • To be double sure, add the above configs to ..zephyr/samples/bluetooth/hci_uart/generic.conf

Now, generate the HEX and flash the board. Power off the NanoPi, connect the board and boot. If you see a change in the mac address of the bt board, it has been flashed with the changes.

Now using bluetoothctl CLI, connect to one Nuimo, and wait for a few seconds. Now while the Nuimo is connected, perform: [Nuimo]# connect <another_nuimo_mac_addr> . This should give you a positive connection message. This means that both Nuimos have been successfully paired. Note: The DBUS communication is not always perfect when using this board, so it might connect to two Nuimos and then not connect to anymore. Note: Reconnection of disconnected Nuimos is still not fixed. That has to be fixed from the Senic Hub application stack.

0reactions
jaykishan-solankicommented, Oct 11, 2022

DBUS BLE exception while bluetooth pairing Exception in thread Thread-12: Traceback (most recent call last): File “/home/root/obd/obd_gen2_ble_py/blemodule/adapter.py”, line 146, in powered self.adapter_props.Set(constants.ADAPTER_INTERFACE, ‘Powered’, File “/usr/lib/python3.8/site-packages/dbus/proxies.py”, line 141, in call return self._connection.call_blocking(self._named_service, File “/usr/lib/python3.8/site-packages/dbus/connection.py”, line 652, in call_blocking reply_message = self.send_message_with_reply_and_block( dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.1 was not provided by any .service files

Read more comments on GitHub >

github_iconTop Results From Across the Web

Known issues — nRF Connect SDK 2.2.99 documentation
Workaround: Include the board version when building the Bluetooth: HCI low power UART sample and the nRF9160: LTE Sensor Gateway sample.
Read more >
NRF52840 unable to initialize the Bluetooth stack without the ...
Currently, my code is written using the nrf52 sdk v17. When I am connected and powered off the programming board, the test board...
Read more >
Bluetooth low energy central tutorial - Nordic DevZone
Equipment and software used in this tutorial: 2 x nRF52 devices. [nRF52 Development Kit](https://www.nordicsemi.com/eng/Products/Bluetooth-low- ...
Read more >
Renode, Zephyr, and the nRF52840 - Nordic DevZone
Renode has extensive support for boards (including many of Nordic's Bluetooth LE-enabled boards) available in Zephyr, which you can check in the ...
Read more >
nRF52 DFU working on dev kit, not on custom board
The problem is trying to run the bootloader code on the custom board - it sometimes takes several attempts to connect over BlueTooth...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found