LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-24-2018, 05:45 AM   #1
Francexi
Member
 
Registered: Apr 2012
Location: Italy
Distribution: Slackware
Posts: 75

Rep: Reputation: Disabled
rtl8821ce bluetooth module help


Hi there,
I'm having some trouble in using the bluetooth part of the Realtek 8821ce card. I've compiled and installed the module here https://github.com/endlessm/linux/tr...less/rtl8821ce. The WiFi part works fine, but the bluetooth doesn't seems to run. Googling a bit about that made me discover that the module on endlessm doesn't provide a working bluetooth part. Anyway someone hinted that there's a way to make the bluetooth work, but I could not find it. Anyone want to try helping me?

p.s. sorry for my english, I'm not a native eng speaker
 
Old 04-24-2018, 07:38 PM   #2
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 702

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Hi,

if your HW ID matches 0bda:c024 then you could try the driver attached (tgz file) to this thread (second post):
https://bugs.launchpad.net/ubuntu/+s...m/+bug/1742613
 
Old 05-08-2018, 05:02 AM   #3
Francexi
Member
 
Registered: Apr 2012
Location: Italy
Distribution: Slackware
Posts: 75

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by abga View Post
Hi,

if your HW ID matches 0bda:c024 then you could try the driver attached (tgz file) to this thread (second post):
https://bugs.launchpad.net/ubuntu/+s...m/+bug/1742613
tried this, no effect
 
Old 05-08-2018, 01:36 PM   #4
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 702

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by Francexi View Post
tried this, no effect
Care to elaborate a bit?
- what Slackware version are you currently on? - cat /etc/slackware-version
- what is your actual kernel version? - uname -r
- depending on how your WiFi adapter is connected USB/PCI, the output of lsusb or lspci would be helpful
- the output of your dmesg would provide details about the driver/firmware, try to post only the rtl8821ce & Bluetooth part if you know how
- together with the output of lsmod
- is your /etc/rc.d/rc.bluetooth executable ? Have you started it? (manually /etc/rc.d/rc.bluetooth start)
 
Old 05-10-2018, 03:51 AM   #5
Francexi
Member
 
Registered: Apr 2012
Location: Italy
Distribution: Slackware
Posts: 75

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by abga View Post
Care to elaborate a bit?
- what Slackware version are you currently on? - cat /etc/slackware-version
- what is your actual kernel version? - uname -r
- depending on how your WiFi adapter is connected USB/PCI, the output of lsusb or lspci would be helpful
- the output of your dmesg would provide details about the driver/firmware, try to post only the rtl8821ce & Bluetooth part if you know how
- together with the output of lsmod
- is your /etc/rc.d/rc.bluetooth executable ? Have you started it? (manually /etc/rc.d/rc.bluetooth start)
in order:

-I'm on -current
- 4.14.35
- Is a combo adapter connected to the PCI, but the bluetooth part is showed in lsusb. I post both the output
Code:
05:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter [10ec:c821]
        Subsystem: Lenovo Device [17aa:c024]
        Kernel driver in use: rtl8821ce
        Kernel modules: 8821ce
Code:
Bus 001 Device 011: ID 0bda:c024 Realtek Semiconductor Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0xc024 
  bcdDevice            1.10
  iManufacturer           1 Realtek 
  iProduct                2 Bluetooth Radio 
  iSerial                 3 00e04c000001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          177
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              4 Bluetooth Radio
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              4 Bluetooth Radio
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              4 Bluetooth Radio
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              4 Bluetooth Radio
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              4 Bluetooth Radio
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       4
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              4 Bluetooth Radio
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       5
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              4 Bluetooth Radio
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered
-right now i can't dump the dmesg, I'll post the result later.
Code:
rtk_btusb              69632  0
btbcm                  16384  0
btintel                20480  0
bluetooth             389120  10 rtk_btusb,btintel,bnep,btbcm
-yes, it is executable and starts correctly
 
Old 05-10-2018, 01:59 PM   #6
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 702

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
The dmesg output would be really helpful in understanding what devices were recognized and what drivers loaded.

Do you have more BT devices attached to your system? I've noticed the Broadcom&Intel BT drivers loaded in your lsmod output.
In case you don't want these drivers to load, create the following file:
/etc/modprobe.d/bt-blacklist.conf
- with this content:
Code:
blacklist btintel
blacklist btbcm
- restart your system and check again your dmesg and lsmod outputs

If you still have no Bluetooth, disable /etc/rc.d/rc.bluetooth (remove the exec bit), reboot the system and follow these manual steps to check/activate it:

- check if your BT device was recognized and that you have a hci device, dmesg should contain a line like "HCI dev X registered". Run the following command and check its output:
Code:
/usr/bin/hciconfig -a hci0
- make sure your bluetooth is not blocked
- more details:
http://www.digimantra.com/linux/rfki...-linux-laptop/
- run:
Code:
/usr/sbin/rfkill list
- check the output and if you see your bluetooth blocked in any of the Soft/Hard fields, take the ID and run the following - substitute the ID with the actual value:
Code:
/usr/sbin/rfkill unblock ID
- bring the hci interface up (if it was in a DOWN state while executing /usr/bin/hciconfig -a hci0 ), actually, bringing it up again won't do any harm
Code:
/usr/bin/hciconfig hci0 up
- to test if it's actually working, get a BT device next to your computer, put it in scanning/advertising mode and run this:
Code:
/usr/bin/hcitool lescan
 
Old 05-11-2018, 02:35 AM   #7
Francexi
Member
 
Registered: Apr 2012
Location: Italy
Distribution: Slackware
Posts: 75

Original Poster
Rep: Reputation: Disabled
Here's the dmesg log
Code:
[    7.232779] usb 1-6: New USB device found, idVendor=0bda, idProduct=c024
[    7.233067] usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    7.233352] usb 1-6: Product: Bluetooth Radio 
[    7.233623] usb 1-6: Manufacturer: Realtek 
[    7.233885] usb 1-6: SerialNumber: 00e04c000001
[    7.239432] 8821ce: loading out-of-tree module taints kernel.

[   11.211518] Bluetooth: Core ver 2.22
[   11.213967] NET: Registered protocol family 31
[   11.216371] Bluetooth: HCI device and connection manager initialized
[   11.218631] Bluetooth: HCI socket layer initialized
[   11.220782] Bluetooth: L2CAP socket layer initialized
[   11.222834] Bluetooth: SCO socket layer initialized
[   11.307947] rtk_btusb: Realtek Bluetooth USB driver ver 3.1
[   11.310221] rtk_btcoex: rtk_btcoex_init: version: 1.2
[   11.312237] rtk_btcoex: create workqueue
[   11.314396] rtk_btcoex: alloc buffers 1792, 2432 for ev and l2
[   11.316469] rtk_btusb: btusb_probe intf->cur_altsetting->desc.bInterfaceNumber 0
[   11.318477] rtk_btusb: btusb_probe can_wakeup 1, may wakeup 0
[   11.320838] rtk_btusb: patch_add
[   11.322372] rtk_btusb: auto suspend is disabled
[   11.323112] rtk_btusb: pid = 0xc024
[   11.323806] rtk_btusb: get_patch_entry =NULL, can not find device pid in patch_table
[   11.324523] rtk_btusb: probe of 1-6:1.0 failed with error -1
[   11.325247] rtk_btusb: btusb_probe intf->cur_altsetting->desc.bInterfaceNumber 1
[   11.325980] usbcore: registered new interface driver rtk_btusb

[   26.197725] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   26.197725] Bluetooth: BNEP filters: protocol multicast
[   26.197729] Bluetooth: BNEP socket layer initialized
I'll try soon the rest of the suggestion you proposed. Please, meanwhile, you can check the dmesg log

EDIT: the hci0 interface is not present, and I have no idea how to bring it up

Last edited by Francexi; 05-11-2018 at 02:40 AM.
 
Old 05-11-2018, 06:49 PM   #8
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 702

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
These lines from your dmesg are showing that the driver did not recognize your PID(ProductID):
Quote:
[ 11.323112] rtk_btusb: pid = 0xc024
[ 11.323806] rtk_btusb: get_patch_entry =NULL, can not find device pid in patch_table
[ 11.324523] rtk_btusb: probe of 1-6:1.0 failed with error -1
By analyzing the driver source file rtk_bt.c contained in the Linux_BT_USB_v3.10_20170802_8821CE_BTCOEX_20170516-1616.tgz driver archive, the one I suggested to try in my post #2, looking after the patch_table section, found it starting at line 1642 and learned that the PID 0xc024 is nowhere defined, nor RTL8821CE referenced anywhere.
Going further, I took the second driver archive (entry/post 3) Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616_add_license.tgz, unpacked it and compared it with the first one, just to find out that only this second archive contains reference to RTL8821CE but with a different PID at line 1693. The files rtl8821cu_config also differ and there were some other differences, but non relevant - headers/disclaimers.
Code:
diff -r driver01/Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616/ driver02/Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616/
Binary files driver01/Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616/8821CU/rtl8821cu_config and driver02/Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616/8821CU/rtl8821cu_config differ
Only in driver02/Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616/: Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616_add_license.tgz
diff -r driver01/Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616/bluetooth_usb_driver/rtk_bt.c driver02/Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616/bluetooth_usb_driver/rtk_bt.c
1692a1693
>       {0xb00a, 0x8821, "mp_rtl8821cu_fw", "rtl8821cu_fw", "rtl8821cu_config", NULL, 0 }, /* RTL8821CE */

