Moteino - DHCP / Unique serial number / MAC

Started by daemach, September 29, 2014, 07:52:41 AM

daemach

I'm thinking about using a combination of megas and regular moteinos in a large monitoring network on a farm.  I would like to implement something like DHCP on a mega, to automatically assign nodeIDs.  How might something like that best be implemented?  It seems like library-level functionality.  I'm going to use these chips for the endpoints, which will guarantee unique "serial numbers":  http://www.atmel.com/Images/Atmel-8885-CryptoAuth-ATSHA204A-Datasheet.pdf  They are $.47 each in quantity and have some built-in crypto and eeprom functionality as well.

Felix

#1
You don't need to bother with those extra chips. The FLASH chips provided with Moteinos (actually optional addon at the moment since you can solder your own if you really want to) have unique 64 bit MACs on them. You could then implement a hash table handshake on the gateway which would pass out unique 1 byte IDs (unless you need more than 255 nodes) to the connecting slaves.

You can read the unique 64 bit number using the SPIFlash.readUniqueId() which returns a pointer to an 8 byte array.
https://github.com/LowPowerLab/SPIFlash

kiwisincebirth

Adding to what Felix stated, all Onewire devices have a 64 bit serial number, which can be read.