Hi guys,
I am trying to come up with a workflow for basic node registration. I'm trying to avoid using the same hard-coded encryption key for all nodes as well as a hard-coding network id and node id for each new node. So, I figured a node registration workflow would be a good fit.
Has anyone tackled this problem with these devices (or other RF devices)? I'm wanting to keep it fairly simple, maintain encryption at all times, and basically have a home server that assigns the node/network id once the node (client) is registered. Kind of like DHCP I think...
I think I'm going to have to do some combination of
1) The client is not registered, so try to send a registration command to a known (hard-coded) server id on known network ids (I don't think there's a mode that allows you to listen on all networks right?).
- The registration command would send a serial #, I think it's OK for duplicate Node ID's at this point since the server will interpret it as a registration command.
- I'm not sure if we can encrypt this message though... Don't think so.
2) Server recognizes registration command and assigns a node and network ID (server will need to associate serial # to node/network id). It then transmits the node/network id to the client.
3) Client saves node/network id to EEPROM, and then generates encryption key. The algorithm will have to be shared between both client and server. I'm extremely fuzzy on this part... is there some way to share a key between client and server? I don't think asymmetric encryption will work here if I use the hardware encryption.
4) Client resets.. reads the network/node id from EEPROM, and initializes the library.
5) Client sends data, but no longer needs to transmit the serial # since it has an encryption key + assigned network/node id.
Any thoughts are welcome. Thanks!
I know there are others out there. TomWS from this forum has given some details. You will need to search, im on my phone and don't want to search.
All of my nodes eeproms are programmed with the a new node id (250-254) as well as encryption key and node type, sensor address,..... The main running program is then installed. Once the node is powered on it will broadcast (id:255) and have my gateways pick up on that. They send back the sender RSSI. The node selects the strongest signal and assigns that as its gateway. The node then sends a packet with the eeprom unique id and other important info to register the node. The gateway then assigsn an id as well as other info (update interval, ....)
Thanks for the quick reply. I like the gateway assignment technique you listed. I've looked around, and the general feeling I get is to get a prototype up first, and assume that for production you'll need to handle the "ilities".
I saw a post about a "session key" that seemed like a decent solution for rotating encryption keys. Should anyone be interested in my project, I have it up on github. Thanks!