<?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 retrieve the Matter QR code?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/122087/how-to-retrieve-the-matter-qr-code</link><description>Due to production requirements, I need to obtain the device&amp;#39;s QR code. However, I found that the QR code can only be retrieved using the code snippet below after calling Nrf::Matter::StartServer(). Since there are several production test items that need</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Jul 2025 08:59:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/122087/how-to-retrieve-the-matter-qr-code" /><item><title>RE: How to retrieve the Matter QR code?</title><link>https://devzone.nordicsemi.com/thread/541135?ContentTypeID=1</link><pubDate>Wed, 02 Jul 2025 08:59:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f48a95b3-ad66-4b99-bfe4-4bf64680f0ac</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;I have pinged the developers internally to assist in options here. Will update when i have something, sorry for the delays.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to retrieve the Matter QR code?</title><link>https://devzone.nordicsemi.com/thread/540947?ContentTypeID=1</link><pubDate>Tue, 01 Jul 2025 00:51:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4a479ef-1a3e-40e1-b2a9-d8ad5fe59f8a</guid><dc:creator>SunHuang</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are there any updates on this case?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to retrieve the Matter QR code?</title><link>https://devzone.nordicsemi.com/thread/540403?ContentTypeID=1</link><pubDate>Wed, 25 Jun 2025 01:57:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a88ac36-dc3b-46b5-87c0-f1b4c078f717</guid><dc:creator>SunHuang</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As I mentioned earlier, I must call PrintOnboardingCodes after executing Nrf::Matter::StartServer(), otherwise the system crashes. That&amp;rsquo;s why I&amp;rsquo;ve been emphasizing whether it&amp;rsquo;s possible to directly obtain the QR code string,because I believe it&amp;rsquo;s stored somewhere (likely in the factory data). So, how can I retrieve the QR code from anywhere in the program?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1750816316134v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to retrieve the Matter QR code?</title><link>https://devzone.nordicsemi.com/thread/540324?ContentTypeID=1</link><pubDate>Tue, 24 Jun 2025 12:03:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc631d46-8576-4ca4-878a-9c51badf6969</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-connectedhomeip/blob/3ccd6078b9b33af0fa6ddb71e51bb9860f9198a0/src/setup_payload/OnboardingCodesUtil.cpp#L52"&gt;https://github.com/nrfconnect/sdk-connectedhomeip/blob/3ccd6078b9b33af0fa6ddb71e51bb9860f9198a0/src/setup_payload/OnboardingCodesUtil.cpp#L52&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void PrintOnboardingCodes(const chip::PayloadContents &amp;amp; payload)
{
    char payloadBuffer[chip::QRCodeBasicSetupPayloadGenerator::kMaxQRCodeBase38RepresentationLength + 1];
    chip::MutableCharSpan qrCode(payloadBuffer);

    if (GetQRCode(qrCode, payload) == CHIP_NO_ERROR)
    {
        PrintQrCodeURL(qrCode);
    }
    else
    {
        ChipLogError(AppServer, &amp;quot;Getting QR code failed!&amp;quot;);
    }

    chip::MutableCharSpan manualPairingCode(payloadBuffer);
    if (GetManualPairingCode(manualPairingCode, payload) == CHIP_NO_ERROR)
    {
        ChipLogProgress(AppServer, &amp;quot;Manual pairing code: [%s]&amp;quot;, manualPairingCode.data());
    }
    else
    {
        ChipLogError(AppServer, &amp;quot;Getting manual pairing code failed!&amp;quot;);
    }
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to retrieve the Matter QR code?</title><link>https://devzone.nordicsemi.com/thread/540284?ContentTypeID=1</link><pubDate>Tue, 24 Jun 2025 08:54:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b93a895a-8f9a-442b-a502-c31cde46d85b</guid><dc:creator>SunHuang</dc:creator><description>[quote userid="91187" url="~/f/nordic-q-a/122087/how-to-retrieve-the-matter-qr-code/540281"]However, to save it to the buffer[/quote]
&lt;p&gt;I don&amp;#39;t understand what you mean. Can&amp;#39;t I get the string directly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to retrieve the Matter QR code?</title><link>https://devzone.nordicsemi.com/thread/540281?ContentTypeID=1</link><pubDate>Tue, 24 Jun 2025 08:32:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f672b0b8-dda5-46c0-a874-d8c2e5de82c3</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;From the developers here, this is the recommendation.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When the customer generates QR code externally, but at the same time would like the accessory to generate and transmit QR code using some propriatary protocol.&lt;/p&gt;
&lt;p&gt;To make it possible, Matter Factory Data must contain passcode. Then for example in our samples we do use the &lt;code&gt;PrintOnboardingCodes&lt;/code&gt; function to print the QR code on UART.&lt;/p&gt;
&lt;p&gt;Here is the example: &lt;a title="https://github.com/nrfconnect/sdk-nrf/blob/main/samples/matter/common/src/app/matter_init.cpp#l345c2-l345c22" href="https://github.com/nrfconnect/sdk-nrf/blob/main/samples/matter/common/src/app/matter_init.cpp#L345C2-L345C22" rel="noopener noreferrer" target="_blank"&gt;https://github.com/nrfconnect/sdk-nrf/blob/main/samples/matter/common/src/app/matter_init.cpp#L345C2-L345C22&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;However, to save it to the buffer, please take a look at the functions here, which should help: &lt;a title="https://github.com/nrfconnect/sdk-connectedhomeip/blob/3ccd6078b9b33af0fa6ddb71e51bb9860f9198a0/src/setup_payload/onboardingcodesutil.cpp" href="https://github.com/nrfconnect/sdk-connectedhomeip/blob/3ccd6078b9b33af0fa6ddb71e51bb9860f9198a0/src/setup_payload/OnboardingCodesUtil.cpp" rel="noopener noreferrer" target="_blank"&gt;https://github.com/nrfconnect/sdk-connectedhomeip/blob/3ccd6078b9b33af0fa6ddb71e51bb9860f9198a0/src/setup_payload/OnboardingCodesUtil.cpp&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to retrieve the Matter QR code?</title><link>https://devzone.nordicsemi.com/thread/539795?ContentTypeID=1</link><pubDate>Thu, 19 Jun 2025 03:57:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8a255a0-263c-4a42-be08-af40aa6ee427</guid><dc:creator>SunHuang</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I understand what you mean, and we do generate the QR code in that way as well. However, what I&amp;#39;m referring to is the production testing phase. I would like to verify that the hardware functions correctly before transmitting data using our custom communication protocol. You only need to tell me how to read the QR code before calling &lt;code data-start="335" data-end="363"&gt;Nrf::Matter::StartServer()&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to retrieve the Matter QR code?</title><link>https://devzone.nordicsemi.com/thread/539706?ContentTypeID=1</link><pubDate>Wed, 18 Jun 2025 12:37:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53231353-8f39-4b52-98cc-1123230936a6</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;&lt;span&gt;Checked internally and for production we do recommend to use our Factory Data module. Here is an instruction for QR code generation: &lt;a title="https://docs.nordicsemi.com/bundle/ncs-latest/page/matter/nrfconnect_factory_data_configuration.html#generating_onboarding_codes" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/matter/nrfconnect_factory_data_configuration.html#generating_onboarding_codes" rel="noopener noreferrer" target="_blank"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/matter/nrfconnect_factory_data_configuration.html#generating_onboarding_codes&lt;/a&gt;&amp;nbsp;. but it can be used independently based on VID/PID/discriminator and passcode.&lt;br /&gt;&lt;br /&gt;You may use the helper python script and integrate it in production line, where factory_data partition content can be generated uniquely for each device. For development, we also include the passcode in the firmware which allows to print the URL to QR code in the shell command.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to retrieve the Matter QR code?</title><link>https://devzone.nordicsemi.com/thread/539340?ContentTypeID=1</link><pubDate>Mon, 16 Jun 2025 09:18:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a98f86db-06fa-4d3e-87e6-28353b9afd2e</guid><dc:creator>SunHuang</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I understand the steps you mentioned, but in my case, it&amp;#39;s for mass production purposes. I need to transmit the QR code using a specific communication format. This protocol is for internal use. I must send out the QR code immediately upon startup.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to retrieve the Matter QR code?</title><link>https://devzone.nordicsemi.com/thread/539318?ContentTypeID=1</link><pubDate>Mon, 16 Jun 2025 07:47:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71a96305-4a97-4f56-a603-d902d7f6b0b5</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi there,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;For factory data it should be made if you have the&amp;nbsp;&lt;span&gt; --generate_onboarding command.&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/matter/nrfconnect_factory_data_configuration.html#generating_onboarding_codes"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/matter/nrfconnect_factory_data_configuration.html#generating_onboarding_codes&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;So you can get the QR code while generating with the factory data or with the chip-tool.&lt;br /&gt;&lt;br /&gt;So like the example here shows:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/matter/nrfconnect_factory_data_configuration.html"&gt;https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/matter/nrfconnect_factory_data_configuration.html&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;With the chip-tool:&lt;br /&gt;./chip-tool payload generate-qrcode --discriminator 1234 --setup-pin-code 13243546 --vendor-id 0x123 --product-id 0x123&amp;nbsp;&lt;br /&gt;This will output a QR code payload, which you can then visualize using a QR code generator website, such as appending the result to:&lt;br /&gt;&lt;code dir="ltr"&gt;project-chip.github.io/.../qrcode.html&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>