khvzak / bluez-tools Goto Github PK
View Code? Open in Web Editor NEWA set of tools to manage bluetooth devices for linux
License: GNU General Public License v2.0
A set of tools to manage bluetooth devices for linux
License: GNU General Public License v2.0
bluez-tools =========== See "Installation" for compile instructions. This was a GSoC'10 project to implement a new command line tools for bluez (bluetooth stack for linux). It is currently an active open source project. The project is implemented in C and uses the D-Bus interface of bluez. The project is still a work in progress, and not all APIs from Bluez have been implemented as a part of bluez-tools. The APIs which have been implemented in bluez-tools are adapter, agent, device, network and obex. Other APIs, such as interfaces for medical devices, pedometers and other specific APIs have not been ported to bluez-tools. Some bluez-tool source relied on the previous version of bluez (4), and have been deprecated, dropped and removed from the code. If such functionality exists in another form in bluez (5), a developer should feel free to clone the project, make the changes and send a merge request. If this is a major change, perhaps requiring multiple eyes, a developer should consider registering a change request at the project git repository. We support the project and welcome changes :) The project is currently a beta version, and hiccups will still be present in the code. Register bugs at the project git repository. Project website: http://code.google.com/p/bluez-tools/ Project Git repository: https://github.com/khvzak/bluez-tools bt-adapter ========== - List available adapters - Show information about adapter (incl properties) - Discover remote devices (with remote device name resolving) - Change adapter properties (eg. Name, Discoverable, Pairable, etc) bt-agent ======== - Manage incoming Bluetooth requests (eg. request of pincode, request of authorize a connection/service request, etc) bt-device ========= - List added devices - Connect to the remote device by his MAC, retrieve all SDP records and then initiate the pairing - Disconnect the remote device - Remove device (and also the pairing information) - Show information about device (incl properties) - Service discovery - Change device properties (eg. Name, Trusted, Blocked, etc) bt-network ========== - Connect to the network device - Register network server for the provided UUID (gn/panu/nap) bt-obex ======= - Agent (to accept/reject incoming bluetooth object push requests) for OBEXD (OPP/FTP profile) - Send local file to the specified remote device using object push profile - Start FTP session with remote device Installation ============ Run `./autogen.sh' at the project root directory. This will generate the missing files you need to compile. Then run `./configure' followed by `make' and then `make install' to compile and install bluez-tools. `make install' requires root access. You can read `INSTALL' for detailed instructions on how to use `./configure'. Requirements ============ bluez-tools post v0.2 uses bluez-5.20 API. Due to the removal of DiscoverServices in the BlueZ 5 device API, bt-device requires `sdptool' (included in bluez-utils) for service discovery. Release Notes ============ For information regarding the changes of bluez-tools, please refer to the `ChangeLog' file included in the project. License ============ bluez-tools is released under the GNU General Public License version 2 (GPLv2). Refer to the `COPYING' file for details regarding the license. Known Issues ============ - Discovery mode on `bt-adapter' has no default timeout, which means it will last indefinitly. Using SIGINT (control-c) turns off the discovery scan and exits `bt-adapter'. - `bt-agent' does not recieve a `unregistered' callback signal in BlueZ 5, even when the agent manager successfully unregisters the agent. You will need to use SIGINT (control-c) twice to exit `bt-agent'. - Running `bt-agent' as a daemon process is currently broken.' - bt-network and bt-obex FTP has been implemented but it is largely untested with BlueZ 5. Unaddressed Issues From Pre v0.2 ============ - FTP session closes unexpectedly after the command "ls" (bug in OBEXD?) - Copy/Move methods not yet implemented (OBEXD)
bt-adapter is consistently crashing after disabling Bluetooth using rfkill. This was originally reported in Fedora by multiple users.
Connecting to: 5C:0E:8B:03:6E:4E
Device: CS3070:10172522500886 (5C:0E:8B:03:6E:4E)
Enter passkey: 1234
Segmentation fault
Debugging with gdb reveals the following backtrace
#0 0xb6e77d00 in g_utf8_validate () from /usr/lib/libglib-2.0.so.0
#1 0xb6e7b5c8 in g_variant_new_string () from /usr/lib/libglib-2.0.so.0
#2 0x0000c0b8 in _bt_agent_method_call_func (connection=,
sender=<optimized out>, object_path=<optimized out>,
interface_name=<optimized out>, method_name=0x18fc228 "RequestPinCode",
parameters=0x1905f00, invocation=0x18fdab0, user_data=0x0)
at lib/agent-helper.c:310
Analyzing line 310 in lib/agent-helper.c indicates a possible cause, passkey is being read into an uninitialized gchar pointer
$ bt-device -l
**
ERROR:lib/bluez/adapter.c:165:adapter_get_dbus_object_path: assertion failed: (ADAPTER_IS(self))
Aborted (core dumped)
$ sudo bt-device -l
**
ERROR:lib/bluez/adapter.c:165:adapter_get_dbus_object_path: assertion failed: (ADAPTER_IS(self))
Aborted
I don't quite understand what am I supposed to do with that. Also I'm not sure about posting this here as similar issues didn't get any responses.
I am successfully running bt-network in both server and client mode. I can connect a pi as a client to an Android phone, and I can connect an Android phone or a MacBook to a pi in server mode. However, when I try to connect one pi to another, both running bt-network, I get an error:
pi@okupi3:~$ sudo /usr/bin/bt-network -c okupi0w nap
Network service is not supported by this device
The server runs with:
/usr/bin/bt-network -s nap bnep
The same happens when I try the other way around.
bluez-tools version is 0.20, from the Debian package:
pi@okupi3:~$ dpkg -l bluez-tools
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=============================-===================-===================-================================================================
ii bluez-tools 0.2.0~20140808-3 armhf Set of tools to manage Bluetooth devices for linux
When bluez calls back into a pairing Agent's Display
methods, they are supposed to display the PIN or passcode on the host device's screen along with instructions telling the user to type that PIN or passcode (followed by ENTER) into the device they are trying to pair. Instead, bt-device --connect
incorrectly prompts the user to confirm the device on the host (i.e. Confirm passkey: 123456 (yes/no)?
), which is the wrong thing to do. It disrupts the pairing process and causes pairing to fail.
Steps to reproduce:
bt-device --services <MACADDRESS>
Expected result:
Actual result:
Failed to start SDP discovery. Please make sure you have bluez-utils installed on your system.
According to the packet manager, sdptool
is a part of bluez-deprecated
package. Why modern tool is using a deprecated one?
Hi guys, I have a problem: bought a BT headset from China, but it does not pair to my Galaxy S6. But it pairs to a computer and Galaxy S4 Micro. How to diagnose it? I should master BT domain. I am Linux Mint user. How to find microcode for my noname device? What updater to use? I've just installed bluez-tools, but bt-audio command is not found... Please advise! Thanks a lot!
There is no configure.
When I install bluez-tool I can't do this command : ./configure.
I fond configure.ac but I don't know how to run configure.ac
Could you fix this issue?
Thank you
Best regards,
Mong
In bt-agent.c you have registered the wrong signal handlers, usr1_signal_handler for SIGTERM and term_signal_handler for SIGUSR1.
/* Add SIGTERM/SIGINT/SIGUSR1 handlers */
g_unix_signal_add (SIGTERM, usr1_signal_handler, NULL);
g_unix_signal_add (SIGINT, term_signal_handler, NULL);
g_unix_signal_add (SIGUSR1, term_signal_handler, NULL);
This stops it gracefully shutting down.
I have tested
/* Add SIGTERM/SIGINT/SIGUSR1 handlers */
g_unix_signal_add (SIGTERM, term_signal_handler, NULL);
g_unix_signal_add (SIGINT, term_signal_handler, NULL);
g_unix_signal_add (SIGUSR1, usr1_signal_handler, NULL);
With a systemd service to start/stop the bt-agent and it works.
Cheers,
Martin.
Hi,
A command such as bt-network -c C8:3E:99:C6:1B:F8 panu, crashes with
#0 0xb6ec7ec8 in g_bit_lock () from /usr/lib/libglib-2.0.so.0
#1 0xb6f240a0 in g_variant_n_children () from /usr/lib/libglib-2.0.so.0
#2 0xb6f24100 in g_variant_get_child_value () from /usr/lib/libglib-2.0.so.0
#3 0x000192e8 in network_connect (self=self@entry=0x14d3470,
uuid=0xbef76e9e "panu", error=error@entry=0xbef76be4)
at lib/bluez/network.c:178
#4 0x0000a3bc in main (argc=0, argv=0x14e5128) at bt-network.c:186
Kind Regards,
Devendra
$ bt-device -i CC:98:8B:B0:C4:6C
[CC:98:8B:B0:C4:6C]
Name: LE_WH-1000XM3
Alias: LE_WH-1000XM3 [rw]
Address: CC:98:8B:B0:C4:6C
Icon: (null)
(bt-device:40186): GLib-GIO-CRITICAL **: 11:41:35.044: g_dbus_proxy_call_sync_internal: assertion 'error == NULL || *error == NULL' failed
Class: 0x0
(bt-device:40186): GLib-GIO-CRITICAL **: 11:41:35.044: g_dbus_proxy_call_sync_internal: assertion 'error == NULL || *error == NULL' failed
Paired: 0
(bt-device:40186): GLib-GIO-CRITICAL **: 11:41:35.044: g_dbus_proxy_call_sync_internal: assertion 'error == NULL || *error == NULL' failed
Trusted: 0 [rw]
(bt-device:40186): GLib-GIO-CRITICAL **: 11:41:35.044: g_dbus_proxy_call_sync_internal: assertion 'error == NULL || *error == NULL' failed
Blocked: 0 [rw]
(bt-device:40186): GLib-GIO-CRITICAL **: 11:41:35.044: g_dbus_proxy_call_sync_internal: assertion 'error == NULL || *error == NULL' failed
Connected: 0
UUIDs: [
(bt-device:40186): GLib-GIO-CRITICAL **: 11:41:35.044: g_dbus_proxy_call_sync_internal: assertion 'error == NULL || *error == NULL' failed
Segmentation fault (core dumped)
Project website: http://code.google.com/p/bluez-tools
Perhaps a GitHub Pages or Readthedocs site might work. Let me know how you feel and I can throw one together.
I've managed to track down the exact issue I think:
https://github.com/khvzak/bluez-tools/blob/master/src/lib/bluez/obex/obex_client.c#L147
I was debugging this issue and that line jumped out at me. I changed to ==, rebuilt and OPP file sending was working.
I can repro using the following:
Raspbian, Bluez 5.23
I tested with Nexus 5X as Bluetooth Other End.
Commands used:
bt-obex -p BD_ADDR /path/to/file
Unpatched fails with asserts like so:
(bt-obex:3830): GLib-CRITICAL **: g_variant_is_object_path: assertion 'string != NULL' failed
(bt-obex:3830): GLib-GIO-CRITICAL **: g_dbus_proxy_new_sync: assertion 'g_variant_is_object_path (object_path)' failed
ERROR:lib/bluez/obex/obex_session.c:166:obex_session_get_dbus_object_path: assertion failed: (self->priv->proxy != NULL)
I thought I'd bring this to your attention and hopefully I didn't misunderstand how that particular function or line worked. I can prepare a small patch to fix this issue and submit a PR, though I'd like to make sure this is an actual issue (I have not spent very long working with bluez-tools).
Thanks,
Keaton
Lines 587 to 589 in f653217
device
here can be NULL
. If it is, it causes an assertion in device_get_address
to fail (so at least it crashes early):
(gdb) run -a "60:57:18:21:55:5B" -p "24:41:8C:A8:7D:5B" main.qml
Starting program: /nix/store/blrjp452yrhyy2i3yadfd60bral7ps75-bluez-tools-2016-12-12/bin/bt-obex -a "60:57:18:21:55:5B" -p "24:41:8C:A8:7D:5B" main.qml
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/nix/store/33idnvrkvfgd5lsx2pwgwwi955adl6sk-glibc-2.31/lib/libthread_db.so.1".
[New Thread 0x7fffea693700 (LWP 32736)]
[New Thread 0x7fffe9e92700 (LWP 32737)]
**
ERROR:lib/bluez/device.c:265:device_get_address: assertion failed: (DEVICE_IS(self))
Bail out! ERROR:lib/bluez/device.c:265:device_get_address: assertion failed: (DEVICE_IS(self))
Thread 1 "bt-obex" received signal SIGABRT, Aborted.
0x00007ffff7aa508a in raise () from /nix/store/33idnvrkvfgd5lsx2pwgwwi955adl6sk-glibc-2.31/lib/libc.so.6
(gdb) bt
#0 0x00007ffff7aa508a in raise () from /nix/store/33idnvrkvfgd5lsx2pwgwwi955adl6sk-glibc-2.31/lib/libc.so.6
#1 0x00007ffff7a8f528 in abort () from /nix/store/33idnvrkvfgd5lsx2pwgwwi955adl6sk-glibc-2.31/lib/libc.so.6
#2 0x00007ffff7ec1dd3 in g_assertion_message.cold () from /nix/store/m7f15ibdd637dy3aysakk47xkqzj956l-glib-2.64.5/lib/libglib-2.0.so.0
#3 0x00007ffff7f1d61b in g_assertion_message_expr () from /nix/store/m7f15ibdd637dy3aysakk47xkqzj956l-glib-2.64.5/lib/libglib-2.0.so.0
#4 0x000000000040d1b1 in device_get_address ()
#5 0x0000000000404a18 in main ()
Not sure why device
is NULL
for me, but that's a different story.
Also not sure about the level of "NULL checks" in general, so feel free to ignore/close if this is "normal" and wanted behavior (the assertion at least catches it).
Apple Magic Trackpad (A1339) turns off every few minutes. I am using Ubuntu 23.04.
libinput --version: 1.22.1.
The trackpad periodically turns off and then, after a dozen seconds, reconnects. I'll attach a report from hciconfig, bluetoothctl, syslog, sudo btmon:
https://pastebin.com/3A9EXusp
I love using the trackpad, but these reconnections make interacting with it impossible. This trackpad works great with android phone and doesn't have any reconnects. Connectivity is constantly lost with Ubuntu. This also happens with different usb bluetooth dongles.
This issue has been reported here:
https://bugs.launchpad.net/linux/+bug/1834085
and
https://bugzilla.kernel.org/show_bug.cgi?id=204589
I booted Ubuntu 23.04(kernel 6.2.0) from a flash drive - the same error:
https://pastebin.com/5KtUjCHQ
I booted from Fedor's(kernel 6.2.9) flash drive - error:
https://pastebin.com/4LJC7NJQ
When using Fedora, communication breaks also occur.
What other logs and reports do I need to provide in order to sort out the problem?
Where else can you write about it?
Thank you!
Since bt-device --connect
is the intended way to initiate a pairing operation, it needs to provide an optional --capability
argument that the caller can use to specify the desired agent capability to use. For example:
DisplayYesNo
, then the agent should not prompt the user for any input other than a yes/no confirmationAny plans to bring bt-audio back in the current version?
The function g_ascii_strdown(), which is used in lib/manager.c, lib/properties.c, and lib/helpers.c returns a newly allocated string. These strings are compared, but the pointers to the strings aren't kept for subsequent free-ing.
Hi,
I am using Bluez 5.37 and I would like to use agent for setting the capability and authorizing the device.
For example: "agent -c NoInputNoOutput 0000 &" in Bluez 4.101.
However, bluetoothctl is providing the NoInputNoOutput capability using the agent option but the pin as well is needed. I came across bt-agent functionality in Bluez 5.37 and it is same as agent in Bluez 4.101.
I would like to know how to generate the executable for the bt-agent since my end application is on OpenWRT platform. I have been analysing the Makefile for Bluez 5.37 and blutoothd-agent is being enables at several places.
However, I am unable to get clarity on this issue. Any inputs on the same would be appreciated.
--
Thanks
Given that it is in google code it might have been down for a long while.
Hi, when I try to connect bt-network to the Internet interface like this :
sudo bt-network -c wlo1 pan0
It does not work at all. it prints this :
**
ERROR:lib/bluez/device.c:165:device_get_dbus_object_path: assertion failed: (DEVICE_IS(self))
Bail out! ERROR:lib/bluez/device.c:165:device_get_dbus_object_path: assertion failed: (DEVICE_IS(self))
Aborted (core dumped)
So how can I create a nap server on the bridge pan0 for it to have Internet connection, so that when I connect a device, it appears as bnep0, and have Internet ???
https://superuser.com/questions/1525732/how-to-link-network-device-with-pan0
When using bluez-tools commit 7cb788c (Fedora 27 package bluez-tools-0.2.0-0.7.git20170912.7cb788c.fc27.x86_64
), it's not possible to reconnect an already added device. Disconnection works and using bluetoothctl
from bluez to connect also works:
$ bluetoothctl
[NEW] Controller 7C:7A:91:xx:xx:xx localhost.localdomain [default]
[NEW] Device 50:1A:A5:xx:xx:xx Jabra EVOLVE 65
Agent registered
[bluetooth]# connect 50:1A:A5:xx:xx:xx
Attempting to connect to 50:1A:A5:xx:xx:xx
[CHG] Device 50:1A:A5:xx:xx:xx Connected: yes
Connection successful
[CHG] Device 50:1A:A5:xx:xx:xx ServicesResolved: yes
[Jabra EVOLVE 65]# quit
Agent unregistered
[DEL] Controller 7C:7A:91:xx:xx:xx localhost.localdomain [default]
$ bt-device -l
Added devices:
Jabra EVOLVE 65 (50:1A:A5:xx:xx:xx)
$ bt-device -d 50:1A:A5:xx:xx:xx
Disconnecting: 50:1A:A5:xx:xx:xx
Done
$ bt-device -c '50:1A:A5:xx:xx:xx'
Connecting to: 50:1A:A5:xx:xx:xx
Error: GDBus.Error:org.bluez.Error.AlreadyExists: Already Exists
I want to use bt-network in both server and client mode. Is there a way to create the interfaces with another name than one starting with 'bnep'? For example, in server mode, the bridge interfaces for its clients will be named 'bnep0', 'bnep1' and so on. But if bt-network in client mode is started later, this will make the name for its interface unpredictable. So I would like to use different basenames for the interfaces, one for client mode and another for server mode. I observed that even if the bridge name for server mode is set to 'nap', the client interfaces will get names starting with 'bnep0'.
Aug 09 15:51:21 nathanb-dev systemd-coredump[744532]: Process 744528 (bt-adapter) of user 1000 dumped core.
Stack trace of thread 744528:
#0 0x00007fc3f6830355 raise (libc.so.6 + 0x3c355)
#1 0x00007fc3f6819853 abort (libc.so.6 + 0x25853)
#2 0x00007fc3f6be7084 n/a (libglib-2.0.so.0 + 0x1c084)
#3 0x00007fc3f6c453fd g_assertion_message_expr (libglib-2.0.so.0 + 0x7a3fd)
#4 0x0000556395fc9412 n/a (bt-adapter + 0x9412)
#5 0x0000556395fc46ad n/a (bt-adapter + 0x46ad)
#6 0x00007fc3f681b002 __libc_start_main (libc.so.6 + 0x27002)
#7 0x0000556395fc4c3e n/a (bt-adapter + 0x4c3e)
Stack trace of thread 744530:
#0 0x00007fc3f68e905f __poll (libc.so.6 + 0xf505f)
#1 0x00007fc3f6c6b168 n/a (libglib-2.0.so.0 + 0xa0168)
#2 0x00007fc3f6c1bc03 g_main_loop_run (libglib-2.0.so.0 + 0x50c03)
#3 0x00007fc3f6b131a8 n/a (libgio-2.0.so.0 + 0x1001a8)
#4 0x00007fc3f6c45511 n/a (libglib-2.0.so.0 + 0x7a511)
#5 0x00007fc3f6769422 start_thread (libpthread.so.0 + 0x9422)
#6 0x00007fc3f68f3bf3 __clone (libc.so.6 + 0xffbf3)
Stack trace of thread 744529:
#0 0x00007fc3f68e905f __poll (libc.so.6 + 0xf505f)
#1 0x00007fc3f6c6b168 n/a (libglib-2.0.so.0 + 0xa0168)
#2 0x00007fc3f6c1c221 g_main_context_iteration (libglib-2.0.so.0 + 0x51221)
#3 0x00007fc3f6c1c272 n/a (libglib-2.0.so.0 + 0x51272)
#4 0x00007fc3f6c45511 n/a (libglib-2.0.so.0 + 0x7a511)
#5 0x00007fc3f6769422 start_thread (libpthread.so.0 + 0x9422)
#6 0x00007fc3f68f3bf3 __clone (libc.so.6 + 0xffbf3)
Seems to happen sporadically.
Hi guys,
trying to set USB dongle trough bt-agent and bt-device. The idea is to get auto-pairing. Maybe missing something, because its get stuck at this:
[root@archphile ~]# bt-agent --capability=NoInputNoOutput &
[1] 465
[root@archphile ~]# Agent registered
Default agent requested
if i use bluetoothctl everything works, device can be located and paired, so i guess i am missing some commands in bluez-tools usage. What are the steps from the beginning to power and allow for connections:
systemctl start bluetooth.service
bt-adapter -s Powered on
bt-agent --capability=NoInputNoOutput &
is there anything I am missing here?
OS: archlinux
Bluez: 5.49
Please tag a release - there are some distributions that do not support building packages from a git commit that is not assosiated with an upstream release. The latest release (without a tag) seems to be from 2014.
@khvzak
I have built bluez-tools for yocto.
when i try to run bt-adapter or any other tools, I am getting the following error:
bt-adapter: bluez service is not found
Did you forget to run bluetoothd?
But i can see bluetoothd is running:
$ps -elf | grep bluetoothd
4 S root 27445 2350 0 80 0 - 1622 x64_sy 08:00 ttyS0 00:00:00 /usr/libexec/bluetooth/bluetoothd
I can only use htop to send signquit to stop it ,otherwise my rpi won't reboot normally
Libraries are wrongly being added to LDFLAGS, they should be set either in LIBS or LDADD according to autoconf and automake.
This causes failure to build from source (FTBFS) in Ubuntu Wily Proposed as reported in Launchpad #1489661 and Debian #797128.
Hi,
I have tried to use bt-network
to create a PAN network. However, I encountered this assertion failure. What might be the problem here?
Thanks a lot,
Jackie
➜ ~ sudo gdb bt-network
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from bt-network...(no debugging symbols found)...done.
(gdb) run -c "xx:xx:xx:xx:xx:xx" gn
Starting program: /usr/bin/bt-network -c "xx:xx:xx:xx:xx:xx" gn
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff5d55700 (LWP 3772)]
[New Thread 0x7ffff5554700 (LWP 3773)]
**
ERROR:lib/helpers.c:318:intf_supported: assertion failed: (introspection_proxy != NULL)
Thread 1 "bt-network" received signal SIGABRT, Aborted.
0x00007ffff7157428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb)
Hi everyone,
I am using buildroot-2020.02 on a raspberry pi 3B with bluez5_utils ver 5.54.
This is my /boot/config.txt on my Raspberry PI 3B:
# Please note that this is only a sample, we recommend you to change it to fit
# your needs.
# You should override this file using a post-build script.
# See http://buildroot.org/manual.html#rootfs-custom
# and http://elinux.org/RPiconfig for a description of config.txt syntax
kernel=zImage
# To use an external initramfs file
#initramfs rootfs.cpio.gz
# Disable overscan assuming the display supports displaying the full resolution
# If the text shown on the screen disappears off the edge, comment this out
disable_overscan=1
# How much memory in MB to assign to the GPU on Pi models having
# 256, 512 or 1024 MB total memory
gpu_mem_256=100
gpu_mem_512=100
gpu_mem_1024=100
#tstpi-3b-pc
device_tree=bcm2710-rpi-3-b.dtb
core_freq=250
dtparam=i2c_arm=on,i2c_arm_baudrate=200000
dtparam=spi=on
dtparam=watchdog=on
# disable WIFI
dtoverlay=pi3-disable-wifi
# fixes rpi3 ttyAMA0 serial console
dtoverlay=pi3-miniuart-bt
# enable rpi3 ttyAMA0 serial console
enable_uart=1
The uart /dev/ttyAMA0 is used by a 2G module and the uart /dev/ttyS0 is used by the BT device on the raspberry pi 3b.
Before accessing to the command: bt-adapter -s Powered true
I execute the following demons:
# start-stop-daemon -b -S -q -m -p /var/run/bluetoothd.pid --exec /usr/libexec/bluetooth/bluetoothd
# start-stop-daemon -b -S -q -m -p /var/run/btattach.pid --exec /usr/bin/btattach -- -B /dev/ttyS0 -P bcm -S 460800 -N
And everything is ok and I can detect the bt device with the command rfkill list:
# rfkill list
0: phy0: wlan
Soft blocked: no
Hard blocked: no
2: hci0: bluetooth
Soft blocked: no
Hard blocked: no
But after executing the command bt-adapter there is an error:
# /usr/bin/bt-adapter -s Powered true
**
ERROR:lib/bluez/adapter.c:194:adapter_get_properties: assertion failed: (ADAPTER_IS(self))
Bail out! ERROR:lib/bluez/adapter.c:194:adapter_get_properties: assertion failed: (ADAPTER_IS(self))
Aborted
Could anyone help me out, please?
This happens quite regularly to me when connecting an already paired and trusted headphone:
coredump and bt full:
$ coredumpctl gdb
PID: 4119517 (bt-device)
UID: 1000 (schroeter)
GID: 1000 (schroeter)
Signal: 6 (ABRT)
Timestamp: Fri 2020-01-17 06:57:22 CET (17min ago)
Command Line: bt-device -i CC:98:8B:81:27:AD
Executable: /usr/bin/bt-device
Control Group: /user.slice/user-1000.slice/session-2.scope
Unit: session-2.scope
Slice: user-1000.slice
Session: 2
Owner UID: 1000 (schroeter)
Boot ID: 05520c18c36d47c2a7c2a6d9eda77e26
Machine ID: 843dee14172340d1a90273ceeff7e2c1
Hostname: localhost.localdomain
Storage: /var/lib/systemd/coredump/core.bt-device.1000.05520c18c36d47c2a7c2a6d9eda77e26.4119517.1579240642000000000000.lz4
Message: Process 4119517 (bt-device) of user 1000 dumped core.
Stack trace of thread 4119517:
#0 0x00007f97b015d625 raise (libc.so.6)
#1 0x00007f97b01468d9 abort (libc.so.6)
#2 0x00007f97b053fb53 g_assertion_message.cold (libglib-2.0.so.0)
#3 0x00007f97b059c1df g_assertion_message_expr (libglib-2.0.so.0)
#4 0x0000563795ec5859 find_device (bt-device)
#5 0x0000563795ec37c1 main (bt-device)
#6 0x00007f97b01481a3 __libc_start_main (libc.so.6)
#7 0x0000563795ec431e _start (bt-device)
Stack trace of thread 4119521:
#0 0x00007f97b0217a6f __poll (libc.so.6)
#1 0x00007f97b057380e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
#2 0x00007f97b0573943 g_main_context_iteration (libglib-2.0.so.0)
#3 0x00007f97b0573991 glib_worker_main (libglib-2.0.so.0)
#4 0x00007f97b059cfc2 g_thread_proxy (libglib-2.0.so.0)
#5 0x00007f97b00944e2 start_thread (libpthread.so.0)
#6 0x00007f97b0222693 __clone (libc.so.6)
Stack trace of thread 4119522:
#0 0x00007f97b0217a6f __poll (libc.so.6)
#1 0x00007f97b057380e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
#2 0x00007f97b0573b93 g_main_loop_run (libglib-2.0.so.0)
#3 0x00007f97b0462a4a gdbus_shared_thread_func (libgio-2.0.so.0)
#4 0x00007f97b059cfc2 g_thread_proxy (libglib-2.0.so.0)
#5 0x00007f97b00944e2 start_thread (libpthread.so.0)
#6 0x00007f97b0222693 __clone (libc.so.6)
GNU gdb (GDB) Fedora 8.3.50.20190824-26.fc31
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/bt-device...
Reading symbols from /usr/lib/debug/usr/bin/bt-device-0.2.0-0.11.git20170912.7cb788c.fc31.x86_64.debug...
[New LWP 4119517]
[New LWP 4119521]
[New LWP 4119522]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `bt-device -i CC:98:8B:81:27:AD'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 return ret;
[Current thread is 1 (Thread 0x7f97afeb7840 (LWP 4119517))]
[I](gdb) bt full
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
set =
{__val = {0, 140289471293478, 140289472611584, 106, 140289472615168, 1, 140288999860160, 0, 94796738594592, 140289471301001, 140289472611584, 18218432971555196416, 140289472615168, 94796761310000, 94796761310000, 0}}
pid = <optimized out>
tid = <optimized out>
#1 0x00007f97b01468d9 in __GI_abort () at abort.c:79
save_stage = 1
act =
{__sigaction_handler = {sa_handler = 0x77, sa_sigaction = 0x77}, sa_mask = {__val = {140289475451635, 94794223190064, 140728898420736, 0, 95, 140288999860160, 140289475875518, 140289475677625, 94796219678720, 140288999860160, 18218432971555196416, 0, 140288999860160, 140288999860160, 96, 140729139611760}}, sa_flags = -1779562720, sa_restorer = 0x563795ee0720 <__func__.30228>}
sigs = {__val = {32, 0 <repeats 15 times>}}
#2 0x00007f97b053fb53 in g_assertion_message
(domain=<optimized out>, file=<optimized out>, line=<optimized out>, func=0x563795ee0720 <__func__.30228> "find_device", message=<optimized out>) at ../glib/gtestutils.c:2912
lstr = "218\000\376\177\000\000\000\316\317!C\340\324\374\020\262\000\224\227\177\000\000\260\367\355\225\067V\000"
s = 0x7f979400a7c0 "Ш"
#3 0x00007f97b059c1df in g_assertion_message_expr
(domain=domain@entry=0x0, file=file@entry=0x563795ee028f "lib/helpers.c", line=line@entry=218, func=func@entry=0x563795ee0720 <__func__.30228> "find_device", expr=expr@entry=0x563795edf7b0 "adapter != NULL && ADAPTER_IS(adapter)") at ../glib/gtestutils.c:2938
s = 0x563797489500 "assertion failed: (adapter != NULL && ADAPTER_IS(adapter))"
#4 0x0000563795ec5859 in find_device (adapter=<optimized out>, name=0x563797467c70 "CC:98:8B:81:27:AD", error=<optimized out>) at lib/helpers.c:218
__func__ = "find_device"
device = <optimized out>
manager = <optimized out>
objects = <optimized out>
object_path = 0x0
ifaces_and_properties = 0x0
i =
{x = {0, 140289475168615, 140288999857968, 1, 140288999857968, 140288999857984, 140288999857984, 140289475166869, 1, 140288999857968, 140288999857976, 18218432971555196416, 0, 0, 140288999857968, 0}}
#5 0x0000563795ec37c1 in main (argc=<optimized out>, argv=<optimized out>) at bt-device.c:605
device = <optimized out>
error = 0x0
context = <optimized out>
manager = 0x7f9794009ab0 [Manager]
adapter = 0x0
__func__ = "main"
When I run bt-agent in the foreground (bt-agent --capability=NoInputNoOutput
) or manually backgrounded (bt-agent --capability=NoInputNoOutput &
) I'm able to pair my phone correctly with the system, but running it with the daemon flag (bt-agent --capability=NoInputNoOutput -d
), the system is visible to my phone, but trying to pair and connect fails with a generic 'can't connect to device' message. bluez-tools
is running as the most recent repo version available on Raspbian Buster Full (version 2.0~20170911.0.7cb788c-2), on a Raspberry Pi Zero W using the built-in bluetooth chip.
Hi,
Are ISPP and IASP of BLE protocol supported on bluez package?
When I'm trying to get info about devices I get the following:
(bt-device:26340): GLib-GIO-CRITICAL **: 14:25:58.566: g_dbus_proxy_call_sync_internal: assertion 'error == NULL || *error == NULL' failed
Class: 0x0
(bt-device:26340): GLib-GIO-CRITICAL **: 14:25:58.566: g_dbus_proxy_call_sync_internal: assertion 'error == NULL || *error == NULL' failed
Paired: 0
(bt-device:26340): GLib-GIO-CRITICAL **: 14:25:58.566: g_dbus_proxy_call_sync_internal: assertion 'error == NULL || *error == NULL' failed
Trusted: 0 [rw]
(bt-device:26340): GLib-GIO-CRITICAL **: 14:25:58.566: g_dbus_proxy_call_sync_internal: assertion 'error == NULL || *error == NULL' failed
Blocked: 0 [rw]
(bt-device:26340): GLib-GIO-CRITICAL **: 14:25:58.566: g_dbus_proxy_call_sync_internal: assertion 'error == NULL || *error == NULL' failed
Connected: 0
UUIDs: [
(bt-device:26340): GLib-GIO-CRITICAL **: 14:25:58.566: g_dbus_proxy_call_sync_internal: assertion 'error == NULL || *error == NULL' failed
Segmentation fault (core dumped)
It happens on openSUSE Tumbleweed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.