Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: shug on April 02, 2014, 11:44:24 AM

Title: Serial number or any unique identifier
Post by: shug on April 02, 2014, 11:44:24 AM
Hi all,
do you known if each A20 boards have a serial number or a something like a unique identifier ?
I would like to identify each board on my network (not using lac address has it can be changed)
Thanks !
Title: Re: Serial number or any unique identifier
Post by: laskov on April 02, 2014, 12:57:18 PM
You may put a file in /etc (or somewhere else: /, /root, /home/olimex) with a description you like or change hostname of the boards by editing /etc/hostname and /etc/hosts. After that start /etc/init.d/hostname.sh and reboot. If boards are in the same network you must change their hostnames to avoid conflicts, I think.
Title: Re: Serial number or any unique identifier
Post by: shug on April 02, 2014, 03:30:43 PM
Thanks for your reply.
Of course I can put a file on the board filesystem but I'll have to deploy 250 of them and I don't want a specific SD card for each with the dedicated file.
Title: Re: Serial number or any unique identifier
Post by: laskov on April 02, 2014, 04:14:10 PM
So you must use DHCP server to assign IPs and hostnames.
Title: Re: Serial number or any unique identifier
Post by: shug on April 02, 2014, 04:23:21 PM
Yes I known but this is not my problem. I just my boards to say "I'm board with identified by ###" without taking care about the network name or ip or mac address.
Title: Re: Serial number or any unique identifier
Post by: dave-at-axon on April 02, 2014, 04:41:52 PM
Hi Shug,

I checked the A20 documents and there is apparently now unique ID in the processor and nothing else within the A20 design would have either. As you said, the Ethernet MAC can be changed so that's not much use.

An option you could consider is to have a small PCB made up that plugs into one of the UEXT connections and uses the following I2C serial device.

http://www.maximintegrated.com/datasheet/index.mvp/id/5248
Title: Re: Serial number or any unique identifier
Post by: laskov on April 02, 2014, 05:06:44 PM
Something like #!/bin/bash
if [! -f /etc/board_ID]; then echo $RANDOM > /etc/board_ID; echo -n "Hi! I'm board with identifier "; cat /etc/board_ID; fi
or the second line only in /etc/rc.local

This will make a file with a random number at first boot and will send to you "Hi! I'm board with identifier ###". You may save its number.

BTW you can configure DHCP to assign uniform IP based on MAC address.
Title: Re: Serial number or any unique identifier
Post by: N8body on April 03, 2014, 11:11:08 AM
According to
http://dl.linux-sunxi.org/A20/A20%20User%20Manual%202013-03-22.pdf
(Page : 237)
There is a Security Key which can be programmed.
There are some information here :
http://linux-sunxi.org/SID_Register_Guide

If you use a SDCard,you can just use the Serial Number of it:
http://blog.bones-embedded.ch/read-sd-card-serial-number-from-cid/
Title: Re: Serial number or any unique identifier
Post by: dave-at-axon on April 03, 2014, 05:32:20 PM
Quote from: N8body on April 03, 2014, 11:11:08 AM
There is a Security Key which can be programmed.

That is the issue that the original poster already indicated. He does not want to have to programme each device before use. He needs a unique number on the device without having to programme each device prior to using it.

I think his only option is to have something like the Maxim part I described.