Skip to content
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

Random MAC after RESET - NRF52832 #33645

Closed
tcpipchip opened this issue Mar 23, 2021 · 11 comments
Closed

Random MAC after RESET - NRF52832 #33645

tcpipchip opened this issue Mar 23, 2021 · 11 comments
Assignees

Comments

@tcpipchip
Copy link

tcpipchip commented Mar 23, 2021

Describe the bug
I implemented a Beacon using NRF52832 to broadcast the BME680 data!
All the time that i reset the NRF52832, a different MAC is detected my BLE SCANNER.

To Reproduce
Reseting the ZEPHYR, the BLE SCANNER detects different MAC.
Expected behavior
Allways the Same MAC

Impact
I had to use the CHIP ID to identify my ZEPHYR module and broadcast it!

log

⸮Scanning...
Advertised Device: Name: , Address: 53:82:42:2c:76:80, manufacturer data: 060001092002c26e567ce60e5aa77c136ea14dd8b4c1c0c631b49fe438
Advertised Device: Name: , Address: 2b:76:14:04:16:2a, manufacturer data: 59000000001f000000650000003d000052b264000000b34fc9f8
Devices found: 2
Scan done!

After reset, changed the MAC :(

Advertised Device: Name: , Address: 53:82:42:2c:76:80, manufacturer data: 060001092002c26e567ce60e5aa77c136ea14dd8b4c1c0c631b49fe438
Advertised Device: Name: , Address: 60:3a:7e:4e:b4:9d, manufacturer data: 4c0010051a1c369185, txPower: 12
Advertised Device: Name: , Address: 20:33:77:f2:bf:26, manufacturer data: 59000000000000000000000000000000000064000000b34fc9f8

Thanks!

@tcpipchip tcpipchip added the bug The issue is a bug, or the PR is fixing a bug label Mar 23, 2021
@galak galak added platform: nRF Nordic nRFx priority: low Low impact/importance bug labels Mar 30, 2021
@joerchan
Copy link
Contributor

@tcpipchip It looks like you have privacy disabled CONFIG_BT_PRIVACY=n and have a non-connectable advertiser.
In this case the advertiser will use a new NRPA address each time it starts to advertise. If this behavior is not wanted you can use
BT_LE_ADV_OPT_USE_IDENTITY to advertise with the identity address.

@joerchan joerchan added question and removed bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx priority: low Low impact/importance bug labels Mar 31, 2021
@tcpipchip
Copy link
Author

@joerchan
Thanks for the feedback!

I have other question
sprintf(g_localName,"%s%x","INDRIYA-G-",NRF_FICR->DEVICEADDR[0]);

/* Set Scan Response data */
static struct bt_data sd[] = {
BT_DATA(BT_DATA_NAME_COMPLETE, g_localName, 17),
};

Why sometimes advertsing the INDRIYA-G-XXXXXX and sometimes not adverstising the INDRIYA-G-XXXXXX ?

Thanks again!

@joerchan
Copy link
Contributor

joerchan commented Apr 6, 2021

@tcpipchip Not much information to go on there, are you sure it isn't just the difference in the advertising PDU? You have put the name in the scan-response, so you won't see it in the ADV_IND pdu.

@tcpipchip
Copy link
Author

@joerchan
I want to broadcast the localname....
What do you suggest

@joerchan
Copy link
Contributor

joerchan commented Apr 6, 2021

Putting the localname in the scan-response achieves that, but the scanner needs to be an active one.
The other option is to put it in the advertising data (ADV_IND).

@tcpipchip
Copy link
Author

i had choosen the second option! It[s working
Have you a little example showing the scan-response example

@joerchan
Copy link
Contributor

joerchan commented Apr 6, 2021

https://docs.zephyrproject.org/2.5.0/reference/bluetooth/gap.html?highlight=adv_start#c.bt_le_adv_start
if you put it as ad in will be in the advertising data ADV_IND, if you put is sd it will be in the scan response data SCAN_RSP.

@tcpipchip
Copy link
Author

Yes, i did that

Maybe is the BLE SCANNER (ARDUINO) ESP32 example bug :(

@joerchan
Copy link
Contributor

joerchan commented Apr 6, 2021

Maybe, can you verify with your phone that the name shows up? You can use the nRF Connect app

@tcpipchip
Copy link
Author

tcpipchip commented Apr 6, 2021

they show!

But, is using ESP32 (Arduino) as ble scan :(

@joerchan
Copy link
Contributor

Closing as original question and follow-up question has been answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants