12 Replies Latest reply on Nov 18, 2014 12:52 PM by Terrence_

    CPU Serial Number or something unique

    Terrence_

      I need to obtain a unique identifier for each of the billion Edison boards I hope to sell to the market.

       

      Each board needs to have an ID so I can tag the data going to the cloud with it.

       

      MAC address is not acceptable, as from what I understand it may not be unique.

       

      How can I grab the CPU Serial Number, or anything else you can think of for this purpose?

       

      Thank you.

      Terrence

       

      ps, I saw this on another thread

       

      >>However apart from the serial and the SL number, there are also the FPO number and ATPO number,but these ones are unique to the the processor, hence each processor will have a unique FPO and ATPO combination.

        • 1. Re: CPU Serial Number or something unique
          mikalhart

          Where did you read that the MAC address may not be unique?  Working with wired networking manufacturing, I know we go to huge lengths to make sure that MAC addresses are never duplicated, and I would be very surprised--astounded actually--to find out that Edisons don't comply with this.

          • 2. Re: CPU Serial Number or something unique
            B.

            MAC addresses should be unique coming from the manufacturer,  but depending on the application may not be a reliable way to uniquely identify a device if you are considering security.  A MAC can easily be changed or cloned.

             

            It's hard to say more without knowing what your end goal is.

            • 3. Re: CPU Serial Number or something unique
              Terrence_

              My end goal it this:

               

              Consumers will purchase the product.  There product sends data to the cloud which the consumer can monitor from a website.  So I need a way for the consumer to open the package up and then go to the website and key in the unique ID that will allow them to monitor the data that the Edison sends to the cloud.

               

              I also need to be able access the ID from code so that I can send it up to the cloud as the identifier for the message.

               

              I don't want to give it a unique id myself because that is more complex and storing the self generated ID on the Edison may not be permanent.

               

              So I read that macs can be changed or cloned, so that doesn't seem to be the answer, but a processor ID shouldn't be able to be changed or cloned.

               

              Mikalhart what do you think about the cloning issue?

               

              B, what do you think?

               

              Thanks for your ideas.

              Terrence

              • 4. Re: CPU Serial Number or something unique
                Terrence_

                Mikalhart, here is a link talking about a guy who has 2 Galileo boards with the same mac address.

                 

                https://communities.intel.com/message/222888#222888

                • 5. Re: CPU Serial Number or something unique
                  B.

                  It's just my two cents, but your customer is still going to have to configure the device to connect to wifi, right?  In most cases it seems like it would only take a few more lines of code to generate a unique ID then encrypt and store it on the device at the same time.

                  • 6. Re: CPU Serial Number or something unique
                    Terrence_

                    You are correct B, they will have to configure wifi.  I had not thought about creating an id then.  Any idea on how to create a guid on the Edison, or what sort of ID would you suggest?

                    Looking for ideas.

                     

                    Terrence

                     

                    Edit:

                    Boy I have not thought this through clearly enough.  How would I get the consumer of my product to key in the Wi-Fi  configuration details?  I was figuring I would do it remotely, but that assumes the Edison is already on the internet.  I have my cart before the horse.

                    • 7. Re: CPU Serial Number or something unique
                      deium

                      Terrence_  what about using the Edison module serial number?  You can grab that from the file at /factory/serial_number - it matches the label on the module

                      • 8. Re: CPU Serial Number or something unique
                        mcabral

                        Hi,

                         

                        You can use /dev/random to create a random number of characters for instance to feed into a hashing function.

                         

                        According to this post, https://communities.intel.com/message/263115#263115 Intel Edison is able to gather entropy through hardware which should make the generated random numbers less problematic than a pseudo-random generator.

                        • 9. Re: CPU Serial Number or something unique
                          Terrence_

                          deium, that is a great idea, exactly what I was looking for.

                           

                          Can you  tell me how I would grab that number via code in Arduino c/c++?

                           

                          Some function like;

                          string serialNumber = File.Read( /factory/serial_number);

                           

                          Thank you for your idea and help.

                           

                          Terrence

                          • 10. Re: CPU Serial Number or something unique
                            Terrence_

                            mcabral, thanks for your idea.  I think the deium's serial number is exactly what I was looking for.

                             

                            Terrence.

                            • 11. Re: CPU Serial Number or something unique
                              deium

                               

                              Terrence_  this worked for me in iotdk eclipse.

                              --- start file  ----

                              #include <stdio.h>
                              #include <stdlib.h>

                               

                              int main(void) {

                                FILE *fp;                 // file pointer
                                char serialno[17];   // serial_number is 16 characters + 1 for null 0x00;
                                char *mode = "r";    //  mode can be r - read, w - write


                                fp = fopen("/factory/serial_number",mode);   // open the file
                                if (fp == NULL) {                                             // if did not open, alert and exit
                                  puts("Can't open input file");
                                  exit(1);
                                }
                                fscanf(fp, "%s", serialno);                               // read string
                                puts(serialno);                                                // write string to console

                                fclose(fp);                                                       // close the file
                                return 0;
                              }

                              --- end file ---

                              • 12. Re: CPU Serial Number or something unique
                                Terrence_

                                Thank you Deium, I will give that a try tonight.

                                 

                                Terrence