diff -r driver01/Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616/bluetooth_usb_driver/rtk_coex.c driver02/Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616/bluetooth_usb_driver/rtk_coex.c
0a1,21
> /*
> ** Copyright (C) 2013 Realtek Semiconductor Corp.
> *
> ** This program is free software; you can redistribute it and/or modify
> ** it under the terms of the GNU General Public License as published by
> ** the Free Software Foundation; either version 2 of the License, or
> ** (at your option) any later version.
> *
> ** This program is distributed in the hope that it will be useful,
> ** but WITHOUT ANY WARRANTY; without even the implied warranty of
> ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.* See the
> ** GNU General Public License for more details.
> *
> ** Module Name:
> ***** rtk_coex.c, rtk_coex.h
> *
> ** Description:
> ***** BT/WiFi coexistence implementation
> *
> */
>
diff -r driver01/Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616/bluetooth_usb_driver/rtk_coex.h driver02/Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616/bluetooth_usb_driver/rtk_coex.h
0a1,21
> /*
> ** Copyright (C) 2013 Realtek Semiconductor Corp.
> *
> ** This program is free software; you can redistribute it and/or modify
> ** it under the terms of the GNU General Public License as published by
> ** the Free Software Foundation; either version 2 of the License, or
> ** (at your option) any later version.
> *
> ** This program is distributed in the hope that it will be useful,
> ** but WITHOUT ANY WARRANTY; without even the implied warranty of
> ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.* See the
> ** GNU General Public License for more details.
> *
> ** Module Name:
> ***** rtk_coex.c, rtk_coex.h
> *
> ** Description:
> ***** BT/WiFi coexistence implementation
> *
> */
My impression is that these driver archives were just attached (thrown) there in the Ubuntu bugtrack thread without any preliminary verification.
Here is another experience, some other people trying to get their rtl8821ce with this Ubuntu bugtrack thread driver package and failing:
https://forum.manjaro.org/t/driver-f...h-module/42264
And here you can learn about the development of the rtl8821ce driver at kernel.org:
https://www.mail-archive.com/linux-w.../msg39535.html

Now, I would disregard what is written there in the Ubuntu bugtrack forum and focus on what is actually contained in the driver archives, therefore using the Linux_BT_USB_v3.10_20170802_8821CU_BTCOEX_20170516-1616_add_license.tgz, the only one that mentions RTL8821CE.
Observing that the firmware file rtl8821cu_fw is universally used for all RTL8821* devices and particularly loaded for RTL8821CE in the source file rtk_bt.c, at line 1963, (PID 0xb00a):
Code:
	{0xb00a, 0x8821, "mp_rtl8821cu_fw", "rtl8821cu_fw", "rtl8821cu_config", NULL, 0 }, /* RTL8821CE */
I think that by either changing the USB PID to match the driver, or the other way around, adapting the driver to match the original USB PID, there is still hope to make it work. However, taking these approaches might crash your system (kernel) and cause potential loss of data.
If you're willing to try them and consider your system prone for tests / yourself confident in booting from an external media in case your system will fail to boot on its own (messed up driver), then I can help you with some instructions on how to do it.

Last edited by abga; 05-11-2018 at 06:55 PM. Reason: typo
 
Old 05-12-2018, 03:02 AM   #9
Francexi
Member
 
Registered: Apr 2012
Location: Italy
Distribution: Slackware
Posts: 75

Original Poster
Rep: Reputation: Disabled
I edited the source file adding the PID to the table, reffering to the firmware written in the other entry about rtl8821ce

Code:
	{0xb00a, 0x8821, "mp_rtl8821cu_fw", "rtl8821cu_fw", "rtl8821cu_config", NULL, 0 }, /* RTL8821CE */
Here's the dmesg

