<?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 modify Matter device’s discriminator and setup PIN code without configuring factorydata?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118484/how-to-modify-matter-device-s-discriminator-and-setup-pin-code-without-configuring-factorydata</link><description>Hi Team, 
 
 Is it possible to modify Matter device’s discriminator and setup PIN code in Matter&amp;#39;s sample app for test purpose without configuring factorydata ? 
 Default discriminator: 3840 
 Default Setup PIN Code: 20202021 
 
 Thank you 
 Bhavya</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Jan 2025 14:21:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118484/how-to-modify-matter-device-s-discriminator-and-setup-pin-code-without-configuring-factorydata" /><item><title>RE: How to modify Matter device’s discriminator and setup PIN code without configuring factorydata?</title><link>https://devzone.nordicsemi.com/thread/520745?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2025 14:21:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fec8b48-b131-4702-8e76-271dea0a1f9c</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi Bhavya,&lt;/p&gt;
&lt;p&gt;You can change the descriminator with &lt;code&gt;CONFIG_CHIP_DEVICE_DISCRIMINATOR&lt;/code&gt; in prj.conf. As for the PIN code, you can change it using &lt;code&gt;CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE&lt;/code&gt;, but you will also have to generate a new SPAKE2+ verifier for the new passcode and set &lt;code&gt;CONFIG_CHIP_FACTORY_DATA_GENERATE_SPAKE2_VERIFIER=n&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The SPAKE2+ verifier can be generated with the &lt;a href="https://project-chip.github.io/connectedhomeip-doc/scripts/tools/spake2p/README.html"&gt;SPAKE2+ Python Tool&lt;/a&gt; using the passcode, SPAKE2+ salt, and iteration count. The simplest is to use the default SPAKE2+ salt (&lt;code&gt;U1BBS0UyUCBLZXkgU2FsdA==&lt;/code&gt;) and iteration count (&lt;code&gt;1000&lt;/code&gt;). Here is an example where I use the default salt and iteration count but a different passcode:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;./spake2p.py gen-verifier -p 20372039 -s U1BBS0UyUCBLZXkgU2FsdA== -i 1000&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This results in the verifier &lt;code&gt;kLXow6J5EYWRa3aO71DkTG5qMtkn5PfwwXhOixGa2zEEDEDGlKfe7mEBAg6b3CTx++XPKapVRxnuWs6r6O90+7aDXjlDytFVwlS+PVpSY3dQTmm1/0aZKr9Mw+4mWPBefQ==&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" title="" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1738246729309v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Here is an example showing how to set this in prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_CHIP_DEVICE_DISCRIMINATOR=0x231
CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE=20372039
CONFIG_CHIP_FACTORY_DATA_GENERATE_SPAKE2_VERIFIER=n
CONFIG_CHIP_DEVICE_SPAKE2_TEST_VERIFIER=&amp;quot;kLXow6J5EYWRa3aO71DkTG5qMtkn5PfwwXhOixGa2zEEDEDGlKfe7mEBAg6b3CTx++XPKapVRxnuWs6r6O90+7aDXjlDytFVwlS+PVpSY3dQTmm1/0aZKr9Mw+4mWPBefQ==&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please note that these Kconfigs should only be used for testing purposes.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>