Bluetooth HCI USB sample is not working

Hi,

I'm trying to connect my mobile phone to my development board nrf52840dk using the Zephyr HCI_USB sample (https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/bluetooth/hci_usb) and the nrf sdk version, 2.5.0, but it's not working. When I try to scan using bluetoothctl, my phone doesn't appear, and I have no way to pair.

I tried to check the HCI configuration using hciconfig, but I encountered an error: "Can't read local name on hci0: Input/output error (5)".

Below the lsusb configuration : 

Bus 001 Device 013: ID 1021:000b Legrand NRF52840DK

Couldn't open device, some information will be missing

Device Descriptor:

  bLength                18

  bDescriptorType         1

  bcdUSB               2.00

  bDeviceClass            0 

  bDeviceSubClass         0 

  bDeviceProtocol         0 

  bMaxPacketSize0        64

  idVendor           0x1021 

  idProduct          0x000b 

  bcdDevice            3.04

  iManufacturer           1 Legrand

  iProduct                2 NRF52840DK

  iSerial                 3 CE5D6852C671A9AE

  bNumConfigurations      1

  Configuration Descriptor:

    bLength                 9

    bDescriptorType         2

    wTotalLength       0x0027

    bNumInterfaces          1

    bConfigurationValue     1

    iConfiguration          0 

    bmAttributes         0xe0

      Self Powered

      Remote Wakeup

    MaxPower              100mA

    Interface Descriptor:

      bLength                 9

      bDescriptorType         4

      bInterfaceNumber        0

      bAlternateSetting       0

      bNumEndpoints           3

      bInterfaceClass       224 Wireless

      bInterfaceSubClass      1 Radio Frequency

      bInterfaceProtocol      1 Bluetooth

      iInterface              0 

      Endpoint Descriptor:

        bLength                 7

        bDescriptorType         5

        bEndpointAddress     0x81  EP 1 IN

        bmAttributes            3

          Transfer Type            Interrupt

          Synch Type               None

          Usage Type               Data

        wMaxPacketSize     0x0040  1x 64 bytes

        bInterval               1

      Endpoint Descriptor:

        bLength                 7

        bDescriptorType         5

        bEndpointAddress     0x01  EP 1 OUT

        bmAttributes            2

          Transfer Type            Bulk

          Synch Type               None

          Usage Type               Data

        wMaxPacketSize     0x0040  1x 64 bytes

        bInterval               1

      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               1

If I try to change any setting, I still get the same error, "Operation not supported".

Does anyone know how to fix this issue ?

