<?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>How to reset DPS connection to Azure IoT hub?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100970/how-to-reset-dps-connection-to-azure-iot-hub</link><description>Hello We have an issue using the Azure DPS in the azure_iot_hub demo. What we did so far - Setup the Azure IoT Hub Device Provisioning Service (DPS) on our Azure portal - Linked this DPS to our (existing) IoT Hub - defined enrollments (everything is based</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Jun 2023 09:18:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100970/how-to-reset-dps-connection-to-azure-iot-hub" /><item><title>RE: How to reset DPS connection to Azure IoT hub?</title><link>https://devzone.nordicsemi.com/thread/432242?ContentTypeID=1</link><pubDate>Wed, 21 Jun 2023 09:18:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4941433-1be2-4180-bc86-d51f6fadc796</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;
[quote user=""]We found that there is a function called &lt;span style="font-family:courier new, courier;"&gt;azure_iot_hub_dps_reset()&lt;/span&gt; to do this job. &lt;br /&gt;We placed this function just before calling &lt;span style="font-family:courier new, courier;"&gt;azure_iot_hub_dps_init()&lt;/span&gt;.[/quote]
&lt;p&gt;This is expected to not have the desired effect because the settings subsystem is initialized by &lt;code&gt;azure_iot_hub_dps_init()&lt;/code&gt;. The APIs need to be called in the opposite order, always by initializing first.&lt;br /&gt;Our library had a wrong assumption in the &lt;code&gt;azure_iot_hub_dps_reset()&lt;/code&gt; code with regards to &lt;code&gt;-ENOENT&lt;/code&gt; being returned by &lt;code&gt;settings_delete()&lt;/code&gt; and hence returned success in this case. This is fixed (and explained in more detail) in &lt;a title="https://github.com/nrfconnect/sdk-nrf/pull/11588" href="https://github.com/nrfconnect/sdk-nrf/pull/11588"&gt;https://github.com/nrfconnect/sdk-nrf/pull/11588&lt;/a&gt;. So in this case, &lt;code&gt;azure_iot_hub_dps_reset()&lt;/code&gt; wrongly returned &lt;code&gt;0&lt;/code&gt;, while it should have returned an error because there was not even made an attempt to delete it from flash.&lt;/p&gt;
[quote user=""]Our understanding was, that our device should get a &amp;quot;new&amp;quot; device name from the IoT hub).[/quote]
&lt;p&gt;This is true, but it is also a bit tricky as the device ID has to match the subject name in the device certificate which is used to make the connection to DPS in the first place. You&amp;nbsp;can enable modem traces and take a look at the TLS connection in Wireshark using the nRF Connect for Desktop application Cellular Monitor and see what happens if you use a random device ID to connect to DPS. Then I would expect the TLS handshake to be successful but the server to close the connection after the device sends the MQTT connect message with an ID that does not match the common name in the device certificate.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reset DPS connection to Azure IoT hub?</title><link>https://devzone.nordicsemi.com/thread/431879?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2023 06:52:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fa9d58a-e750-4346-a89d-7dc53d24a2f2</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Exelor,&lt;/p&gt;
&lt;p&gt;I need some time to figure out&amp;nbsp;this issue and will reply to you later.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>