<?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>Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106758/change-bt-device-id-on-thingy-91</link><description>Hi, we have an app running on T91s and we recently upgraded it to sdk 2.5.0, from sdk 1.9.1. We used to change the device id after flashing our app on the thingy by connecting to the thingy and sending data, which was then processed and written to the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Jan 2024 13:18:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106758/change-bt-device-id-on-thingy-91" /><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/465576?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 13:18:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b85221a4-f5a1-41be-a8ab-f1a28cfa4367</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello 0x35c and Izpons,&lt;br /&gt;&lt;br /&gt;I am terribly sorry for the delay in getting back to you here - I have unfortunately been out of office since new year due to illness, and this case have somehow fallen through the cracks and not been picked up in the meantime, for which I am terribly sorry!&lt;br /&gt;&lt;br /&gt;I am glad to read that you reached out to Matt Heins and get the assistance you needed!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/464735?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2024 09:05:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:501e8e07-1620-4b78-92eb-5d257ea04494</guid><dc:creator>0x35c</dc:creator><description>[quote userid="77062" url="~/f/nordic-q-a/106758/change-bt-device-id-on-thingy-91/461732"]&lt;span&gt;&lt;span dir="ltr"&gt;Øyvind&lt;/span&gt;&lt;/span&gt;[/quote]
&lt;p&gt;Hello &lt;a href="https://devzone.nordicsemi.com/members/oys"&gt;Øyvind&lt;/a&gt; &lt;a href="https://devzone.nordicsemi.com/members/karl-ylvisaker"&gt;Karl Ylvisaker&lt;/a&gt;&amp;nbsp;, &lt;br /&gt;The problem is fixed, thanks to Matt Heins, our field rep in the US.&lt;br /&gt;Here is the solution for anyone bumping into the same issue &lt;br /&gt;Adding these lines to prj.conf worked:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SETTINGS_FCB=y
CONFIG_FCB=y

# Flash - Used in FOTA, settings and storage for P-GPS.
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_STREAM_FLASH=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your time, you can now close this ticket !&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;0x35c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/464148?ContentTypeID=1</link><pubDate>Mon, 15 Jan 2024 11:29:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:029b2946-e35e-4cc2-9d7b-0f9e9fc87c38</guid><dc:creator>lzpons</dc:creator><description>&lt;p&gt;Dear Support team,&lt;/p&gt;
&lt;p&gt;This issue is holding us from releasing our product update. We are locked with it since 24 days and do not have any other way to move ahead than you, Nordic Support, helping us find the solution.&lt;/p&gt;
&lt;p&gt;We checked all we could check, read all documentation available, tested all we could test...&lt;/p&gt;
&lt;p&gt;This is an important issue for us. We cannot deliver devices with the very same ID!&lt;/p&gt;
&lt;p&gt;Please help us move ahead.&lt;/p&gt;
&lt;p&gt;Lorenzo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/463731?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2024 11:56:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3dec0a38-b99b-4c11-89be-0b49f89892e5</guid><dc:creator>0x35c</dc:creator><description>&lt;p&gt;If you want, here is the app_config.c file modified (I changed it to match as much as possible the settings sample)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1586.app_5F00_config.c"&gt;devzone.nordicsemi.com/.../1586.app_5F00_config.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/463107?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2024 10:45:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbbbfdd0-da7e-4ea1-8c37-9eba4e218a53</guid><dc:creator>0x35c</dc:creator><description>&lt;p&gt;Hi, any updates ?&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/karl-ylvisaker"&gt;Karl Ylvisaker&lt;/a&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/oys"&gt;Øyvind&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/461732?ContentTypeID=1</link><pubDate>Wed, 27 Dec 2023 09:25:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b16662a-201a-47cb-b98a-ce8a3f5c060c</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;We are severely understaffed this week because of the Christmas holidays, and Karl will have to get back to you on this next week. Sorry for the inconvenience.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/461567?ContentTypeID=1</link><pubDate>Fri, 22 Dec 2023 12:27:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2412d4e1-83e6-4428-a1f0-272e92235cc0</guid><dc:creator>0x35c</dc:creator><description>[quote userid="87869" url="~/f/nordic-q-a/106758/change-bt-device-id-on-thingy-91/461561"]Could you share the full log for this scenario as well?[/quote]
&lt;p&gt;Here is the full log at boot (there are a few log/print statements for debugging purposes).&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.267,486] &amp;lt;err&amp;gt; ADXL372: failed to read id (0xFF:0xFF)
*** Booting nRF Connect SDK v2.5.0 ***
[00:00:00.267,669] &amp;lt;inf&amp;gt; main: ***** XXXXXXXXXX T91 app started, Version 261 ***********
device id: 54:0:0
[00:00:00.568,023] &amp;lt;inf&amp;gt; app_ble: Id created: C6:09:16:54:00:00
[00:00:00.568,023] &amp;lt;inf&amp;gt; app_ble: Initializing Bluetooth..
[00:00:00.578,308] &amp;lt;wrn&amp;gt; lpuart: req pin low when expected high
[00:00:00.578,430] &amp;lt;err&amp;gt; lpuart: Empty receiver state:4
[00:00:01.078,796] &amp;lt;inf&amp;gt; app_ble: Dev: 54:00:00
[00:00:01.687,316] &amp;lt;wrn&amp;gt; bt_hci_core: opcode 0x0000 pool id 3 pool 0x2000d4f0 != &amp;amp;hci_cmd_pool 0x2000d558
[00:00:01.727,691] &amp;lt;inf&amp;gt; bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:01.727,722] &amp;lt;inf&amp;gt; bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:01.727,752] &amp;lt;inf&amp;gt; bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 197.47763 Build 2370639017
[00:00:01.730,407] &amp;lt;inf&amp;gt; bt_hci_core: Identity: C6:09:16:54:00:00 (random)
[00:00:01.730,468] &amp;lt;inf&amp;gt; bt_hci_core: HCI: version 5.4 (0x0d) revision 0x1102, manufacturer 0x0059
[00:00:01.730,499] &amp;lt;inf&amp;gt; bt_hci_core: LMP: version 5.4 (0x0d) subver 0x1102
[00:00:01.730,499] &amp;lt;inf&amp;gt; app_ble: Bluetooth ready
[00:00:01.740,325] &amp;lt;inf&amp;gt; app_ble: Advertising successfully started&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The log where the id fails to set is here&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:01:00.058,349] &amp;lt;inf&amp;gt; app_ble: Connected 64:3D:C8:51:4B:77 (random)
[00:01:00.610,626] &amp;lt;inf&amp;gt; app_ble: MTU: 23
[00:01:00.640,594] &amp;lt;wrn&amp;gt; bt_l2cap: Ignoring data for unknown channel ID 0x003a
[00:01:01.540,710] &amp;lt;inf&amp;gt; xxxxxxxxx_service: Writing device id.
Device id: 54:16:9
[00:01:01.540,954] &amp;lt;inf&amp;gt; main: Evt: APP_EVENT_DEVICE_ID_UPDATE
[00:01:01.540,985] &amp;lt;inf&amp;gt; main: ------------------- POST status 42
base device_id: 54:0:0
path app/device_id, id: 54:16:9
[00:01:01.541,076] &amp;lt;wrn&amp;gt; main: Unable to set device id. -2
[00:01:01.603,515] &amp;lt;inf&amp;gt; app_ble: Disconnected from 64:3D:C8:51:4B:77 (random) (reason 0x13)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I move the definition outside of the scope and removed static but it doesn&amp;#39;t seem to change anything...&lt;/p&gt;
&lt;p&gt;Enjoy your holidays and I really hope we will be able to figure out what&amp;#39;s going wrong !&lt;br /&gt;&lt;br /&gt;Best regards,&lt;/p&gt;
&lt;p&gt;0x35c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/461561?ContentTypeID=1</link><pubDate>Fri, 22 Dec 2023 12:03:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3cb66a3-ae0b-42aa-95d1-0a908a306d58</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="0x35c"]Sorry for the delay[/quote]
&lt;p&gt;No need to apologize - we&amp;#39;ll continue this whenever you have a chance! :)&amp;nbsp;&lt;br /&gt;That being said, please also note that the national christmas holiday starts in Norway today, and lasts until new years. In this time we will have significantly reduced capacity here on DevZone, just so you know! :)&amp;nbsp;&lt;/p&gt;
[quote user="0x35c"]here is the whole code related to setting the device_id:[/quote]
&lt;p&gt;Could you move the definition of the&amp;nbsp;settings_handler outside of the scope of the init function, and make it non-static?&lt;/p&gt;
[quote user="0x35c"]I just found this error message at boot:[/quote]
&lt;p&gt;This looks like there is an error in your communication with the ADXL372 sensor, rather than an issue with setting the device ID. Could you share the full log for this scenario as well?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/461424?ContentTypeID=1</link><pubDate>Thu, 21 Dec 2023 11:09:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d317927-02a5-4894-b6ef-295dfb92118c</guid><dc:creator>0x35c</dc:creator><description>&lt;p&gt;Sorry for the delay, here is the whole code related to setting the device_id:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/app_5F00_config.c"&gt;devzone.nordicsemi.com/.../app_5F00_config.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It is quite similar to the documentation you sent me but it does not work...&lt;br /&gt;I just found this error message at boot:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.267,517] &amp;lt;err&amp;gt; ADXL372: failed to read id (0xFF:0xFF)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I guess it could be related but I don&amp;#39;t know why does this happen.&lt;br /&gt;Thanks in advance :)&lt;br /&gt;Regards,&lt;/p&gt;
&lt;p&gt;0x35c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/461135?ContentTypeID=1</link><pubDate>Tue, 19 Dec 2023 16:00:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20412913-d0da-4584-81bc-dff7e85a6d9c</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello 0x35c,&lt;br /&gt;&lt;br /&gt;Thank you for the elaboration and clarification.&lt;/p&gt;
[quote user="0x35c"]I can see that my id has the right value, but settings_save_one() returns -2 which is -ENOENT in the code below:[/quote]
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/apidoc/latest/group__system__errno.html"&gt;The -2 / -ENOENT error code means &amp;#39;no such file or directory&amp;#39;&lt;/a&gt;, which points in the direction of the key used for the write being incorrect or missing.&lt;br /&gt;However, looking at the source code for&amp;nbsp;settings_save_one it looks like the reason for the return code specifically is that &lt;em&gt;settings_save_dst&lt;/em&gt; has not been populated prior to the call.&lt;br /&gt;&lt;br /&gt;Could you share the rest of your relevant code as well, specifically your initalization and registration of the settings module? This should &lt;a href="https://docs.zephyrproject.org/latest/services/settings/index.html#example-persist-runtime-state"&gt;look similar to example in the settings documentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/460976?ContentTypeID=1</link><pubDate>Tue, 19 Dec 2023 08:21:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27f1e03e-d437-4dbd-b00e-a4f87c93dced</guid><dc:creator>0x35c</dc:creator><description>&lt;p&gt;Also, here is my prj.conf file if you want to check everything is ok&lt;br /&gt; [ EDIT ] prj.conf removed to keep informations away&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/460874?ContentTypeID=1</link><pubDate>Mon, 18 Dec 2023 15:13:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41eb8ea0-7e72-43ae-a18f-1a44518e5e69</guid><dc:creator>0x35c</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int app_config_set_device_id(struct app_ble_device_id *id)
{
    /* Save into settings only if we&amp;#39;re configured as a default */
    if (m_device_id.lower == APP_CONFIG_DEVICE_ID_LOWER_DEFAULT &amp;amp;&amp;amp;
        m_device_id.upper == APP_CONFIG_DEVICE_ID_UPPER_DEFAULT)
    {
        printk(&amp;quot;path %s, id: 54:%d:%d\n&amp;quot;, APP_CONFIG_DEVICE_ID_PATH, id-&amp;gt;upper, id-&amp;gt;lower);
        return settings_save_one(APP_CONFIG_DEVICE_ID_PATH, id, sizeof(struct app_ble_device_id));
    }
    else
    {
        /* Cannot set again.. */
        return -EALREADY;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is my piece of code that used to write the device id to the memory, I didn&amp;#39;t change anything except the printk() I added for debugging purposes. I can see that my id has the right value, but settings_save_one() returns -2 which is -ENOENT in the code below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*
 * Append a single value to persisted config. Don&amp;#39;t store duplicate value.
 */
int settings_save_one(const char *name, const void *value, size_t val_len)
{
	int rc;
	struct settings_store *cs;

	cs = settings_save_dst;
	if (!cs) {
		return -ENOENT;
	}

	k_mutex_lock(&amp;amp;settings_lock, K_FOREVER);

	rc = cs-&amp;gt;cs_itf-&amp;gt;csi_save(cs, name, (char *)value, val_len);

	k_mutex_unlock(&amp;amp;settings_lock);

	return rc;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Note that this code is the SDK source and that I didn&amp;#39;t change it in any way.&lt;/p&gt;
&lt;p&gt;My guess is that it has something to do with the first parameter of settings_save_one (APP_CONFIG_DEVICE_ID_PATH) which is set to app/device_id:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define APP_CONFIG_DEVICE_ID_KEY &amp;quot;device_id&amp;quot;
#define APP_CONFIG_DEVICE_ID_PATH APP_CONFIG_SETTINGS_KEY &amp;quot;/&amp;quot; APP_CONFIG_DEVICE_ID_KEY&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know why is it set to this, I wasn&amp;#39;t in charge of the code when this was written and I can&amp;#39;t find any element in the documentation about what this path should be set to.&lt;br /&gt;&lt;br /&gt;Thanks for your help and feel free to ask anything if you need precisions.&lt;/p&gt;
&lt;p&gt;0x35c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change bt device id on THINGY:91</title><link>https://devzone.nordicsemi.com/thread/460868?ContentTypeID=1</link><pubDate>Mon, 18 Dec 2023 15:02:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02366138-7d9d-478d-ae0c-49ee5f3d1b3c</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]&lt;p&gt;we have an app running on T91s and we recently upgraded it to sdk 2.5.0, from sdk 1.9.1. We used to change the device id after flashing our app on the thingy by connecting to the thingy and sending data, which was then processed and written to the thingy as its device id.&lt;/p&gt;
&lt;p&gt;This solution does not seem to work anymore with the newer sdk... I would like to know if there is any way to change the device id&lt;span&gt;¹&lt;/span&gt; after flashing the thingy91 with our app.&lt;/p&gt;[/quote]
&lt;p&gt;Which changes did you make to the application in your upgrade from v1.9.1 to v2.5.0?&lt;br /&gt;How did you configure this when it was working, and how are you configuring it now?&lt;br /&gt;By&amp;nbsp;&lt;em&gt;device ID&amp;nbsp;&lt;/em&gt;are you here referring to the advertised BLE name, or another ID?&lt;br /&gt;It would be great if you could share the relevant code using the&amp;nbsp;&lt;em&gt;Insert -&amp;gt; Code&amp;nbsp;&lt;/em&gt;option here on DevZone, so that I can know exactly what you are referring to here.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>