EmbeddedRelated.com
Forums

How to manage serial numbers

Started by Unknown April 10, 2014
In article <7x7g6x56na.fsf@ruckus.brouhaha.com>, no.email@nospam.invalid 
says...
> > David Brown <david.brown@hesbynett.no> writes: > > That was my first thought. If you think it is hard to generate a > > sequence of unique serial numbers, you really are in the wrong > > business. > > Depending on the requirements, it can be harder than it sounds. > Client/server is one approach, but do you really want to have to stop > your manufacturing line just because an internet connection went down? > Even if the internet stays up, does its very presence mean you have to > deal with a bunch of resulting potential security issues? Do you really > want to sign up to keep administering that database across the entire > production life of the product, that might be decades, just for the sake > of keeping the serial numbers sequential? Etc. etc.
Whats more useful is to have method barcode or embedded RFID for tracking batch runs (Yeild of batch, rev status, part date codes used etc). But make this in some way totally local to production even to extent of rolls of preprinted barcodes, or similar. That can be later uploaded if needed as a batch process to some central database. Why does it matter that it is issued at what second of day. Pre allocate and document in batch is easier to maintain and administer A tracking ID does not have to be the final serial number, which depending on product, market and some regulatory details means at end of production you may have to REPEAT that serial number to put label on case, label on packing box, paperwork, pallet list, shipping manifest certificate of conformity....... How much you need a serial number or some form of tracking ID depends on your circumstances that only you know. If in different countries what is wrong with plant number, or country or destination market or even year of manufacture being in the serial number as well. -- Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.pcserviceselectronics.co.uk/pi/> Raspberry Pi Add-ons <http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font <http://www.badweb.org.uk/> For those web sites you hate
Op Thu, 10 Apr 2014 17:29:20 +0200 schreef <pozzugno@gmail.com>:
> I have to ship products with a different 32-bits serial number > saved in a non-volatile memory (actually it's the internal EEPROM > of AVR microcontrollers). Of course, I have to be sure to avoid > two identical numbers in different devices.
http://www.rpmsys.com/avr_programmer.htm -- (Remove the obvious prefix to reply privately.) Gemaakt met Opera's e-mailprogramma: http://www.opera.com/mail/
> >Any ideas? >
If you are using some form of Ethernet, how about a system using or based on the MAC address? --------------------------------------- Posted through http://www.EmbeddedRelated.com
Robert Wessel <robertwessel2@yahoo.com> wrote:
> Of course, that only produces unique IDs. As others have mentioned, > we don't know all of the OPs requirements.
Simples: unsigned int seed=0xDEADBEEF; /* your secret here */ srand(seed); for (each request) printf("ID = %x\n", rand()); There will be no apparent ordering in the IDs. You may wish to pay close attention to your system's rand() implementation to check it's 32 bits long and has a 2^32 bit sequence length. To be safe you probably want to import a known-good 32 bit PRNG implementation. Theo
Theo Markettos <theom+news@chiark.greenend.org.uk> writes:
> for (each request) > printf("ID = %x\n", rand()); > ... pay close attention to your system's rand() implementation to > check it's 32 bits long and has a 2^32 bit sequence length.
If you generate perfectly random 32-bit numbers you should expect to see duplicates after around 64k, due to the birthday paradox.
> If you are using some form of Ethernet, how about a system using or based > on the MAC address?
This reminds me of a method once suggested for generating those addresses. Use the serial number from a dollar bill, and tape it into the cabinet. Of course, in those days, MAC interfaces were large and expensive, so $1 per SN wasn't unreasonable. - mac the na&iuml;f
Il 10/04/2014 17:38, Uwe Bonnes ha scritto:
> pozzugno@gmail.com wrote: >> I don't know where to post this question, maybe here someone >> has faced the same problem in the past and could give me some >> good ideas. > >> I have to ship products with a different 32-bits serial number >> saved in a non-volatile memory (actually it's the internal EEPROM >> of AVR microcontrollers). Of course, I have to be sure to avoid >> two identical numbers in different devices. > > What about buying One-Wire ID Chips or other parts with a unique ID? >
Unfortunately my board is already designed and is in production. Anyway they are a very low-cost products, so I prefer to use PC to generate unique serial numbers instead of adding cost to the board.
Il 10/04/2014 17:48, Tim Wescott ha scritto:
> If you don't have the board designed yet, then go shopping for a > microprocessor or a chip that comes serialized. If you do already have > the board designed, double-check that your chip doesn't already do that > (Some do. I don't pay attention to the AVR line these days, so I have no > clue if you can reasonably expert yours to).
Actually I'm using ATmega32A, ATmega168A and ATtiny4313. It seems they aren't serialized.
> If you're ordering your microprocessors already programmed from the > distributor, inquire about getting them with some specific location in > memory already programmed. If they say "yes", I'd do a bit more vetting > -- I'd ask them for names of at least three satisfied customers and then > I'd ask those places how they like the service.
I already purchased microcontrollers... anyway I don't think the distributor/manufacturer would have offered this kind of service for me.
> If your board comes with a serial number, use that for the serial number > in the chip.
Yes, the product will have the serial number that is the same I need to generate with this system and save in the non volatile memory.
> Totally useless to you, but this could be a small cloud business -- make > the server side application so that it works for any number of user > accounts, then sell users unique serial numbers.
Good idea!
Il 10/04/2014 19:09, Paul Rubin ha scritto:
> pozzugno@gmail.com writes: >> I have to ship products with a different 32-bits serial number... >> I was thinking to a server-side application that is responsible.. > > This is traditionally a pain in the neck to get right. Do the serial > numbers actually have to be serial (i.e. sequential rather than possibly > having gaps)?
The sequence could have gaps, but I don't think it's important.
> Do they have to be 32 bits?
Yes.
> How disastrous is it if two > devices somehow end up with the same serial number?
They are automatically recognized on a RS485 bus thanks to unique numbers. If two devices have the same serial number and they are on the same bus, the master will not be able to find them and work with them. > How long will the
> device be in production,
I don't know, I hope 20 years :-)
> how many are you going to make,
1000pcs/month or 10000pcs/month or ....
> will you > manufacture them at multiple locations,
No, I don't think so.
> etc.? You have to make sure > every possible production facility stays in sync.
I can use the same server on Internet that distribute unique numbers to multiple facilities.
> There are many examples of supposedly unique ID's like hardware MAC > addresses or evey cryptographic keys ending up with duplicates, due to > various sorts of process failures.
I imagine.
> If your application can stand it, IMHO the simplest thing to do is > assign a completely random 128 bit device ID to each device. You'd use > one of the the cryptographic random number generators included in some > OS's (/dev/urandom for linux, CryptGenRandom for windows). If your > random ID's are B bits long and there are N devices, the probability > that some two devices got the same ID is approx. N**2/2**B. So if there > are a billion devices and 128 bit ID's, that's about 2**60/2**128 or > 2**-68 or about 3e-21, if I got that right. That's low enough to be > negligible. Now you don't have to worry about parallel manufacturing, > maintaining or replicating counter state across production runs, etc. > Life is good.
Yes, this could be a good solution. The drawback is I will lost a central database filled with all the serial numbers and info about the device.
> You can also do stuff like include a 32 bit timestamp and a > manufacturing equipment ID, but don't rely completely on those since > it's easy for clocks to be set wrong, and the manufacturing equipment ID > to have a uniqueness failure. >
On Fri, 11 Apr 2014 12:56:21 -0500, "antedeluvian"
<63015@embeddedrelated> wrote:

>> >>Any ideas? >> >If you are using some form of Ethernet, how about a system using or based >on the MAC address?
Manufacturer assigned MAC addresses are *not* guaranteed to be unique ... they really only are a best effort. Moreover, many (most?) chips allow the MAC address to be changed by software. Multiport NICs frequently ship with all the ports set identically and the software _must_ change them or network fabric will be driven crazy. Becomes interesting when you have many such NICs in the same network. George