This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

hciconfig is not showing my nrf52840 dongle on my linux terminal

Hi,

I flashed my nrf52840 dongle by nrf Desktop connect app with ble-blinky hex file from nRF5_SDK_15.2.0_9412b96 SDK and I am able to connect to it from nrf connect ios app.

But unable to see the device on hciconfig.

Basing on this below link flashed the dongle with ble_connectivity_s140_usb_hci_pca10059.hex which I got from SDK instead of Zephyr BLE HCI_USB controller firmware as I didn't find its hex file.

devzone.nordicsemi.com/.../flashing-nrf52840-dongle-to-support-bluez

What should be done to make the dongle visible in hciconfig.. ??

Parents
  • nRF connect desktop uses serialized softdevice (Nordic BT stack) API to communicate with the connectivity chip, not HCI commands. In other words, ble_connectivity_s140_usb_hci_pca10059.hex will not work with the Bluez host. 

    Do you have a programmer to program the dongle, or do you need to upload the FW through USB DFU? 

  • I belive there is a HCI command to set the address, please refer to the Zephyr documentation for more details. 

  • I am trying to change the address with bdaddr but it is throwing the following error

    pi@raspberrypi:~/bluez-5.50/tools $ sudo ./bdaddr
    Can't read version info for hci0: Network is down (100)

    kernel version

    pi@raspberrypi:~/bluez-5.50/tools $ uname -a
    Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

    Bluetooth status

    pi@raspberrypi:~/bluez-5.50/tools $ sudo service bluetooth status
    ● bluetooth.service - Bluetooth service
       Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
       Active: active (running) since Wed 2019-01-30 08:17:09 UTC; 51min ago
         Docs: man:bluetoothd(8)
     Main PID: 862 (bluetoothd)
       Status: "Running"
       CGroup: /system.slice/bluetooth.service
               └─862 /usr/local/libexec/bluetooth/bluetoothd

    Jan 30 08:17:09 raspberrypi systemd[1]: Started Bluetooth service.
    Jan 30 08:17:09 raspberrypi bluetoothd[862]: Starting SDP server
    Jan 30 08:17:09 raspberrypi bluetoothd[862]: Bluetooth management interface 1.14 initialized
    Jan 30 08:17:09 raspberrypi bluetoothd[862]: Failed to open crypto
    Jan 30 08:17:09 raspberrypi bluetoothd[862]: No Bluetooth address for index 0
    Jan 30 08:17:09 raspberrypi bluetoothd[862]: Failed to set privacy: Rejected (0x0b)
    Jan 30 08:17:12 raspberrypi bluetoothd[862]: Endpoint registered: sender=:1.16 path=/MediaEndpoint/A2DPSource
    Jan 30 08:17:12 raspberrypi bluetoothd[862]: Endpoint registered: sender=:1.16 path=/MediaEndpoint/A2DPSink
    Jan 30 08:17:13 raspberrypi bluetoothd[862]: Endpoint unregistered: sender=:1.16 path=/MediaEndpoint/A2DPSource
    Jan 30 08:17:13 raspberrypi bluetoothd[862]: Endpoint unregistered: sender=:1.16 path=/MediaEndpoint/A2DPSink

    Can you suggest me how to change the BD address and make it work on my raspberrypi

  • I upgraded the kernel and tried to change the BD address

    It is not updated and throwing the following error

    pi@raspberrypi:~/bluez-5.50/tools $ sudo ./bdaddr -r 00:19:1D:6D:D9:DA
    Manufacturer:   not assigned (1521)
    Device address: 00:00:00:00:00:00 (XEROX CORPORATION)

    Unsupported manufacturer

  • Could you please reply on this.

    I'm stuck at this point

  • Is this hex is for nrf52840_pca10059 or pca10056. Ours is pca10059. Can you recheck and send me the hex file foe pca10059