Regards.

  • Hi,

    No, I was not using nRF Connect for Mobile, but I just tried with the configuration below, and it works:

    • Display name: A53
    • Connectable: True
    • Scannable: True
    • Advertising Extension: False
    • Include Tx power: False
    • Anonymous: False

    However, I would like it to work without this application by connecting directly with the Bluetooth of my phone, as we do with any device. Is this possible, or does the nrf52840dk board with the hci_usb example only work with nRF Connect for Mobile?

  • Hi!

    I'm not sure what kind of advertising the phone is doing by default here, if it's BLE or BR/EDR. Are you able to see the advertising with the nRF Sniffer? https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le

    Make sure that you set these configurations in the sniffer:

    If you are able to see the advertising in the sniffer, please save the log, and upload it here

  • Hi,

    I installed the sniffer following this tutorial (https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_sniffer_ble%2FUG%2Fsniffer_ble%2Finstalling_sniffer_plugin.html&anchor=installing_sniffer_plugin). My interface is not detected by Wireshark. However, it is detected by Windows, as you can see below, and even by nRF Connect for Desktop BLE:


    I have checked all the following points:

    • All Python dependencies
    • Verified that nRF Sniffer can be launched with nrf_sniffer_ble.bat --extcap-interfaces
    • Tried with the firmware from nRF Connect for Desktop BLE and the hci_usb sample

    I also have the logs from the sniffer:

    1700836159.3663085
    
    24-Nov-2023 15:29:19 (+0100) INFO: --------------------------------------------------------
    24-Nov-2023 15:29:19 (+0100) INFO: Software version: 4.1.1
    24-Nov-2023 15:29:19 (+0100) INFO: Started PID 20700
    24-Nov-2023 15:29:19 (+0100) INFO: Namespace(capture=False, extcap_interfaces=True, extcap_interface=None, extcap_dlts=False, extcap_config=False, extcap_capture_filter=None, fifo=None, extcap_control_in=None, extcap_control_out=None, extcap_version=None, device='', baudrate=None, only_advertising=False, only_legacy_advertising=False, scan_follow_rsp=False, scan_follow_aux=False, coded=False)
    24-Nov-2023 15:29:19 (+0100) INFO: Exiting PID 20700
    24-Nov-2023 15:29:40 (+0100) INFO: --------------------------------------------------------
    24-Nov-2023 15:29:40 (+0100) INFO: Software version: 4.1.1
    24-Nov-2023 15:29:40 (+0100) INFO: Started PID 10676
    24-Nov-2023 15:29:40 (+0100) INFO: Namespace(capture=False, extcap_interfaces=True, extcap_interface=None, extcap_dlts=False, extcap_config=False, extcap_capture_filter=None, fifo=None, extcap_control_in=None, extcap_control_out=None, extcap_version='4.2', device='', baudrate=None, only_advertising=False, only_legacy_advertising=False, scan_follow_rsp=False, scan_follow_aux=False, coded=False)
    24-Nov-2023 15:29:40 (+0100) INFO: Exiting PID 10676
    24-Nov-2023 15:31:38 (+0100) INFO: --------------------------------------------------------
    24-Nov-2023 15:31:38 (+0100) INFO: Software version: 4.1.1
    24-Nov-2023 15:31:38 (+0100) INFO: Started PID 6296
    24-Nov-2023 15:31:38 (+0100) INFO: Namespace(capture=False, extcap_interfaces=True, extcap_interface=None, extcap_dlts=False, extcap_config=False, extcap_capture_filter=None, fifo=None, extcap_control_in=None, extcap_control_out=None, extcap_version='4.2', device='', baudrate=None, only_advertising=False, only_legacy_advertising=False, scan_follow_rsp=False, scan_follow_aux=False, coded=False)
    24-Nov-2023 15:31:38 (+0100) INFO: Opening serial port COM18
    24-Nov-2023 15:31:38 (+0100) INFO: closing UART
    24-Nov-2023 15:31:38 (+0100) INFO: Opening serial port COM18
    24-Nov-2023 15:31:39 (+0100) INFO: closing UART
    24-Nov-2023 15:31:39 (+0100) INFO: Exiting PID 6296
    27-Nov-2023 09:08:54 (+0100) INFO: --------------------------------------------------------
    27-Nov-2023 09:08:54 (+0100) INFO: Software version: 4.1.1
    27-Nov-2023 09:08:54 (+0100) INFO: Started PID 14768
    27-Nov-2023 09:08:54 (+0100) INFO: Namespace(capture=False, extcap_interfaces=True, extcap_interface=None, extcap_dlts=False, extcap_config=False, extcap_capture_filter=None, fifo=None, extcap_control_in=None, extcap_control_out=None, extcap_version='4.2', device='', baudrate=None, only_advertising=False, only_legacy_advertising=False, scan_follow_rsp=False, scan_follow_aux=False, coded=False)
    27-Nov-2023 09:08:54 (+0100) INFO: Opening serial port COM18
    27-Nov-2023 09:08:54 (+0100) INFO: closing UART
    27-Nov-2023 09:08:54 (+0100) INFO: Opening serial port COM18
    27-Nov-2023 09:08:55 (+0100) INFO: closing UART
    27-Nov-2023 09:08:55 (+0100) INFO: Exiting PID 14768
    27-Nov-2023 09:16:49 (+0100) INFO: --------------------------------------------------------
    27-Nov-2023 09:16:49 (+0100) INFO: Software version: 4.1.1
    27-Nov-2023 09:16:49 (+0100) INFO: Started PID 2340
    27-Nov-2023 09:16:49 (+0100) INFO: Namespace(capture=False, extcap_interfaces=True, extcap_interface=None, extcap_dlts=False, extcap_config=False, extcap_capture_filter=None, fifo=None, extcap_control_in=None, extcap_control_out=None, extcap_version='4.2', device='', baudrate=None, only_advertising=False, only_legacy_advertising=False, scan_follow_rsp=False, scan_follow_aux=False, coded=False)
    27-Nov-2023 09:16:49 (+0100) INFO: Exiting PID 2340
    27-Nov-2023 09:20:01 (+0100) INFO: --------------------------------------------------------
    27-Nov-2023 09:20:02 (+0100) INFO: Software version: 4.1.1
    27-Nov-2023 09:20:02 (+0100) INFO: Started PID 22564
    27-Nov-2023 09:20:02 (+0100) INFO: Namespace(capture=False, extcap_interfaces=True, extcap_interface=None, extcap_dlts=False, extcap_config=False, extcap_capture_filter=None, fifo=None, extcap_control_in=None, extcap_control_out=None, extcap_version=None, device='', baudrate=None, only_advertising=False, only_legacy_advertising=False, scan_follow_rsp=False, scan_follow_aux=False, coded=False)
    27-Nov-2023 09:20:02 (+0100) INFO: Opening serial port COM18
    27-Nov-2023 09:20:02 (+0100) INFO: closing UART
    27-Nov-2023 09:20:02 (+0100) INFO: Opening serial port COM18
    27-Nov-2023 09:20:02 (+0100) INFO: closing UART
    27-Nov-2023 09:20:02 (+0100) INFO: Exiting PID 22564
    27-Nov-2023 09:20:46 (+0100) INFO: --------------------------------------------------------
    27-Nov-2023 09:20:46 (+0100) INFO: Software version: 4.1.1
    27-Nov-2023 09:20:46 (+0100) INFO: Started PID 16616
    27-Nov-2023 09:20:46 (+0100) INFO: Namespace(capture=False, extcap_interfaces=True, extcap_interface=None, extcap_dlts=False, extcap_config=False, extcap_capture_filter=None, fifo=None, extcap_control_in=None, extcap_control_out=None, extcap_version='4.2', device='', baudrate=None, only_advertising=False, only_legacy_advertising=False, scan_follow_rsp=False, scan_follow_aux=False, coded=False)
    27-Nov-2023 09:20:46 (+0100) INFO: Opening serial port COM18
    27-Nov-2023 09:20:47 (+0100) INFO: closing UART
    27-Nov-2023 09:20:47 (+0100) INFO: Opening serial port COM18
    27-Nov-2023 09:20:47 (+0100) INFO: closing UART
    27-Nov-2023 09:20:47 (+0100) INFO: Exiting PID 16616
    27-Nov-2023 09:21:59 (+0100) INFO: --------------------------------------------------------
    27-Nov-2023 09:21:59 (+0100) INFO: Software version: 4.1.1
    27-Nov-2023 09:21:59 (+0100) INFO: Started PID 14292
    27-Nov-2023 09:21:59 (+0100) INFO: Namespace(capture=False, extcap_interfaces=True, extcap_interface=None, extcap_dlts=False, extcap_config=False, extcap_capture_filter=None, fifo=None, extcap_control_in=None, extcap_control_out=None, extcap_version='4.2', device='', baudrate=None, only_advertising=False, only_legacy_advertising=False, scan_follow_rsp=False, scan_follow_aux=False, coded=False)
    27-Nov-2023 09:21:59 (+0100) INFO: Opening serial port COM18
    27-Nov-2023 09:21:59 (+0100) ERROR: Error opening UART could not open port 'COM18': PermissionError(13, 'Accès refusé.', None, 5)
    Traceback (most recent call last):
      File "C:\Users\lovatinj\AppData\Roaming\Wireshark\extcap\SnifferAPI\Packet.py", line 74, in __init__
        self.uart = UART.Uart(portnum, baudrate)
      File "C:\Users\lovatinj\AppData\Roaming\Wireshark\extcap\SnifferAPI\UART.py", line 124, in __init__
        self.ser = serial.Serial(
      File "C:\Users\lovatinj\AppData\Local\Programs\Python\Python39\lib\site-packages\serial\serialwin32.py", line 33, in __init__
        super(Serial, self).__init__(*args, **kwargs)
      File "C:\Users\lovatinj\AppData\Local\Programs\Python\Python39\lib\site-packages\serial\serialutil.py", line 244, in __init__
        self.open()
      File "C:\Users\lovatinj\AppData\Local\Programs\Python\Python39\lib\site-packages\serial\serialwin32.py", line 64, in open
        raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
    serial.serialutil.SerialException: could not open port 'COM18': PermissionError(13, 'Accès refusé.', None, 5)
    27-Nov-2023 09:22:00 (+0100) INFO: Opening serial port None
    27-Nov-2023 09:22:00 (+0100) INFO: Opening serial port COM18
    27-Nov-2023 09:22:00 (+0100) ERROR: Error opening UART could not open port 'COM18': PermissionError(13, 'Accès refusé.', None, 5)
    Traceback (most recent call last):
      File "C:\Users\lovatinj\AppData\Roaming\Wireshark\extcap\SnifferAPI\Packet.py", line 74, in __init__
        self.uart = UART.Uart(portnum, baudrate)
      File "C:\Users\lovatinj\AppData\Roaming\Wireshark\extcap\SnifferAPI\UART.py", line 124, in __init__
        self.ser = serial.Serial(
      File "C:\Users\lovatinj\AppData\Local\Programs\Python\Python39\lib\site-packages\serial\serialwin32.py", line 33, in __init__
        super(Serial, self).__init__(*args, **kwargs)
      File "C:\Users\lovatinj\AppData\Local\Programs\Python\Python39\lib\site-packages\serial\serialutil.py", line 244, in __init__
        self.open()
      File "C:\Users\lovatinj\AppData\Local\Programs\Python\Python39\lib\site-packages\serial\serialwin32.py", line 64, in open
        raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
    serial.serialutil.SerialException: could not open port 'COM18': PermissionError(13, 'Accès refusé.', None, 5)
    27-Nov-2023 09:22:00 (+0100) INFO: Opening serial port None
    27-Nov-2023 09:22:00 (+0100) INFO: Exiting PID 14292
    27-Nov-2023 09:42:30 (+0100) INFO: --------------------------------------------------------
    27-Nov-2023 09:42:30 (+0100) INFO: Software version: 4.1.1
    27-Nov-2023 09:42:30 (+0100) INFO: Started PID 10420
    27-Nov-2023 09:42:30 (+0100) INFO: Namespace(capture=False, extcap_interfaces=True, extcap_interface=None, extcap_dlts=False, extcap_config=False, extcap_capture_filter=None, fifo=None, extcap_control_in=None, extcap_control_out=None, extcap_version='4.2', device='', baudrate=None, only_advertising=False, only_legacy_advertising=False, scan_follow_rsp=False, scan_follow_aux=False, coded=False)
    27-Nov-2023 09:42:30 (+0100) INFO: Opening serial port COM18
    27-Nov-2023 09:42:30 (+0100) INFO: closing UART
    27-Nov-2023 09:42:30 (+0100) INFO: Opening serial port COM18
    27-Nov-2023 09:42:31 (+0100) INFO: closing UART
    27-Nov-2023 09:42:31 (+0100) INFO: Exiting PID 10420
    

    I tried launching Wireshark in administrator mode, but it didn't work either.

    Edit : 

    That's my bad, I didn't realize that a special firmware was required.

     

  • Edit : 

    That's my bad, I didn't realize that a special firmware was required.

    Correct, you need to flash the sniffer_nrf52840dk_nrf52840_4.1.1.hex firmware when using nRF52840-DK as sniffer

  • I tried to sniff the advertising of my phone, but it's not detectable. I applied the following filter: 'btle.advertising_address == 5c:ed:f4:8d:3d:63,' and there is no corresponding frame. I noticed something strange: when I start the sniffer with Wireshark, it works for 2 seconds and then stops, and nothing happens afterward.

Related