Code:
[   22.170044] Bluetooth: Core ver 2.22
[   22.170072] NET: Registered protocol family 31
[   22.170074] Bluetooth: HCI device and connection manager initialized
[   22.170080] Bluetooth: HCI socket layer initialized
[   22.170083] Bluetooth: L2CAP socket layer initialized
[   22.170090] Bluetooth: SCO socket layer initialized
[   22.360894] rtk_btusb: Realtek Bluetooth USB driver ver 3.1
[   22.360896] rtk_btcoex: rtk_btcoex_init: version: 1.2
[   22.360897] rtk_btcoex: create workqueue
[   22.361160] rtk_btcoex: alloc buffers 1792, 2432 for ev and l2
[   22.361204] rtk_btusb: btusb_probe intf->cur_altsetting->desc.bInterfaceNumber 0
[   22.361206] rtk_btusb: btusb_probe can_wakeup 1, may wakeup 0
[   22.361207] rtk_btusb: patch_add
[   22.361209] rtk_btusb: auto suspend is disabled
[   22.361211] rtk_btusb: pid = 0xc024
[   22.361220] rtk_btusb: set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
[   22.361267] rtk_btusb: btusb_probe: Reset gEVersion to 0xff
[   22.362125] rtk_btusb: btusb_probe: done
[   22.362190] usbcore: registered new interface driver rtk_btusb
[   22.362745] rtk_btusb: btusb_open start pm_usage_cnt(0x1)
[   22.362746] rtk_btusb: btusb_open hdev->promisc ==0
[   22.362746] rtk_btusb: download_patch start
[   22.362748] rtk_btusb: HCI reset.
[   22.372468] rtk_btusb: read_ver_rsp->lmp_subver = 0x8821
[   22.372469] rtk_btusb: patch_entry->lmp_sub = 0x8821
[   22.372470] rtk_btusb: load_firmware start
[   22.372470] rtk_btusb: lmp_version = 0x8821
[   22.372471] rtk_btusb: config name is  rtl8821cu_config
[   22.430128] Console: switching to colour frame buffer device 240x67
[   22.447526] rtk_btusb: config offset(d9),length(1)
[   22.447533] rtk_btusb: fw name is  rtl8821cu_fw
[   22.458556] rtk_btusb: This is not 8723a, use new patch style!
[   22.458559] rtk_btusb: rtk_get_eversion: gEVersion 255
[   22.459471] rtk_btusb: eversion->status = 0x0, eversion->version = 0x1
[   22.459474] rtk_btusb: load_firmware: New gEVersion 1
[   22.459476] rtk_btusb: rtk_get_fw_project_id: opcode 0, len 1, data 10
[   22.459477] rtk_btusb: lmp_version is 8821, project_id is 8821, match!
[   22.459478] rtk_btusb: fw_version = 0x826bbf42
[   22.459480] rtk_btusb: number_of_total_patch = 2
[   22.459480] rtk_btusb: chipID 2
[   22.459482] rtk_btusb: patch_length 0x4c10
[   22.459483] rtk_btusb: start_offset 0x00003d00
[   22.459484] rtk_btusb: Svn version:    19504
[   22.459486] rtk_btusb: Coexistence: BTCOEX_20170516-1616
[   22.459487] rtk_btusb: buf_len = 0x4c1a
[   22.459498] rtk_btusb: fw: exists, config file: exists
[   22.459499] rtk_btusb: load_firmware done
[   22.459507] rtk_btusb: download_data start

[   22.859470] rtk_btusb: download_data done
[   22.860056] rtk_btusb: HCI reset.
[   22.871468] rtk_btusb: read_ver_rsp->lmp_subver = 0xbf42
[   22.872096] rtk_btusb: patch_entry->lmp_sub = 0x8821
[   22.872708] rtk_btusb: Rtk patch end 0
[   22.873278] rtk_btusb: btusb_open set HCI_RUNNING
[   22.873917] rtk_btcoex: Open BTCOEX
[   22.874459] rtk_btcoex: create_udpsocket: connect_port: 30001
[   22.875034] rtk_btcoex: send msg INVITE_REQ with len:11
[   22.875598] rtk_btusb: btusb_open end  pm_usage_cnt(0x0)
[   22.878470] rtk_btcoex: BTCOEX hci_rev 0x826b
[   22.879031] rtk_btcoex: BTCOEX lmp_subver 0xbf42
[   22.898463] rtk_btusb: btusb_notify: hci0 evt 3

[   24.991029] rtk_btusb: btusb_flush add delay 
[   25.002866] rtk_btusb: btusb_close
[   25.014843] rtk_btcoex: Close BTCOEX
[   25.016550] rtk_btcoex: release udp socket
[   25.018241] rtk_btcoex: -x

[   38.148110] rtk_btusb: btusb_open start pm_usage_cnt(0x1)
[   38.148112] rtk_btusb: btusb_open hdev->promisc ==0
[   38.148114] rtk_btusb: download_patch start
[   38.148116] rtk_btusb: HCI reset.
[   38.157505] rtk_btusb: read_ver_rsp->lmp_subver = 0xbf42
[   38.157507] rtk_btusb: patch_entry->lmp_sub = 0x8821
[   38.157509] rtk_btusb: Firmware already exists
[   38.157512] rtk_btusb: Rtk patch end 1
[   38.157514] rtk_btusb: btusb_open set HCI_RUNNING
[   38.157525] rtk_btcoex: Open BTCOEX
[   38.157528] rtk_btcoex: create_udpsocket: connect_port: 30001
[   38.157542] rtk_btcoex: send msg INVITE_REQ with len:11
[   38.157596] rtk_btusb: btusb_open end  pm_usage_cnt(0x0)
[   38.159511] rtk_btcoex: BTCOEX hci_rev 0x826b
[   38.159513] rtk_btcoex: BTCOEX lmp_subver 0xbf42
[   38.734126] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   38.734129] Bluetooth: BNEP filters: protocol multicast
[   38.734135] Bluetooth: BNEP socket layer initialized
I already do weekly backups of my system, there's no problem in messing up with it.

hciconfig -a
Code:
hci0:   Type: Primary  Bus: USB
        BD Address: 60:14:B3:84:C4:34  ACL MTU: 1021:8  SCO MTU: 255:12
        UP RUNNING PSCAN 
        RX bytes:1300 acl:0 sco:0 events:78 errors:0
        TX bytes:2324 acl:0 sco:0 commands:78 errors:0
        Features: 0xff 0xff 0xff 0xfe 0xdb 0xfd 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH HOLD SNIFF PARK 
        Link mode: SLAVE ACCEPT 
        Name: 'BlueZ 5.49'
        Class: 0x00010c
        Service Classes: Unspecified
        Device Class: Computer, Laptop
        HCI Version: 4.2 (0x8)  Revision: 0x826b
        LMP Version: 4.2 (0x8)  Subversion: 0xbf42
        Manufacturer: Realtek Semiconductor Corporation (93)
/usr/sbin/rfkill list

Code:
0: tpacpi_bluetooth_sw: Bluetooth
        Soft blocked: no
        Hard blocked: no
1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
2: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no
bluetoothctl anyway can't find any controller if started as normal user, same does the GUI client. If started as root, bluetoothctl finds the controller, can scan, trust and pair devices, but cannot connect them.

Code:
Agent registered
[bluetooth]# list
Controller 60:14:B3:84:C4:34 BlueZ 5.49 [default]
[bluetooth]# scan on
Discovery started
[CHG] Controller 60:14:B3:84:C4:34 Discovering: yes
[NEW] Device FC:F1:36:BA:92:CF [TV] UE40J6200
[CHG] Device FC:F1:36:BA:92:CF ManufacturerData Key: 0x000f
[CHG] Device FC:F1:36:BA:92:CF ManufacturerData Value:
  00 01 4c                                         ..L             
[CHG] Device FC:F1:36:BA:92:CF ManufacturerData Key: 0x0075
[CHG] Device FC:F1:36:BA:92:CF ManufacturerData Value:
  42 04 01 01 8f fc f1 36 ba 92 cf 16 bb 6e 9a d2  B......6.....n..
  9e 06 00 00 00 00 00 00                          ........        
[CHG] Device 20:9B:A5:8C:50:0D RSSI: -40
[CHG] Device 20:9B:A5:8C:50:0D TxPower: 4
[CHG] Device 20:9B:A5:8C:50:0D RSSI: -30
[CHG] Device 20:9B:A5:8C:50:0D RSSI: -46
[CHG] Device 20:9B:A5:8C:50:0D RSSI: -30
[bluetooth]# devices
Device 20:9B:A5:8C:50:0D SoundBuds Flow
Device F4:F5:24:4A:88:0A Moto G (4)
Device FC:F1:36:BA:92:CF [TV] UE40J6200
[bluetooth]# scan off
Discovery stopped
[CHG] Controller 60:14:B3:84:C4:34 Discovering: no
[CHG] Device 20:9B:A5:8C:50:0D TxPower is nil
[CHG] Device 20:9B:A5:8C:50:0D RSSI is nil
[CHG] Device FC:F1:36:BA:92:CF TxPower is nil
[CHG] Device FC:F1:36:BA:92:CF RSSI is nil
[bluetooth]# trust 20:9B:A5:8C:50:0D
Changing 20:9B:A5:8C:50:0D trust succeeded
[bluetooth]# pair 20:9B:A5:8C:50:0D
Attempting to pair with 20:9B:A5:8C:50:0D
Failed to pair: org.bluez.Error.AlreadyExists
[bluetooth]# connect 20:9B:A5:8C:50:0D
Attempting to connect to 20:9B:A5:8C:50:0D
Failed to connect: org.bluez.Error.Failed
[bluetooth]#
 
Old 05-12-2018, 11:34 AM   #10
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 3,045

Rep: Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420
What do you see when you run (should work as a normal user)
Code:
dbus-send --system --dest=org.bluez --type=method_call --int-reply /org/bluez/hci0 org.freedesktop.DBus.Introspectable.Introspect
EDIT: Actually, there's a series of commands to run...
Code:
dbus-send --system print-reply --dest=org.bluez /org/bluez org.freedesktop.DBus.Introspectable.Introspect
That should return something like...
Code:
method return time=1526143466.191896 sender=:1.0 -> destination=:1.13 serial=29 reply_serial=2
   string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node><interface name="org.freedesktop.DBus.Introspectable"><method name="Introspect"><arg name="xml" type="s" direction="out"/>
</method></interface><interface name="org.bluez.AgentManager1"><method name="RegisterAgent"><arg name="agent" type="o" direction="in"/>
<arg name="capability" type="s" direction="in"/>
</method><method name="UnregisterAgent"><arg name="agent" type="o" direction="in"/>
</method><method name="RequestDefaultAgent"><arg name="agent" type="o" direction="in"/>
</method></interface><interface name="org.bluez.ProfileManager1"><method name="RegisterProfile"><arg name="profile" type="o" direction="in"/>
<arg name="UUID" type="s" direction="in"/>
<arg name="options" type="a{sv}" direction="in"/>
</method><method name="UnregisterProfile"><arg name="profile" type="o" direction="in"/>
</method></interface><node name="hci0"/></node>"
The <node name="blah"/> gives you the interface name of "blah" (hci0 by default)

Then...
Code:
dbus-send --system print-reply --dest=org.bluez /org/bluez/hci0 org.bluez.Adapter1.StartDiscovery
Which returns something like...
Code:
method return time=1526143616.828168 sender=:1.0 -> destination=:1.14 serial=31 reply_serial=2
Now...
Code:
dbus-send --system --dest=org.bluez --type=method_call --pnt-reply /org/bluez/hci0 org.freedesktop.DBus.Introspectable.Introspect
That returns something similar to (your node list will be different)...
Code:
method return time=1526143649.725800 sender=:1.0 -> destination=:1.15 serial=35 reply_serial=2
   string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node><interface name="org.freedesktop.DBus.Introspectable"><method name="Introspect"><arg name="xml" type="s" direction="out"/>