Reply Children
  • Hi,

    Have you searched the zephyr mailing list?  In any case, there seems to be quite a few questions related to the address "issue". Only public addresses are displayed by HCI config.

    Eg,

    https://lists.zephyrproject.org/g/devel/topic/28047406 

    https://lists.zephyrproject.org/g/devel/topic/bluetooth_address_type/16760640?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,240,16760640

    I'm able to advertise using the random static address here, but I'm running ubuntu with kernel v 4.15.x and bluez 5.48 . Do you have PC with a newer version of Linux that you can test on?

    :~$ sudo btmgmt --index n
    [hci1]# auto-power 
    Found controller with index 1
    [hci1]# advertising on
    hci1 Set Advertising complete, settings: powered connectable discoverable bondable le advertising secure-conn static-addr 
    [hci1]# 
    

    Here is the device discovered in nRF connect. Notice the address type is Random static.

  • Hi,

    Thanks for your reply.

    I connected dongle to raspberry pi which is  kernel v4.14 and bluez 5.48 and did the advertising on as you mentioned in the screenshot.

    By running nRF connect on my PC and did a scan on it, where I didn't  see the dongle random mac address but i'm able to get rest of the devices mac address.

    Is the same zephyr.hex file you flashed on your dongle to test that which you shared with me..?.

    This is the state of my device

    santhosh@santhosh:~/zephyr$ hciconfig
    hci0:    Type: BR/EDR  Bus: USB
        BD Address: 00:00:00:00:00:00  ACL MTU: 27:7  SCO MTU: 0:0
        DOWN
        RX bytes:227 acl:0 sco:0 events:18 errors:0
        TX bytes:85 acl:0 sco:0 commands:18 errors:0

    santhosh@santhosh:~/zephyr$ sudo hciconfig hci0 up
    Can't init device hci0: Cannot assign requested address (99)

    I gave many tries but nothing helped.

    At present I am trying to compile the zephyr code.

    1.Is there a possibility to change public mac address which is (00:00:00:00:00:00) to (xx:xx:xx:xx:xx:xx) default value in zephyr code. 

    2. If its possible can you tell me the exact process or the public mac address variable by which i can change the BD addr.

    I think this can solve my issue.

    Reply ASAP, im stuck on this from days.

     

  • Hi,

    SanthoshN said:
    By running nRF connect on my PC and did a scan on it, where I didn't  see the dongle random mac address but i'm able to get rest of the devices mac address.

     But were you able to discover the device? 

    SanthoshN said:

    This is the state of my device

    santhosh@santhosh:~/zephyr$ hciconfig
    hci0:    Type: BR/EDR  Bus: USB
        BD Address: 00:00:00:00:00:00  ACL MTU: 27:7  SCO MTU: 0:0
        DOWN
        RX bytes:227 acl:0 sco:0 events:18 errors:0
        TX bytes:85 acl:0 sco:0 commands:18 errors:0

    The public address is 0 as expected, but the type should not be BR/EDR as it is an LE only controller. I suspect that the problem is related to this. It is not required to have a Public address. Did you have another PC to test this on? 

    1. It's possible to change the address, either by using the extended HCI commands or by modifying the sample code. However,  you need to have a OUI for your company to assign public addresses, and I doubt it would fix the problem.   

    2. You can call ll_addr_set from main().

    May I ask what you intend to use dongle for? Is it to test BT 5 features?

  • Hi,

    Thanks a lot for your continuous support, we could scan the dongle now.

    After upgrading my PC to ubuntu 18.04 and kernel to 4.15 I am able to scan using random BD address by flashing your  zephyr.hex file.

    However on raspbery pi Jessie we were unable to upgrade linux kernel beyond 4.14. After calling ll_addr_set from main.c we were able to proceed further.

    We will be using this dongle to work as a BT5.0 gateway device.

    Will let you know if we need any additional info.

    Thanks a lot.

  • Thanks for the update. Glad to hear that it works and that you have managed to to build the sample from Zephyr. 

Related