<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Setting Bluetooth MAC address.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100063/setting-bluetooth-mac-address</link><description>I am working on a very simple project. I have modified the bthome_sensor_template zephyr example to send a Bluetooth alert whenever a sensor is triggered, it works well so far. My problem is that whenever I power on the device I have to go in and reconnect</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 24 May 2023 17:44:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100063/setting-bluetooth-mac-address" /><item><title>RE: Setting Bluetooth MAC address.</title><link>https://devzone.nordicsemi.com/thread/427322?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 17:44:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0836256e-8319-4334-b4ae-e49353ac2f80</guid><dc:creator>Jduncan</dc:creator><description>&lt;p&gt;I did what you said and I was still having trouble so I just went in and did a deeper debug. What I found out was that I needed to make my bt_le_adv_start &amp;quot;param&amp;quot; advertising parameter BT_LE_ADV_NCONN_IDENTITY to match my BT_LE_ADV_PARAM &amp;quot;_options&amp;quot; parameter. I also thought that my bt_addr_le_t address type needed to be BT_ADDR_LE_PUBLIC in order to set up a persistent MAC address, but it actually needed to be BT_ADDR_LE_RANDOM. Anyways using bt_id_create() before bt_enable()&amp;nbsp;worked I just had some set up issues I needed to fix. My device works now, it shows up as the same device on each power up so I don&amp;#39;t have to reconnect to it each time. Thanks Einer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting Bluetooth MAC address.</title><link>https://devzone.nordicsemi.com/thread/427087?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 06:45:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ee02d43-8309-4edd-8fcc-f3bef63ae9a1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The address is private random by default. You can use a static random address by calling&amp;nbsp;&lt;code&gt;bt_id_create()&lt;/code&gt; before &lt;code&gt;bt_enable()&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>