> We are looking for a way to read the serial number of the BeagleBone
> programmatically. As I understand it in the BeagleBone Rev A manual
> (sections 5.1 and 7.11), this serial number is written into EEPROM on
> I2C0. I'm new to EEPROM and I2C and accessing it from software so
> bare with me.
As with most things, linux and the TRM are off-by-one when enumerating things.
I use the following to change the hostname of my boards to something slightly more unique:
echo beaglebone$(hexdump -e '8/1 "%c"' /sys/bus/i2c/devices/1-0050/eeprom -s 14 -n 2)-$(hexdump -e '8/1 "%c"' /sys/bus/i2c/devices/1-0050/eeprom -s 24 -n 4) > /etc/hostname
change the -s and -m to match the EEPROM spec (16 and 12) to read out the complete serial:
root@beagleboneA3-0457:~# hexdump -e '8/1 "%c"' /sys/bus/i2c/devices/1-0050/eeprom -s 16 -n 12 ; echo
4511BB000457
regards,
Koen
In the interest of completeness.The BeagleBone Blackhexdump -e '8/1 "%c"' /sys/bus/i2c/devices/0-0050/eeprom -s 16 -n 12Found this post that got me nearly all the way there
The last digit on the barcode appears to be the check digit as descripted here: http://www.gs1.org/barcodes/support/check_digit_calculator for format GTIN-13
The "BBBK" section is also replace by "29" on mine too.
hexdump -e '8/1 "%c"' /sys/bus/i2c/device -s 80 -n 9; echo