I cannot change the Bluetooth device name that is broadcast by the Nordic sample program "Bluetooth: Peripheral HIDS keyboard"

Hi,

I have been evaluating some Nordic Semiconductor products for the past week. They look great.

I am using the nRF5340 Dev Kit, along with Visual Studio Code on Mac OS. All tools were downloaded 1 week ago from Nordic Semi, so they are up to date.

I watched 5 or 6 tutorial videos and I followed along, successfully building & running a handful of example programs / projects, such as:

Blinky

Bluetooth: Beacon

Bluetooth: Peripheral HIDS mouse

Bluetooth: Peripheral HIDS keyboard

I decided to try the simplest change I could imagine with those Bluetooth programs: Changing the name of the device that is broadcast via Bluetooth.

This was done by changing the parameter CONFIG_BT_DEVICE_NAME found on Line 13 of prj.conf and prj_bt_rpc.conf for the Bluetooth Peripheral HIDS mouse program.

And by changing the same parameter found in prj.conf and prj-coex.conf for the Bluetooth Beacon sample program.

But for the Bluetooth Peripheral HIDS keyboard program, things are different.

First, here is the URL of the sample I am talking about: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/peripheral_hids_keyboard/README.html

There is only one file ( prj.conf line 14 ) in which to change the CONFIG_BT_DEVICE_NAME parameter. And this change makes no difference. I can change the parameter to anything, and yet when I re-build and re-flash the code to my dev board, the Bluetooth device name always shows up as "Nordic_HIDS_keyboard" on my iPhone or Mac.

I assume that the BT Device Name is being set somewhere else in this particular program / project. I have used Visual Studio Code’s search function to look through all files in the project but I have not found anywhere else where the BT DEVICE NAME is set. I made sure that the search was indeed looking at all files because I did find other things I searched for. It’s also not a version control issue.

I know this is a minor issue but I’d love to know what’s going on here. The BT DEVICE NAME *has* to be getting set *somewhere* in the code base for the Peripheral HIDS Keyboard. But in this particular sample project, it seems that it is *not* flowing through from line 14 of the configuration file. I would expect it to work just like the other sample Bluetooth programs.

Thanks for any help!

Parents
  • Hi Lance, 
    Could you try to use nRF Connect app on the phone to check what's advertised ? 
    My suspicion is that the central device (computer or phone) just cached the name of the device and show you not updated name. 
    I would suggest to get familiar with the nRF Sniffer as well. Using this tool you can have deeper debug information on BLE. Please take a look here: https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-6-bluetooth-le-sniffer/topic/sniffing-bluetooth-le-packets/

    I attached here the hex file for nRF53, I modified CONFIG_BT_DEVICE_NAME="My_keyboard" in prj.conf in peripheral_hids_keyboard and it seems to work for me. Please double check that you build and flash the project when you select build, not the level lower as it may not update the hex file when you build. 

    merged_CPUAPP.hex

    0842.merged_CPUNET.hex

  • Hey, thanks!

    The nRF Connect app does indeed show the new / changed BT Device Name.

    But my other "BLE Terminal" app (another BLE sniffer app I've had for a few months) shows the old name OR the new name on different scans... mostly the new name but not always. That is really odd to me. Mac and iPhone still show the old name even this morning EXCEPT I now got my iPhone to show the new device name at least once.

    This makes me wonder if there is a value transmitted about "Cache for x amount of time". I remember this kind of thing from my days as a web developer LONG ago when web page caching was a new thing. So maybe if I waited a day or two of only transmitting the new name, then the new name would appear on any device, any app.

    It still remains strange to me that this issue never came up with the BT Beacon and BT Peripheral HIDS Mouse apps... my iPhone and Mac saw those device names change as soon as I re-built and re-flashed. Hmmm. I notice that those 2 apps have 2 conf files each, where the BT Peripheral HIDS Keyboard app only has 1 conf file. And if there is some other cache-time parameter sent out, maybe that is set to a much shorter time for these other sample apps?

    Anyway, I appreciate the nRF Connect app and the nRF Sniffer app sounds good, too. Now I will be on the lookout for any caching of BT broadcast data.

    Thanks.

  • Hi,

    That sounds plausible, I'm not sure as these are third party applications.

    I think the only way to be sure what name that is actually advertised is by a sniffer trace, you can use nRF Sniffer for Bluetooth LE for that,

    regards

    Jared 

Reply Children
No Data
Related