Serial number written to hardware?
7 posts
I would like to know, if the unique serial number of each Raspi is written into some registers on the Board? If so, how could I read this information out using a C-program?
- Posts: 33
- Joined: Mon Dec 26, 2011 11:03 pm
Try:
cat /proc/cpuinfo
Your serial should be different.
cat /proc/cpuinfo
- Code: Select all
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 : 0002
Serial : 000000000000000d
Your serial should be different.
- Moderator
- Posts: 3317
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Thx for your help. Yes this seems to be what I'm looking for. 
I'm sorta newby to Linux so I gotta ask: How do I put this into C-code? This appears to be some command for the console.
Is it ok to just read the file directly from the SD-card without using any console-commands?
I wonder if there are differences between Farnell and Element 14 boards?
I'm sorta newby to Linux so I gotta ask: How do I put this into C-code? This appears to be some command for the console.
Is it ok to just read the file directly from the SD-card without using any console-commands?
I wonder if there are differences between Farnell and Element 14 boards?
Last edited by GR-Thunderstorm on Mon Jul 16, 2012 11:55 am, edited 1 time in total.
- Posts: 33
- Joined: Mon Dec 26, 2011 11:03 pm
GR-Thunderstorm wrote:Thx for your help. Yes this seems to be what I'm looking for.
I'm sorta newby to Linux so I gotta ask: How do I put this into C-code? This appears to be some command for the console.
I wonder if there are differences between Farnell and Element 14 boards?
Hi
If I was doing this then I would read the file looking for the relevant tag such as Serial and read the value.
Cheers
Paul
Procrastination - The Thief of Time.
- Posts: 346
- Joined: Tue May 29, 2012 2:51 pm
- Location: Lincolnshire UK
PaulCheffus wrote:GR-Thunderstorm wrote:Thx for your help. Yes this seems to be what I'm looking for.
I'm sorta newby to Linux so I gotta ask: How do I put this into C-code? This appears to be some command for the console.
I wonder if there are differences between Farnell and Element 14 boards?
Hi
If I was doing this then I would read the file looking for the relevant tag such as Serial and read the value.
Cheers
Paul
Yes this was my intention. I just didn't know that this "cat" command actually just reads out some file from the harddrive until I just tried it in a virtual machine on my PC.
Thanks alot for your help guys!
- Posts: 33
- Joined: Mon Dec 26, 2011 11:03 pm
the /proc/ directory is not on the HD [more accurately the SD card] it is a device and can be read as a file
actually in linux [and unix] everything can be considered as a file and all you need is read / write access to the file for manipulation [YMMV]
...
so you just use the standard IO libraries to read the file
actually in linux [and unix] everything can be considered as a file and all you need is read / write access to the file for manipulation [YMMV]
...
so you just use the standard IO libraries to read the file
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX - Prosliver FTW
There's more discussion about serial numbers here: viewtopic.php?f=29&t=8985