Image Map Image Map
Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Getting cheap BT dongle to work--Ubuntu64

  1. #11
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    30,943
    Blog Entries
    20

    Default

    Figured it out--and without a kernel patch, it's not going to work on Ubuntu.

    Basically, btmon tells the whole story:

    Code:
    HCI Event: Command Complete (0x0e) plen 6
        Delete Stored Link Key (0x03|0x0012) ncmd 5
        status 0x11 deleted 0
        Error: Unsupported Feature or Parameter Value
    Yet, the device claims to support the command:

    Code:
    > HCI Event: Command Complete (0x0e) plen 68               #31 [hci0] 10.207958
          Read Local Supported Commands (0x04|0x0002) ncmd 5
            Status: Success (0x00)
            Commands: 165 entries
              Inquiry (Octet 0 - Bit 0)
              Inquiry Cancel (Octet 0 - Bit 1)
    ...
              Reset (Octet 5 - Bit 7)
              Set Event Filter (Octet 6 - Bit 0)
              Flush (Octet 6 - Bit 1)
              Read PIN Type (Octet 6 - Bit 2)
              Write PIN Type (Octet 6 - Bit 3)
              Create New Unit Key (Octet 6 - Bit 4)
              Read Stored Link Key (Octet 6 - Bit 5)
              Write Stored Link Key (Octet 6 - Bit 6)
              Delete Stored Link Key (Octet 6 - Bit 7)
              Write Local Name (Octet 7 - Bit 0)
              Read Local Name (Octet 7 - Bit 1)
    Well, I could rebuild the kernel and simply ignore the "Delete Stored Link Key" result, which would probably work, but that would mean re-building on every system I have here. Easier to get some new dongles, I'm afraid.

    Got any recommendations for cheap USB BT dongles that work?

  2. #12
    Join Date
    Mar 2011
    Location
    Norway/Japan
    Posts
    975

    Default

    BT dongles have always worked for me, in the past - every one of them. But I haven't used any lately (i.e. with newer kernels). So I tried one I found just now, and it works too, on my 4.12 kernel.
    It looks like it may be the one in the left of the picture in your link though (mine is a Cambridge BT too), so I'm not sure how this helps.

    (lsusb)
    Bus 001 Device 083: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

    (hciconfig -a)
    hci1: Type: Primary Bus: USB
    BD Address: 00:1A:7D:DA:71:13 ACL MTU: 310:10 SCO MTU: 64:8
    UP RUNNING
    RX bytes:646 acl:0 sco:0 events:42 errors:0
    TX bytes:2175 acl:0 sco:0 commands:42 errors:0
    Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 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.47'
    Class: 0x00010c
    Service Classes: Unspecified
    Device Class: Computer, Laptop
    HCI Version: 4.0 (0x6) Revision: 0x22bb
    LMP Version: 4.0 (0x6) Subversion: 0x22bb
    Manufacturer: Cambridge Silicon Radio (10)

    On the dongle itself it's printed CSR 4.0

  3. #13
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    30,943
    Blog Entries
    20

    Default

    Got one of those dongles with "CSR 4.0" printed on it here. Same chip inside as before; fails the same way.

    There is a check for a similar dongle that sets a "quirk" flag so that the stored link key commands are not issued. However, it's conditioned on the specific chip ID. The ones I've been testing are later.

    Again, they work fine in Armbian and on Windows 7.

  4. #14
    Join Date
    Mar 2013
    Location
    Chaffee, MO
    Posts
    1,102

    Default

    Chuck,
    I just set up my older HP Laptop with Debian 9.8 (64 Bit), and I have tried my Bluetooth Dongle (4.0) and here is what I get.
    It tries to pair with my phone after I make my Laptop discoverable, so I know it is working.

    Plug in the Bluetooth Dongle.

    Code:
    lsusb
    Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
    Code:
    hciconfig
    hci0: Type: Primary Bus: USB
    BD Address: 00:1B:DC:06:AF:21 ACL MTU: 310:10 SCO MTU: 64:8
    DOWN
    RX bytes:574 acl:0 sco:0 events:30 errors:0
    TX bytes:368 acl:0 sco:0 commands:30 errors:0
    Code:
    APPLICATIONS ---> SETTINGS --> BLUETOOTH ADAPTERS
    Turn ON Adapter, but Leave Hidden by using the Icon in the Top right of my Debian 9.8 Window.

    Code:
    hciconfig
    hci0: Type: Primary Bus: USB
    BD Address: 00:1B:DC:06:AF:21 ACL MTU: 310:10 SCO MTU: 64:8
    UP RUNNING
    RX bytes:1184 acl:0 sco:0 events:66 errors:0
    TX bytes:1072 acl:0 sco:0 commands:66 errors:0
    I then make my laptop discoverable, and my Smartphone will try to pair to the device, so I know it's working.

    I have the following packages installed:

    blueman 2.0.4-1
    bluez 5.43-2+deb9u1
    bluez-obexd 5.43-2+deb9u1
    libbluetooth3 5.43-2+deb9u1


    Larry

  5. #15
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    30,943
    Blog Entries
    20

    Default

    Larry,

    My kernel is x64 4.15.0-47.

    So I do an hciconfig:

    Code:
    hci0:	Type: Primary  Bus: USB
    	BD Address: 33:03:30:0A:C4:A3  ACL MTU: 360:4  SCO MTU: 0:0
    	DOWN 
    	RX bytes:553 acl:0 sco:0 events:28 errors:0
    	TX bytes:368 acl:0 sco:0 commands:30 errors:0
    When I go to Applications->Settings->Bluetooth adapters, I get a blank window with just the "Close" dialog.

    bluez: 5.50
    blueman: 2.05
    bluez-obexd 5.50
    libbluetooth3 5.50

    (all of the above are from the standard Ubuntu repository +0Ubuntu1)

    Running hcidump in one window and doing "sudo hciconfig hci0 up" in another, I get the following trace:

    Code:
    ~$ hcidump hci0
    HCI sniffer - Bluetooth packet analyzer ver 5.50
    device: hci0 snap_len: 1500 filter: 0xffffffffffffffff
    > HCI Event: Command Complete (0x0e) plen 4
        Reset (0x03|0x0003) ncmd 5
        status 0x00
    > HCI Event: Command Complete (0x0e) plen 12
        Read Local Supported Features (0x04|0x0003) ncmd 5
        status 0x00
        Features: 0xff 0xff 0xcd 0xfa 0xdb 0xbf 0x7b 0x87
    > HCI Event: Command Complete (0x0e) plen 12
        Read Local Version Information (0x04|0x0001) ncmd 5
        status 0x00
        HCI Version: 4.0 (0x6) HCI Revision: 0x709
        LMP Version: 4.0 (0x6) LMP Subversion: 0x709
        Manufacturer: Cambridge Silicon Radio (10)
    > HCI Event: Command Complete (0x0e) plen 10
        Read BD ADDR (0x04|0x0009) ncmd 5
        status 0x00 bdaddr 33:03:30:0A:C4:A3
    > HCI Event: Command Complete (0x0e) plen 11
        Read Buffer Size (0x04|0x0005) ncmd 5
        status 0x00
        ACL MTU 360:4 SCO MTU 0:0
    > HCI Event: Command Complete (0x0e) plen 7
        Read Class of Device (0x03|0x0023) ncmd 5
        status 0x00 class 0x000000
    > HCI Event: Command Complete (0x0e) plen 252
        Read Local Name (0x03|0x0014) ncmd 5
        status 0x00 name ''
    > HCI Event: Command Complete (0x0e) plen 6
        Read Voice Setting (0x03|0x0025) ncmd 5
        status 0x00 voice setting 0x0000
    > HCI Event: Command Complete (0x0e) plen 5
        Read Number of Supported IAC (0x03|0x0038) ncmd 5
    > HCI Event: Command Complete (0x0e) plen 8
        Read Current IAC LAP (0x03|0x0039) ncmd 5
        IAC 0x9e8b33 (General Inquiry Access Code)
    > HCI Event: Command Complete (0x0e) plen 4
        Set Event Filter (0x03|0x0005) ncmd 5
        status 0x00
    > HCI Event: Command Complete (0x0e) plen 4
        Write Connection Accept Timeout (0x03|0x0016) ncmd 5
        status 0x00
    > HCI Event: Command Complete (0x0e) plen 7
        LE Read Buffer Size (0x08|0x0002) ncmd 5
        status 0x00 pktlen 0x001b maxpkt 0x12
    > HCI Event: Command Complete (0x0e) plen 12
        LE Read Supported States (0x08|0x001c) ncmd 5
    > HCI Event: Command Complete (0x0e) plen 68
        Read Local Supported Commands (0x04|0x0002) ncmd 5
        status 0x00
        Commands: bfffff03feffffff0fffff1ff20fe8fe3ff78fff1c00000061f7ffff7f18
    > HCI Event: Command Complete (0x0e) plen 4
        Write Extended Inquiry Response (0x03|0x0052) ncmd 5
        status 0x00
    > HCI Event: Command Complete (0x0e) plen 4
        Write Inquiry Mode (0x03|0x0045) ncmd 5
        status 0x00
    > HCI Event: Command Complete (0x0e) plen 5
        Read Inquiry Response Transmit Power Level (0x03|0x0058) ncmd 5
        status 0x00 level 8
    > HCI Event: Command Complete (0x0e) plen 14
        Read Local Extended Features (0x04|0x0004) ncmd 5
        status 0x00 page 1 max 0
        Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    > HCI Event: Command Complete (0x0e) plen 4
        Set Event Mask (0x03|0x0001) ncmd 5
        status 0x00
    > HCI Event: Command Complete (0x0e) plen 8
        Read Stored Link Key (0x03|0x000d) ncmd 5
        status 0x00 max 0 num 0
    > HCI Event: Command Complete (0x0e) plen 4
        Write Default Link Policy Settings (0x02|0x000f) ncmd 5
        status 0x00
    > HCI Event: Command Complete (0x0e) plen 8
        Read Page Scan Activity (0x03|0x001b) ncmd 5
        status 0x00 interval 512 window 18
    > HCI Event: Command Complete (0x0e) plen 5
        Read Page Scan Type (0x03|0x0046) ncmd 5
    > HCI Event: Command Complete (0x0e) plen 4
        LE Set Event Mask (0x08|0x0001) ncmd 5
        status 0x00
    > HCI Event: Command Complete (0x0e) plen 5
        LE Read White List Size (0x08|0x000f) ncmd 5
    > HCI Event: Command Complete (0x0e) plen 4
        LE Clear White List (0x08|0x0010) ncmd 5
        status 0x00
    > HCI Event: Command Complete (0x0e) plen 6
        Delete Stored Link Key (0x03|0x0012) ncmd 5
        status 0x11 deleted 0
        Error: Unsupported Feature or Parameter Value
    I'll add that the same result is manifested when I use another BT dongle labeled "CSR 4.0" on a square-ish package. The only real difference is that it displays

    Code:
     HCI Version: 4.0 (0x6) HCI Revision: 0x811
        LMP Version: 4.0 (0x6) LMP Subversion: 0x811
        Manufacturer: Cambridge Silicon Radio (10)
    Last edited by Chuck(G); April 6th, 2019 at 02:21 PM.

  6. #16
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    30,943
    Blog Entries
    20

    Default

    Oh, and here are the two dongles I tested:


  7. #17
    Join Date
    Mar 2013
    Location
    Chaffee, MO
    Posts
    1,102

    Default

    Chuck,
    WOW! Looks like later versions break the Bluetooth code. I wonder if that will also creep into later versions of Debian?

    Mine pairs, so I know it works on Debian 9.8 (64 Bit)


    Larry


    Moto-E.jpg

  8. #18
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    30,943
    Blog Entries
    20

    Default

    Well, FWIW, here's the relevant code in btusb.c:

    Code:
    /* Detect controllers which aren't real CSR ones. */
    	if (le16_to_cpu(rp->manufacturer) != 10 ||
    	    le16_to_cpu(rp->lmp_subver) == 0x0c5c) {
    		/* Clear the reset quirk since this is not an actual
    		 * early Bluetooth 1.1 device from CSR.
    		 */
    		clear_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
    
    		/* These fake CSR controllers have all a broken
    		 * stored link key handling and so just disable it.
    		 */
    		set_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks);
    	}
    Note that it's an idiotic fix--it's tied specifically to LMP Subversion 0x0c5c. My samples show this subversion is all over the place. The more sensible fix would be to ignore the return from the call to "Delete Stored Link Key". I suppose I could submit a request to the Linux Kernel people, but I doubt I would get any quick action. I can change the code, recompile the kernel and fix it myself, but then I'll have to do that every time a new kernel comes out.

  9. #19
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    30,943
    Blog Entries
    20

    Default

    Quote Originally Posted by ldkraemer View Post
    Chuck,
    WOW! Looks like later versions break the Bluetooth code. I wonder if that will also creep into later versions of Debian?

    Mine pairs, so I know it works on Debian 9.8 (64 Bit)
    Since most Linuces share the same kernel code, I suspect an error in Ubuntu's kernel will be the same on Debian's. Linus generally vets kernel mods.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •