Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I would like to identify which RaspberryPI hardware instance is booting on my network.

I have plans for using a LOT (not just 10) of them as clients in a larger solution, but I would like to reuse the SD-image for them all.

Is there any kinda way to identify them from each other, unless I place somekinda serial code in a file somewhere in the OS?

Btw. I use MONO/C# for programming, but I am just curious to know if the PI has a hardware serialnumber somehow or not?

share|improve this question

2 Answers 2

up vote 12 down vote accepted

You can use the same number used for buying the MPEG license.

Quoting http://www.raspberrypi.com/mpeg-2-license-key :

To find your serial number, type cat /proc/cpuinfo at the command line as shown below:

       pi@raspberrypi:~$ cat /proc/cpuinfo

       Processor       : ARMv6-compatible processor rev 7 (v6l)
       BogoMIPS        : 697.95
       Features        : swp half thumb fastmult vfp edsp java tls
       CPU implementer : 0x41
       CPU architecture: 7
       CPU variant     : 0x0
       CPU part        : 0xb76
       CPU revision    : 7
       Hardware        : BCM2708
       Revision        : 1000002
       Serial          : 000000000000000d

Serial is what you're looking for.

share|improve this answer
    
Ahh, nice idea. Do you have any clue of how to retrieve this from Mono? –  BerggreenDK Feb 28 '13 at 9:25
    
Only problem is that the client/user will have to buy the MPEG license just for that purpose alone. –  BerggreenDK Feb 28 '13 at 9:26
    
@BerggreenDK. Not sure what you mean. THe serial number that appears with the cpuinfo command is the serial number of the CPU. It's there whether you have an MPEG licence or not. –  Remo.D Feb 28 '13 at 9:49
1  
No, the '00000...d' is just there as an example. Try doing it on your raspberry and you'll get yours. –  Remo.D Feb 28 '13 at 10:00
1  
It is an hardware code that is unique for any Raspberry (I have two of them), it is not file based. I would have been surprised if you had it from Virtual Box. –  Remo.D Feb 28 '13 at 13:20

You could use the MAC address of the ethernet adaptor; use a statement something like this to extract it into a variable:

mysn=`ifconfig eth0 | grep HWaddr |sed -e's/.*HWaddr\s\(\S*\).*/\1/'`
share|improve this answer
    
A nice suggestion. If I could only see how I should retreive this from MONO. But the idea is great. Had completely forgot to think about the onboard LAN. MAC numbers are enough indeed. Just need to figure out how to pull that information from the System.Net library. –  BerggreenDK Feb 28 '13 at 9:27
    
Found this: stackoverflow.com/questions/850650/… –  BerggreenDK Feb 28 '13 at 9:30
1  
Note that you can modify the MAC address of the raspberry. This is a viable solution only if you don't need to be absolutely sure about the identity of your Raspberry Pi. The CPU serial code obtainable with cpuinfo is not alterable. –  Remo.D Feb 28 '13 at 9:56
    
okay, thats a great point too. Yes, MAC can be changed on some LAN hardware. Thats true. But I am merly concerned that someone would clone my SDCARD and then use it for multiple clients without my knowledge. That would be bad for my architecture of the solution. –  BerggreenDK Feb 28 '13 at 12:51
    
Sorry @TomG I really appricated your idea and I am going to use it as "fall back" for detecting devices that arent Raspberry PI hardware as my client-programs will be crossplatform. I wish I could mark two answers in this case. –  BerggreenDK Feb 28 '13 at 14:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.