<?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>v2.9.0: azure_iot_hub_dps_reset() does not reset DPS registration</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119668/v2-9-0-azure_iot_hub_dps_reset-does-not-reset-dps-registration</link><description>According to the documentation, you should run azure_iot_hub_dps_reset() in order to force DPS registration again. 
 But if the device has previously been enrolled and a device created using DPS, and then the keys changed on the device, the reset function</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Mar 2025 10:32:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119668/v2-9-0-azure_iot_hub_dps_reset-does-not-reset-dps-registration" /><item><title>RE: v2.9.0: azure_iot_hub_dps_reset() does not reset DPS registration</title><link>https://devzone.nordicsemi.com/thread/527805?ContentTypeID=1</link><pubDate>Tue, 18 Mar 2025 10:32:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c950378-546d-4ff8-a828-00352a53390d</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I have forwarded your comment internally. We will consider your suggestion.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: v2.9.0: azure_iot_hub_dps_reset() does not reset DPS registration</title><link>https://devzone.nordicsemi.com/thread/527545?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2025 08:57:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7795b56-8e30-4dfd-8230-6b0c4e16d0f3</guid><dc:creator>Mikael Jansson</dc:creator><description>&lt;p&gt;Like I said -- clarifying in the documentation exactly when you&amp;#39;re allowed to call _dps_reset() would make things a lot easier.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: v2.9.0: azure_iot_hub_dps_reset() does not reset DPS registration</title><link>https://devzone.nordicsemi.com/thread/527312?ContentTypeID=1</link><pubDate>Fri, 14 Mar 2025 07:30:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac06e594-10a8-43c2-862e-1e631a7f1c97</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Thank you for the update.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: v2.9.0: azure_iot_hub_dps_reset() does not reset DPS registration</title><link>https://devzone.nordicsemi.com/thread/527300?ContentTypeID=1</link><pubDate>Fri, 14 Mar 2025 05:58:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0e06621-d7c8-4431-b602-ca69a1e4e712</guid><dc:creator>Mikael Jansson</dc:creator><description>&lt;p&gt;I can&amp;#39;t verify that any longer, because my problem got resolved by returning 0 at the very beginning of dps_settings_handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: v2.9.0: azure_iot_hub_dps_reset() does not reset DPS registration</title><link>https://devzone.nordicsemi.com/thread/527232?ContentTypeID=1</link><pubDate>Thu, 13 Mar 2025 15:34:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c2cdf45-9bbd-4439-b387-9d12400c4929</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;azure_iot_hub_init()

//azure_iot_hub_dps_init(); // if use_dps == false

azure_iot_hub_dps_reset()

azure_iot_hub_init()

//azure_iot_hub_dps_init(); // if use_dps == false&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Did your problem get resolved when you used mentioned order?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: v2.9.0: azure_iot_hub_dps_reset() does not reset DPS registration</title><link>https://devzone.nordicsemi.com/thread/527137?ContentTypeID=1</link><pubDate>Thu, 13 Mar 2025 11:38:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:256f86a4-a09f-43c6-91e3-613d845efc27</guid><dc:creator>Mikael Jansson</dc:creator><description>&lt;p&gt;I had .use_dps = true.&lt;/p&gt;
&lt;p&gt;Unrolling my code (based on the iothub example):&lt;pre class="ui-code" data-mode="c_cpp"&gt;azure_iot_hub_dps_reset();

/* Using the device ID as DPS registration ID. */
int err = dps_run(&amp;amp;cfg.hostname, &amp;amp;cfg.device_id);
if (err) {
LOG_ERR(&amp;quot;Failed to run DPS, error: %d, terminating connection attempt&amp;quot;, err);
return -1;
}

err = azure_iot_hub_init(azure_event_handler);
if (err) {
LOG_ERR(&amp;quot;Azure IoT Hub could not be initialized, error: %d&amp;quot;, err);
return -2;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The documentation does _not_ state that azure_iot_hub_init() has to be called prior to calling azure_iot_hub_dps_reset().&lt;/p&gt;
&lt;p&gt;Since that was not stated, I assumed it had to be called before loading the data.&lt;/p&gt;
&lt;p&gt;So it would be a good idea to make a note in the documentation that azure_iot_hub_dps_reset() is valid in this order, and this order only:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;azure_iot_hub_init()&amp;#160;

//azure_iot_hub_dps_init(); // if use_dps == false

azure_iot_hub_dps_reset()

azure_iot_hub_init()&amp;#160;

//azure_iot_hub_dps_init(); // if use_dps == false&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: v2.9.0: azure_iot_hub_dps_reset() does not reset DPS registration</title><link>https://devzone.nordicsemi.com/thread/527110?ContentTypeID=1</link><pubDate>Thu, 13 Mar 2025 09:46:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f564659b-f0c3-4729-abc1-7dc43d1350a5</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="dejans"]&lt;p&gt;Here is what&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/networking/azure_iot_hub.html#using_the_device_provisioning_service"&gt;Azure DPS service&lt;/a&gt; says about deletion of the stored assignment information:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;To delete the stored assignment information, call the azure_iot_hub_dps_reset() function. Alternatively, you can call the functions azure_iot_hub_dps_hostname_delete() or azure_iot_hub_dps_device_id_delete() to delete specific information. After calling the azure_iot_hub_dps_reset() function, the library must be initialized again. After the initialization, a new registration with the DPS can be started by calling the azure_iot_hub_dps_start() function.&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Have you followed these steps but have not been able to delete stored assignment information? Have you re-initialized the library after using azure_iot_hub_dps_reset()?&lt;/p&gt;[/quote]
&lt;p&gt;Can you please verify that you initialized the library prior to using azure_iot_hub_dps_reset()? If you have not done that, the API is expected to fail.&lt;br /&gt;The initialization of the library can be done in 2 ways:&lt;br /&gt;&lt;span&gt;1. If you set azure_iot_hub_config.use_dps, DPS will be initialized when azure_iot_hub_init() is called.&lt;br /&gt;&lt;/span&gt;2. if not, you need to call azure_iot_hub_dps_init() yourself&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: v2.9.0: azure_iot_hub_dps_reset() does not reset DPS registration</title><link>https://devzone.nordicsemi.com/thread/526760?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 13:14:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18cb9f8e-26a3-447e-a04e-77dc9a5be501</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Thank you for additional information and clarification.&lt;br /&gt;&lt;br /&gt;I will look further into this issue. I expect to get back to you by the end of the week.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: v2.9.0: azure_iot_hub_dps_reset() does not reset DPS registration</title><link>https://devzone.nordicsemi.com/thread/526593?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2025 14:57:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfa788df-f4e9-4ded-9220-554cfd6f77b0</guid><dc:creator>Mikael Jansson</dc:creator><description>&lt;p&gt;&amp;gt;&amp;nbsp;&lt;em&gt;To delete the stored assignment information, call the azure_iot_hub_dps_reset() function&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I called this function the very first thing in main, prior to my normal code that works perfectly fine for performing DPS registration. No DPS registration was performed.&lt;/p&gt;
&lt;p&gt;I rebooted the device. Same result.&lt;/p&gt;
&lt;p&gt;I rebooted again, in debugger, rebooting directly after azure_iot_hub_dps_reset() was called, modified the program to remove that call, loaded into the device, started, still no DPS registration.&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;Which keys are you referring to?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;DPS_SETTINGS_foo in azure_iot_hub_dps_private.h&lt;/p&gt;
&lt;p&gt;----&lt;/p&gt;
&lt;p&gt;To clarify:&lt;/p&gt;
&lt;p&gt;1. The device performed DPS registration and created a device in IoTHub.&lt;/p&gt;
&lt;p&gt;2. I changed the keys on the device using nrfcredstore and updated the DPS enrollment thingy on Azure.&lt;/p&gt;
&lt;p&gt;3. When I started again, DPS was not performed.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m suspecting that because that DPS was performed previously, and even though I did run the reset function, the setings table got into an undefined state that caused DPS to never run.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The workaround I did was to make sure the DPS code thought it had loaded empty keys, forcing it to run DPS registration, specifically so &amp;quot;dps_reg_ctx.status = AZURE_IOT_HUB_DPS_REG_STATUS_ASSIGNED;&amp;quot; was never called.&lt;/p&gt;
&lt;p&gt;As to why, I&amp;#39;m just speculating. I followed the instructions by calling the reset function first thing, and the code didn&amp;#39;t do what it said it should do. I&amp;#39;d say that&amp;#39;s a bug.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: v2.9.0: azure_iot_hub_dps_reset() does not reset DPS registration</title><link>https://devzone.nordicsemi.com/thread/526576?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2025 14:12:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09b32176-74f7-4d71-9675-31cca0b7b6f3</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]&lt;p&gt;According to the documentation, you should run azure_iot_hub_dps_reset() in order to force DPS registration again.&lt;/p&gt;
&lt;p&gt;But if the device has previously been enrolled and a device created using DPS, and then the keys changed on the device, the reset function doesn&amp;#39;t remove the required keys to trigger DPS.&lt;/p&gt;[/quote]
&lt;p&gt;Which keys are you referring to? Can you elaborate on these steps?&lt;br /&gt;&lt;br /&gt;Here is what&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/networking/azure_iot_hub.html#using_the_device_provisioning_service"&gt;Azure DPS service&lt;/a&gt; says about deletion of the stored assignment information:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;To delete the stored assignment information, call the azure_iot_hub_dps_reset() function. Alternatively, you can call the functions azure_iot_hub_dps_hostname_delete() or azure_iot_hub_dps_device_id_delete() to delete specific information. After calling the azure_iot_hub_dps_reset() function, the library must be initialized again. After the initialization, a new registration with the DPS can be started by calling the azure_iot_hub_dps_start() function.&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Have you followed these steps but have not been able to delete stored assignment information? Have you re-initialized the library after using azure_iot_hub_dps_reset()?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>