Advertisement
zmatt

beaglebone serials (eeprom vs label)

Feb 20th, 2025 (edited)
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. perl -Mautodie -E 'my $path = "/sys/bus/i2c/devices/0-0050/0-00500/nvmem"; $path = "/sys/bus/i2c/devices/0-0050/eeprom" if -w "/sys/bus/i2c/devices/0-0050/eeprom" || ! -f $path; open my $fh, "<:raw", $path; sysread $fh, $_, 0x70, 0; s/[^ -~]{1,32}\z|X{9}\z//; say for grep $_, unpack "x4a12a12x52a32", $_'
  2.  
  3.  
  4. ----- older beaglebone ---------------------------------------
  5.  
  6. script output:
  7. A335BNLT00C0
  8. 4215BBBK0789
  9. 400524+1301+001929+1542
  10.  
  11. breakdown of second line:
  12. 42 week number
  13. 15 year without century
  14. BBBK (fixed string)
  15. 0789 serial number in hexadecimal
  16.  
  17. printed on label:
  18. 400524 (fixed string)
  19. 1301 (fixed string)
  20. 001929 serial number in decimal
  21. 1542 year and week number
  22.  
  23.  
  24. ----- recent beaglebone ---------------------------------------
  25.  
  26. script output:
  27. A335BNLT00C0
  28. 2251SBB10986
  29.  
  30. breakdown of second line:
  31. 22 year without century
  32. 51 week number
  33. SBB (fixed string)
  34. 10986 serial number in decimal
  35.  
  36. printed on label:
  37. BBBVC (fixed string)
  38. 202212 year and month
  39. 010986 serial number in decimal
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement