-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
samples/bluetooth/periodic_adv/, print random address after every reset #32721
Comments
I'm not entirely sure that's possible to do from the application, but I'll try to see what I can do. |
One solution would be to change the advertiser to use the identity, rather than a random generated address. @kaiser-ren Would it be a better solution if the device kept the same address, rather than printing the newly generated one? I guess that would make sniffing easier. |
|
@Thalley , I took into it today for how to print random address, here is the thing:
|
No, that is a privacy feature. When advertising, you do normally not advertise with your identify to avoid tracking of your device (privacy), so advertising will generally create a new random address (if using extended advertising like here, you'd have a random address per advertising set), which will also be updated periodically (typically around every ~15min). We can change the advertising parameters so that it will advertise with the identify address, and also stop it from updating that, so that you will advertise with a static address. Since this is a sample, unrelated to privacy, I think that will be right way to go. |
@kaiser-ren Btw, have you tried enabling CONFIG_BT_LOG_SNIFFER_INFO? |
I just tried this option, but compiling was failed, how about you? Attached the west build log below:
CMake Deprecation Warning at /Users/renkai/zephyrproject/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required): Update the VERSION argument value or use a ... suffix to tell -- Configuring done [190/197] Linking C executable zephyr/zephyr_prebuilt.elf |
@kaiser-ren I haven't tried that myself yet (I'm unfortunately quite busy at the moment). If the compile fails, then I guess we should create another Github issue for that :) This enhancement is still valid regardless though. |
Yes, I have submitted a fix for that, there was an issue with enabling it without BT_SMP enabled.
It is intentional and as Thalley explained, each time the non-connectable advertiser (broadcaster) is started it generates a new NRPA address, one option as mentioned is to disable this behavior with the USE_IDENTITY option. In most cases bt_le_ext_adv_oob_get_local could have been used here to get the NRPA, except for this case. For now I think using CONFIG_BT_LOG_SNIFFER_INFO might be the best option for you after it has been fixed since your use-case is one of the reasons it was added. |
Great, I'm looking forward to having this fix merged ASAP. |
This is not an enhancement, but a test requirement, to be able to sniff packets. User samples should not compromise on security features. Users to update local version of sample (with conscious decision to use identity address) or use tests/bluetooth/shell application for test purposes. |
I verified, CONFIG_BT_LOG_SNIFFER_INFO method works. I can capture the address of periodic advertise after reset the board. |
@kaiser-ren Is that enough to close this issue? |
Great works, thanks. |
Is your enhancement proposal related to a problem? Please describe.
periodic_adv is very useful sample to illustrate how periodic advertising works, there is a problem that if you have a packet sniffer and there are a lot of Bluetooth LE devices nearby, it's hard to track this periodic_adv device by eye balls because you don't know the random address of this periodic_adv device.
Describe the solution you'd like
Is it possible to print the random address via printk(). Furthermore, for all the samples which uses Bluetooth LE random address, can Bluetooth LE random address being printk() after every reset?
Describe alternatives you've considered
None.
Additional context
Below is the log, and I find that Identity: F6:14:B5:7B:EC:61 (random) doesn't mean a real device address.
Starting Periodic Advertising Demo
[00:00:00.257,934] bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.257,934] bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.257,934] bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 2.5 Build 0
[00:00:00.258,514] bt_hci_core: Identity: F6:14:B5:7B:EC:61 (random)
[00:00:00.258,514] bt_hci_core: HCI: version 5.2 (0x0b) revision 0x0000, manufacturer 0x05f1
[00:00:00.258,514] bt_hci_core: LMP: version 5.2 (0x0b) subver 0xffff
The text was updated successfully, but these errors were encountered: