<?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 determine the PPK2 Serial Number</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114776/how-to-determine-the-ppk2-serial-number</link><description>Hi, 
 
 I have tried to look through the forums but I cannot find exactly how the nRF Connect -&amp;gt; Power Profiler application is able to get/obtain the device SN? 
 In the log, and in the connection drop-down menu, the Power Profiler app shows a list of</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Sep 2024 07:07:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114776/how-to-determine-the-ppk2-serial-number" /><item><title>RE: How to determine the PPK2 Serial Number</title><link>https://devzone.nordicsemi.com/thread/502866?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2024 07:07:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db3a4e6e-5cb7-4da4-a1e0-2310ffac181a</guid><dc:creator>WhiteFang</dc:creator><description>&lt;p&gt;I have found *a solution* for Windows users - at least one that works on my dev computer.. time will tell!&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f603.svg" title="Smiley"&gt;&amp;#x1f603;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;It takes two calls to the CLI via whatever tool you use (I use LabVIEW), but I only found the value I need through PowerShell (rumor is you can also find it in windows registry but that has even more &amp;quot;concerns&amp;quot; in terms of programmatic access and access rights).&amp;nbsp; Anyway, I found the parameter name in Windows to be&amp;gt;&amp;nbsp;&lt;span&gt;DEVPKEY_Device_Parent&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2-step solution, assuming you already know the COM port the device is on, in my example below it was on COM9:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1. Issue command to get PNPDeviceID:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;wmic path Win32_SerialPort where &amp;quot;DeviceID=&amp;#39;COM9&amp;#39;&amp;quot; get PNPDeviceID&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;(parse the CLI output to obtain the PNPDeviceID, in my case it was&amp;nbsp;USB\VID_1915&amp;amp;PID_C00A&amp;amp;MI_01\6&amp;amp;1A807EFB&amp;amp;0&amp;amp;0001)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. Issue a CLI command to run a Powershell Script.&amp;nbsp; The whole thing gets a bit &amp;quot;messy&amp;quot; but the below CLI goes in as one lump and executes in a second or so:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;cmd /c powershell.exe -Command &amp;quot;$deviceId = &amp;#39;USB\VID_1915&amp;amp;PID_C00A&amp;amp;MI_01\6&amp;amp;1A807EFB&amp;amp;0&amp;amp;0001&amp;#39;; $parentProperty = Get-PnpDeviceProperty -InstanceId $deviceId | Where-Object { $_.KeyName -eq &amp;#39;DEVPKEY_Device_Parent&amp;#39; }; $parentInstanceId = $parentProperty.Data; Write-Output &amp;quot;Parent Instance ID: $parentInstanceId&amp;quot;&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Parse the output to get the ParentID value, for me it was&amp;nbsp;USB\VID_1915&amp;amp;PID_C00A\F0D53E50C7CD&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;....tada?! :D&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;Depending on your tools and needs, I found a way to speed it up by making one CLI call, and then getting the ParentID value from a Windows Registry Read.&amp;nbsp; Of course, if you use .NET you can also avoid the CLI entirely which may speed up the process even more.&amp;nbsp; I did not want to depend on .NET on the target machines so my method currently is this:&lt;/p&gt;
&lt;p&gt;1: get info on all (connected/active) SerialPorts via CLI (takes the same amount of time as getting one port)&amp;gt;&lt;br /&gt;&lt;code&gt;wmic path Win32_SerialPort get DeviceID, PNPDeviceID, Description&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2: parse the CLI output and make a list of PNPDeviceIDs (and COM Port) filtered by the Description field which should contain &amp;quot;nRF Connect&amp;quot; etc.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3: Open Windows Registry with &amp;quot;KEY_READ&amp;quot; privileges to HKEY_LOCAL_MACHINE (this should be allowed on most systems I think).&amp;nbsp; The SubKeys you want to list/read consists of the &amp;quot;first part, up to the second &amp;amp;&amp;quot; of the PNPDeviceID &lt;strong&gt;USB\VID_1915&amp;amp;PID_C00A&lt;/strong&gt;&amp;amp;MI_01\6&amp;amp;1A807EFB&amp;amp;0&amp;amp;0001 (VID = VendorID so I suspect this is constant over time but ...)&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;4: when you read the subkey above you should get a list (array) of them, representing the SN# of all the matching VID devices that has at some point been connected.&amp;nbsp; From there I open each subkey from the list in step 3, using additional info from the PNPDeviceID string I started with to find which SN# belongs to it.&amp;nbsp; E.g. Open key &amp;quot;SYSTEM\CurrentControlSet\Enum\USB\VID_1915&amp;amp;PID_C00A\F0D53E50C7CD&amp;quot; and Read Value of &amp;quot;ParentIdPrefix&amp;quot; and match this against the &amp;quot;6&amp;amp;1A807EFB&amp;amp;0&amp;quot; - If it matches you found your device SN.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sorry if the above is hard to follow but basically if you open regedit to the&amp;nbsp;Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB you will see all USB items, most likely including many other VID devices as well. so step 3 is to get a list of all the nRF device based on the VID number we got from CLI (or .NET or...).&amp;nbsp; Then under e.g.&amp;nbsp;Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_1915&amp;amp;PID_C00A you will see the SN of every PPK you ever had attached, and inside each SN key, there will be a ParentIdPrefix to match against the &amp;quot;last part&amp;quot; of the PNPDeviceID string (from the last \ to the end of the string).&amp;nbsp;&lt;br /&gt;&lt;br /&gt;So in my current implementation, I now do one CLI that takes around 300ms - then using various regex and filters I cross-check against the registry (the registry reads are on the 1ms level on my system), and out of this I return an array of COM# and SN# currently connected.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to determine the PPK2 Serial Number</title><link>https://devzone.nordicsemi.com/thread/502782?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2024 13:13:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09b08832-cc03-4cd4-8696-90f643458200</guid><dc:creator>WhiteFang</dc:creator><description>&lt;p&gt;Hi Bendik,&lt;/p&gt;
&lt;p&gt;I somehow missed it when I (tried) to inspect all the properties earlier, I am able to see the &amp;quot;Parent&amp;quot; property Value similar to how you show, and my SN# is&amp;nbsp;F0D53E50C7CD&lt;/p&gt;
&lt;p&gt;However, I have been unable to get this property value listed via CLI in Windows (11).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Am I just missing some property? Should I use another command?&lt;/p&gt;
&lt;p&gt;Does anyone know how to retrieve this programmatically on Windows?&amp;nbsp; (Can we have it as a future FW update that it can be included in the MetaData?)&lt;/p&gt;
&lt;p&gt;For example I have tried variations of:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. Get PNPDeviceID:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;wmic path Win32_SerialPort where &amp;quot;DeviceID=&amp;#39;COM9&amp;#39;&amp;quot; get PNPDeviceID&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;2. list info of PNPDeviceID:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;wmic path Win32_PnPEntity where &amp;quot;DeviceID=&amp;#39;USB\\VID_1915&amp;amp;PID_C00A&amp;amp;MI_01\\6&amp;amp;1A807EFB&amp;amp;0&amp;amp;0001&amp;#39;&amp;quot; get /format:list&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Which gives this listing, and I may have gone blind but for some reason that particular info does not appear to be in any of the many listed values?!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;code&gt;Availability=&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Caption=nRF Connect USB CDC ACM (COM9)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ClassGuid={4d36e978-e325-11ce-bfc1-08002be10318}&lt;/code&gt;&lt;br /&gt;&lt;code&gt;CompatibleID={&amp;quot;USB\COMPAT_VID_1915&amp;amp;amp;Class_02&amp;amp;amp;SubClass_02&amp;amp;amp;Prot_00&amp;quot;,&amp;quot;USB\COMPAT_VID_1915&amp;amp;amp;Class_02&amp;amp;amp;SubClass_02&amp;quot;,&amp;quot;USB\COMPAT_VID_1915&amp;amp;amp;Class_02&amp;quot;,&amp;quot;USB\Class_02&amp;amp;amp;SubClass_02&amp;amp;amp;Prot_00&amp;quot;,&amp;quot;USB\Class_02&amp;amp;amp;SubClass_02&amp;quot;,&amp;quot;USB\Class_02&amp;quot;}&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ConfigManagerErrorCode=0&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ConfigManagerUserConfig=FALSE&lt;/code&gt;&lt;br /&gt;&lt;code&gt;CreationClassName=Win32_PnPEntity&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Description=nRF Connect USB CDC ACM&lt;/code&gt;&lt;br /&gt;&lt;code&gt;DeviceID=USB\VID_1915&amp;amp;amp;PID_C00A&amp;amp;amp;MI_01\6&amp;amp;amp;1A807EFB&amp;amp;amp;0&amp;amp;amp;0001&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ErrorCleared=&lt;/code&gt;&lt;br /&gt;&lt;code&gt;ErrorDescription=&lt;/code&gt;&lt;br /&gt;&lt;code&gt;HardwareID={&amp;quot;USB\VID_1915&amp;amp;amp;PID_C00A&amp;amp;amp;REV_0305&amp;amp;amp;MI_01&amp;quot;,&amp;quot;USB\VID_1915&amp;amp;amp;PID_C00A&amp;amp;amp;MI_01&amp;quot;}&lt;/code&gt;&lt;br /&gt;&lt;code&gt;InstallDate=&lt;/code&gt;&lt;br /&gt;&lt;code&gt;LastErrorCode=&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Manufacturer=Nordic Semiconductor ASA&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Name=nRF Connect USB CDC ACM (COM9)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;PNPClass=Ports&lt;/code&gt;&lt;br /&gt;&lt;code&gt;PNPDeviceID=USB\VID_1915&amp;amp;amp;PID_C00A&amp;amp;amp;MI_01\6&amp;amp;amp;1A807EFB&amp;amp;amp;0&amp;amp;amp;0001&lt;/code&gt;&lt;br /&gt;&lt;code&gt;PowerManagementCapabilities=&lt;/code&gt;&lt;br /&gt;&lt;code&gt;PowerManagementSupported=&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Present=TRUE&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Service=usbser&lt;/code&gt;&lt;br /&gt;&lt;code&gt;Status=OK&lt;/code&gt;&lt;br /&gt;&lt;code&gt;StatusInfo=&lt;/code&gt;&lt;br /&gt;&lt;code&gt;SystemCreationClassName=Win32_ComputerSystem&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:monospace;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to determine the PPK2 Serial Number</title><link>https://devzone.nordicsemi.com/thread/502765?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2024 12:26:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c58e58ef-100e-484c-a454-73431e3e6391</guid><dc:creator>Bendik Heiskel</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The serial number as a part of the USB device descriptor. There are multiple ways of read this info.&lt;/p&gt;
&lt;p&gt;In windows you can find it in the &amp;quot;parent&amp;quot; property found in the device manager:&lt;br /&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/pastedimage1726575829562v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The PPK2 will show up as a serial COM port.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In linux you can use &lt;code&gt;lsusb -d 1915:C00A -v &lt;/code&gt;&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/pastedimage1726575956075v3.png" alt=" " /&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Bendik&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>