<?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>Can&amp;#39;t connect to device in the whitelist</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96385/can-t-connect-to-device-in-the-whitelist</link><description>Hello everyone, I am using a nRF52840 as a central device to scan and connect to peripherals using the whitelist. I have a peripheral that doesn&amp;#39;t support pairing (it&amp;#39;s a pulse oximeter), but since I am using the whitelist to scan and filter the other</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Feb 2023 12:13:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96385/can-t-connect-to-device-in-the-whitelist" /><item><title>RE: Can't connect to device in the whitelist</title><link>https://devzone.nordicsemi.com/thread/409142?ContentTypeID=1</link><pubDate>Thu, 09 Feb 2023 12:13:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ad5c878-79a3-47dc-99af-571ce3d6676e</guid><dc:creator>Daniela_A</dc:creator><description>&lt;p&gt;Okay, Einar. Thank you very much for your help! That solves my question. I will try to find a way to filter the data coming from that device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't connect to device in the whitelist</title><link>https://devzone.nordicsemi.com/thread/409057?ContentTypeID=1</link><pubDate>Thu, 09 Feb 2023 07:34:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb123ee0-d2f2-4621-a1e1-ebd5c802155d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When a non-public address has the two most significant bits set to 00, that means that it is using a non-resolvable random address. And as you also see the address changing that sort of confirms it (without if it was not for the fact that the two bits tell us otherwise, it could also have been a resolvable random address if you only consider that the address is changing).&lt;/p&gt;
&lt;p&gt;That means that there is no way to filter on the address of this device. And if you use whitelisting, you will not be able to include this device when scanning with a whitelist. An alternative could be to alternate between scanning with whitelist for all the other devices, and scanning without a whitelist, but filtering on some other parts of the advertising packet if possible. Is there any other data there that you can use to identify this device? If not, it is simply not possible (and that is the whole point of a random private address, in order to prevent tracking).&lt;/p&gt;
&lt;p&gt;PS: For completeness, let me just mention that &lt;em&gt;if&lt;/em&gt; the device had been using a resolvable private address, then you would get it&amp;#39;s identity&amp;nbsp;resolving key (IRK) when bonding, and could use that to recognize the device even when it changes addresses. That is not relevant here, though, as then the two most significant bits in the address should have been 10.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't connect to device in the whitelist</title><link>https://devzone.nordicsemi.com/thread/408874?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2023 13:22:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:440247c0-e60f-4f08-9eca-ca56a01cd172</guid><dc:creator>Daniela_A</dc:creator><description>&lt;p&gt;Hello Einar, I was debugging my program and I check for the properties of the address in the advertisement report. It is a Non-Resolvable Random Private Address indeed.&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/1538.image-_2800_8_2900_.png" /&gt;&lt;br /&gt;&lt;img style="max-height:85px;max-width:503px;" height="85" src="https://devzone.nordicsemi.com/resized-image/__size/1006x170/__key/communityserver-discussions-components-files/4/pastedimage1675862366716v1.png" width="503" alt=" " /&gt; &lt;br /&gt;&amp;nbsp;&lt;br /&gt;That means I can&amp;#39;t use the whitelist to scan for it, right? Do you have any idea of how I could scan for this device and using the whitelist simultaneously? &lt;br /&gt;&lt;br /&gt;Thank you so much in advance!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't connect to device in the whitelist</title><link>https://devzone.nordicsemi.com/thread/408867?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2023 12:53:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d6b71e4-a1b2-47cf-918b-0fa96130b3b8</guid><dc:creator>Daniela_A</dc:creator><description>&lt;p&gt;Hello, Einar. That was actually very helpful specifically because, &lt;em&gt;sometimes&lt;/em&gt;, right after I add the address to the whitelist, a Whitelist advertisement report occurs and this is the debug message I get:&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/image-_2800_7_2900_.png" /&gt;&lt;br /&gt;As you can see, the peer address of the device seems to have changed (?). That might point to the fact that the device does have a Non-Resolvable Random Private Address (also, the fact that the MSB are 00 too). Is there a way I can confirm this? &lt;br /&gt;&lt;br /&gt;Additionally, I will try what you suggested about spoofing the address and let you know what I find out.&lt;br /&gt;&lt;br /&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't connect to device in the whitelist</title><link>https://devzone.nordicsemi.com/thread/408773?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2023 09:05:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19c29b49-9174-4472-88c3-0ca5004169d0</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, this gives a bit more overview. The fact that there is no connection attempt is important.&lt;/p&gt;
&lt;p&gt;I see you specify the address type (addr_type) as&amp;nbsp;BLE_UUID_TYPE_UNKNOWN which does not really make sense, but this is defined to 0, so it is the same as if you used&amp;nbsp;BLE_GAP_ADDR_TYPE_PUBLIC. The address might not be public though, and if so the bits indicating address type are 00 (see &lt;a href="https://novelbits.io/bluetooth-address-privacy-ble/"&gt;this good intro&lt;/a&gt;), which point to this being the fairly unusual type&amp;nbsp;Non-Resolvable Random Private Address. That immediately seems a bit strange though, as you should see the address change from time to time in this case, and as it is non-resolvable you would not be able to know that it is the same device after the address changes. So it cold be that the address really is public or that I missed something.&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t make progress, perhaps you can test with an nRF spoofing the same address, and make your central implementation connect to that, to make it easier to tweek things and test? Then I can test on my end as well. (To make a peripheral with a specific address, just take a peripheral example and add a call to&amp;nbsp;sd_ble_gap_addr_set() right after initializing the SoftDevice.see for instance &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/69530/sd_ble_gap_addr_set-is-the-correct-way-to-change-device-real-mac"&gt;this thread&lt;/a&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't connect to device in the whitelist</title><link>https://devzone.nordicsemi.com/thread/408673?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2023 16:42:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee5598a7-d8a0-4fa7-a637-ac1367a89a16</guid><dc:creator>Daniela_A</dc:creator><description>&lt;p&gt;Here is some debug info. In the first picture, you can see my custom console.&lt;br /&gt;&lt;br /&gt;First, I disable the whitelist and look for the device&amp;#39;s UUID. Having a match, I retrieve the the MAC address from the advertisement report packet and store it in FLASH. (Please ignore the message in red saying there was a problem retrieving the MAC). I re-enable the whitelist.&amp;nbsp; When an event of type whitelist request happens, the function of the code I posted above is called and executed, adding the address I had previously stored. &lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/8117.image-_2800_2_2900_.png" /&gt;&lt;br /&gt;&lt;br /&gt;At this point, I turn the pulse oximeter on and this is the log I have for Wireshark&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/4810.image-_2800_3_2900_.png" /&gt;&lt;/p&gt;
&lt;p&gt;As you can see, there is no attempt of connection coming from the central&lt;br /&gt;&lt;br /&gt;Hope this can get you a better picture of the problem. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't connect to device in the whitelist</title><link>https://devzone.nordicsemi.com/thread/408660?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2023 15:58:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:436cf0ff-f57e-4457-a4f4-a0b10a94d380</guid><dc:creator>Daniela_A</dc:creator><description>&lt;p&gt;Hello Einar, thank you for your response! To answer your questions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Yes, I am able to connect without whitelist.&lt;/li&gt;
&lt;li&gt;I tried swapping the address and it doesn&amp;#39;t work either.&lt;/li&gt;
&lt;li&gt;I will provide some debugging.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I have a theoretical question: Are the peer address and the device MAC address the same? Because, right now what I am storing in the whitelist is the MAC address of the pulse oximeter.&lt;/p&gt;
&lt;p&gt;Thank you again&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't connect to device in the whitelist</title><link>https://devzone.nordicsemi.com/thread/408576?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2023 13:44:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0a7b007-f70e-445d-8fe2-2d656bea134f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Does it work / are you able to connect if you don&amp;#39;t&amp;nbsp;use whitelisting? If yes, can you double-check that you are whitelisting the right address? A quite common mistake when working manually with BLE addresses is to get the&amp;nbsp;endianness wrong, so it could be worth trying to swap it.&lt;/p&gt;
&lt;p&gt;If that does not work, perhaps you can elaborate a bit on the issue and what you have found from debugging. Does the central attempt to connect at all? What do you see from a sniffer trace? And do you have some logging on the nRF that could tell us something?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>