How to get the processor serial number of Raspberry PI 2 with Windows IOT
Asked Answered
O

3

10

I need to get the processor serial number of a Raspberry Pi2 that is running windows 10 IoT.

Ovalle answered 27/11, 2015 at 15:19 Comment(8)
I don't think any processors have exposed their serial numbers via an API call since the Pentium 3 got a lot of flack for doing it back in the 90sUnruh
see this: securityblog.gr/668/get-cpu-id-serial-number-using-cCapriccioso
@cybermonker the blog post is wrong, that WMI value gives you the make and model of the processor, two processors of the same model will return the same value.Unruh
As far as I know a Raspberry Pi has a device, not a processor serial number, if Windows IoT can't expose this then it's a very silly limitation! If the idea for Windows IoT is to start with a very limited set of APIs and then over years develop a platform that is actually usable in the real world.. well by then Linux, like Android in phones, will have completely taken over on IoT devices..Insult
Also, this msdn.microsoft.com/en-us/library/windows/apps/… returns identical GUIDs across different boards :-( ??Nikianikita
And this workaround ( embedded101.com/BruceEitman/entryid/676/… ) breaks in the custom OEM image/FFU build of iot-core ... apparently due to changes in access protection -- not possible to debug.Nikianikita
@Nikianikita CyberMonkey had a post pulling the WMI info, although the post stated to get the "ProcessorID", it should have been "SerialNumber".Bailsman
Thanks, but it would not be supported on UWP/Iot-Core anyway even if it did produce a unique serial ID -- which it does not as far as I can tell. If Microsoft wants the "T" in IoT to work, then it must provide us a way to uniquely identify what Thing we are on. This is possible on linux systems. So, still looking for a dependable, supported solution.Nikianikita
J
11

Usually this is within the Windows.System.Profile.HardwareIdentification namespace. Unfortunately, that's one of the unsupported namespaces with Win10 IoT Core.

Instead, to identify the metal, I'm using info from the network adaptor(s):

    public static HashSet<string> NetworkIds()
    {
        var result = new HashSet<string>();

        var networkProfiles = Windows.Networking.Connectivity.NetworkInformation.GetConnectionProfiles().ToList();

        foreach (var net in networkProfiles)
        {
            result.Add(net.NetworkAdapter.NetworkAdapterId.ToString());
        }

        return result;
    }

Of course, this is not completely error proof, but, so far, the only way I can see to get a reasonably reliable device ID.

Johm answered 29/11, 2015 at 5:53 Comment(3)
I do not think this is a workable answer since it give a different ID across software installations: i.e. it does not uniquely identify the board, it identifies at best the software-installation. Thus, it is not the requested processor serial number or similar. I wish it were!Nikianikita
@Nikianikita do it how Amazon does it. They assign a unique id to each device. When IoT things come back online they can sync them back up... see Registry and Device Shadows aws.amazon.com/iot/how-it-works - if the device has been updated while offline I'm pretty sure it would get a new unique id assigned, but would need to try this to be sure. I also suspect Amazon take control of updating devices and thats how they track changes to network/board id's.Privatdocent
Thanks Jeremy. As does Azure iot-hub. Trying to understand how this handles the init/update scenario: Take an off-the-shelf RPi and install a IoT-Core app. All this app knows about is how to call its common configuration (cloud) service. The config service knows more, based on the ID of the RPi. The RPi boots for the first time (or app/OS is updated by microsoft, or gets a new SD-card, whatever). How does it find its unique config on the config server? Or how to achieve this without commisioning software for a particular RPi HW-instance (risky, since soft, and costly)?Nikianikita
F
2

I've extracted a code sample from the Microsoft's IoT Sample (IoTCoreDefaultApp) that might helpful to you to extract device information (unfortunately, processor serial number never exposed for programming).

How to get Windows IoT device's information: enter image description here

Forensics answered 13/12, 2015 at 17:18 Comment(3)
Unfortunately these information aren't unique per hardware, i guess its just software informationArianearianie
to explain: I used two raspberry pis and they had already the same information (I have to admit, that it was the same sd-card), but that shouldnt happen eitherArianearianie
Yes, you would think that an IoT framework could deliver you a unique ID for an IoT hardware instance. Gosh.Nikianikita
B
0

Use this code to get device information.

            Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation deviceInfo= new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation();
Bassorilievo answered 8/3, 2019 at 8:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.