get unit serial number
- This topic has 3 replies, 2 voices, and was last updated 13 years, 2 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forums › MultiConnect OCG › get unit serial number
Hi, I am looking for a way to get the serial number of the unit either from the command line or programmatically or whatever.
I found the serial number (and imei…I would be happy with either) stored in a file /sys/devices/platform/i2c-gpio/i2c-0/0-0056/eeprom but I am not quite sure how to read the data in and grab just the serial number.
I noticed there is a program mts-id-eeprom but when I run it it doesn’t print any of the information, all 0s or empty strings
Any ideas? Thanks
Brandon,
mts-id-eeprom is the application you want, but you have to give it the path to the eeprom (which you already also found).
mts-id-eeprom --help
will give command-line options.
Running:
mts-id-eeprom /sys/devices/platform/i2c-gpio/i2c-0/0-0056/eeprom
will produce yaml output that you can parse.
Jesse
Thanks for that…although it doesn’t quite work. I had another look at the command line options and it should actually be this:
mts-id-eeprom –in-file /sys/devices/platform/i2c-gpio/i2c-0/0-0056/eeprom
Although, I think I will probably just use python and use struct to read out the bits I need like the c code for mts-id-eeprom does.
Whoops, yeah, I meant to have the –in-file option in there, sorry.