</method></interface><interface name="org.bluez.Adapter1"><method name="StartDiscovery"></method><method name="SetDiscoveryFilter"><arg name="properties" type="a{sv}" direction="in"/>
</method><method name="StopDiscovery"></method><method name="RemoveDevice"><arg name="device" type="o" direction="in"/>
</method><method name="GetDiscoveryFilters"><arg name="filters" type="as" direction="out"/>
</method><property name="Address" type="s" access="read"></property><property name="Name" type="s" access="read"></property><property name="Alias" type="s" access="readwrite"></property><property name="Class" type="u" access="read"></property><property name="Powered" type="b" access="readwrite"></property><property name="Discoverable" type="b" access="readwrite"></property><property name="DiscoverableTimeout" type="u" access="readwrite"></property><property name="Pairable" type="b" access="readwrite"></property><property name="PairableTimeout" type="u" access="readwrite"></property><property name="Discovering" type="b" access="read"></property><property name="UUIDs" type="as" access="read"></property><property name="Modalias" type="s" access="read"></property></interface><interface name="org.freedesktop.DBus.Properties"><method name="Get"><arg name="interface" type="s" direction="in"/>
<arg name="name" type="s" direction="in"/>
<arg name="value" type="v" direction="out"/>
</method><method name="Set"><arg name="interface" type="s" direction="in"/>
<arg name="name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method><method name="GetAll"><arg name="interface" type="s" direction="in"/>
<arg name="properties" type="a{sv}" direction="out"/>
</method><signal name="PropertiesChanged"><arg name="interface" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface><interface name="org.bluez.GattManager1"><method name="RegisterApplication"><arg name="application" type="o" direction="in"/>
<arg name="options" type="a{sv}" direction="in"/>
</method><method name="UnregisterApplication"><arg name="application" type="o" direction="in"/>
</method></interface><interface name="org.bluez.Media1"><method name="RegisterEndpoint"><arg name="endpoint" type="o" direction="in"/>
<arg name="properties" type="a{sv}" direction="in"/>
</method><method name="UnregisterEndpoint"><arg name="endpoint" type="o" direction="in"/>
</method><method name="RegisterPlayer"><arg name="player" type="o" direction="in"/>
<arg name="properties" type="a{sv}" direction="in"/>
</method><method name="UnregisterPlayer"><arg name="player" type="o" direction="in"/>
</method></interface><interface name="org.bluez.NetworkServer1"><method name="Register"><arg name="uuid" type="s" direction="in"/>
<arg name="bridge" type="s" direction="in"/>
</method><method name="Unregister"><arg name="uuid" type="s" direction="in"/>
</method></interface><node name="dev_00_0D_44_D1_7D_CE"/><node name="dev_00_22_D0_2B_7B_38"/><node name="dev_24_C6_96_0C_11_D2"/><node name="dev_48_C1_AC_D5_CE_61"/></node>"
The bluez daemon keeps track of things that it has connected to in the past.

You can ask each node what it does...
Code:
dbus-send --system --dest=org.bluez --type=method_call --pnt-reply /org/bluez/hci0/dev_00_22_D0_2B_7B_38 org.freedesktop.DBus.Properties.GetAll string:org.bluez.Device1
(That one is a heart rate monitor)
Code:
method return time=1526143921.949712 sender=:1.0 -> destination=:1.18 serial=37 reply_serial=2
   array [
      dict entry(
         string "Address"
         variant             string "00:22:D0:2B:7B:38"
      )
      dict entry(
         string "Name"
         variant             string "Polar H7 2B7B38"
      )
      dict entry(
         string "Alias"
         variant             string "Polar H7 2B7B38"
      )
      dict entry(
         string "Appearance"
         variant             uint16 833
      )
      dict entry(
         string "Paired"
         variant             boolean false
      )
      dict entry(
         string "Trusted"
         variant             boolean false
      )
      dict entry(
         string "Blocked"
         variant             boolean false
      )
      dict entry(
         string "LegacyPairing"
         variant             boolean false
      )
      dict entry(
         string "Connected"
         variant             boolean false
      )
      dict entry(
         string "UUIDs"
         variant             array [
               string "00001800-0000-1000-8000-00805f9b34fb"
               string "00001801-0000-1000-8000-00805f9b34fb"
               string "0000180a-0000-1000-8000-00805f9b34fb"
               string "0000180d-0000-1000-8000-00805f9b34fb"
               string "0000180f-0000-1000-8000-00805f9b34fb"
               string "6217ff49-ac7b-547e-eecf-016a06970ba9"
            ]
      )
      dict entry(
         string "Adapter"
         variant             object path "/org/bluez/hci0"
      )
      dict entry(
         string "ServicesResolved"
         variant             boolean false
      )
   ]

Last edited by Richard Cranium; 05-12-2018 at 11:53 AM.
 
1 members found this post helpful.
Old 05-12-2018, 12:18 PM   #11
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 702

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
@Francexi
I would have tried a more prudent approach first, trying to set the system to match the already available driver, or, depending on the driver capabilities (modinfo driver), I would have provided/forced the driver to match the existing HW VIP/PID. This way, even in the case of a driver caused kernel crash, you'd have still been able to restart your system (clean boot).
https://stackoverflow.com/questions/...ded-usb-device
https://stackoverflow.com/questions/...o-device-match
https://unix.stackexchange.com/quest...iver-to-device

But you already took the more dangerous driver source mod approach and I'm glad it worked now.

I wish I could help you with the BT graphic control applications, but I'm more of a console guy, not using X for more than my office work.

On your bluetoothctl pairing/connecting issues, make sure you have /etc/rc.d/rc.bluetooth back executable and launch it.
Then, run bluetoothctl, scan for devices and pair the one you like before doing any other operations:
Code:
list
scan on
devices
scan off
pair XX:XX:XX:XX:XX:XX
trust XX:XX:XX:XX:XX:XX
connect XX:XX:XX:XX:XX:XX
For reading the capabilities of a nearby discoverable BT device you can use:
Code:
/usr/bin/sdptool browse XX:XX:XX:XX:XX:XX
This Arch BT How-To can be useful:
https://wiki.archlinux.org/index.php...on_via_the_CLI
 
Old 05-12-2018, 06:51 PM   #12
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 3,045

Rep: Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420
Quote:
Originally Posted by abga View Post
On your bluetoothctl pairing/connecting issues, make sure you have /etc/rc.d/rc.bluetooth back executable and launch it.
At that point, you can use dbus commands to tell the daemon to scan and do other things.
 
Old 05-12-2018, 08:02 PM   #13
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 702

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by Richard Cranium View Post
At that point, you can use dbus commands to tell the daemon to scan and do other things.
I advised the OP to put back /etc/rc.d/rc.bluetooth on executable because I didn't know what its actual state was after suggesting to disable it and go manual in my post #6, I advised to launch it because bluetoothd needs to be running in order to be able to play with bluetoothctl and finally, it's the default BT script in Slackware and was my local scenario in which I tested the last instructions before posting them.
Using the well known & documented BT standard tools while troubleshooting the BT functionality is more appropriate I believe.

Nevertheless, using the dbus "overlay" is also useful and that's why I rated your post as helpful, didn't know about those commands, went and copied some of them for future use. I'm pretty sure I won't remember those long strings of commands and the XML style results are not really easy to parse. I'm human you know, I don't have (yet) an XML parser embedded in my visual cortex
 
Old 05-12-2018, 08:48 PM   #14
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 3,045

Rep: Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420Reputation: 1420
Quote:
Originally Posted by abga View Post
I advised the OP to put back /etc/rc.d/rc.bluetooth on executable because I didn't know what its actual state was after suggesting to disable it and go manual in my post #6, I advised to launch it because bluetoothd needs to be running in order to be able to play with bluetoothctl and finally, it's the default BT script in Slackware and was my local scenario in which I tested the last instructions before posting them.
Using the well known & documented BT standard tools while troubleshooting the BT functionality is more appropriate I believe.

Nevertheless, using the dbus "overlay" is also useful and that's why I rated your post as helpful, didn't know about those commands, went and copied some of them for future use. I'm pretty sure I won't remember those long strings of commands and the XML style results are not really easy to parse. I'm human you know, I don't have (yet) an XML parser embedded in my visual cortex
Well, the "beauty" (in quotes because some in forum hate DBUS) of DBUS is that those commands allow you to query any daemon registered against DBUS.

You can scream on the bus "Hey, who is out there?" and then ask all the responders "What interfaces do you implement?". If they implement (for example)...
Code:
<method name="GetAll"><arg name="interface" type="s" direction="in"/>
<arg name="properties" type="a{sv}" direction="out"/>
</method>
...you can ask for all the properties that thingy exposes to read and/or modify.

AFAIK, any applet that attempts to talk to bluez will use DBUS to do so.

While you or I may not find XML that nice to read, programs can gobble it up with almost no problem.
 
Old 05-13-2018, 08:18 AM   #15
Francexi
Member
 
Registered: Apr 2012
Location: Italy
Distribution: Slackware
Posts: 75

Original Poster
Rep: Reputation: Disabled
as sais, scanning and pairing is not a problem, just connecting is

dbus-send --system print-reply --dest=org.bluez /org/bluez org.freedesktop.DBus.Introspectable.Introspect
Code:
Must use org.mydomain.Interface.Signal notation, no dot in "/org/bluez"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HC-05 Bluetooth module connected to Raspberry Pi pins not responding to AT+INIT cmd TheChronicScribbler Linux - Embedded & Single-board computer 2 01-22-2015 07:08 AM
Connecting Android device Bluetooth with external Bluetooth module . TheChronicScribbler Linux - Mobile 1 04-21-2014 04:01 AM
[SOLVED] Configuring PAN1325 Bluetooth Module for serial communication with Putty on Windows 7 ppoulsen Linux - Embedded & Single-board computer 1 05-23-2012 03:34 PM
Strange process found (Bluetooth kernel module, s2u) robeich Linux - Newbie 18 04-22-2011 04:12 PM
Do DELL Bluetooth 355 module supported by LinuX? chopin1998@gmail.com Linux - Hardware 3 12-29-2008 04:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration