Assigning a node ID to a JeeNode without coding it
I really am a complete novice at this sort of thing, but a few days after receiving my two JeeNodes, I’ve got them talking together and reporting the temperature wirelessly. Simple stuff, I know, but I’m learning a lot. I’d like to add 3 or 4 more JeeNodes, but I’m trying to figure out a way of assigning different node IDs to each of them for the RF12 module, without having to code it into the sketch. Is there some way I can use jumpers on the board to assign a node ID? I’ve done quite a bit of searching, but maybe I’m using the wrong terminology.
There is space in the EEPROM to store a per device ID - if you look through RF12Demo, there is similar storage/retrieval of initial parameters for the radio module.
At first glance, there is not a direct way to jumper an ID for several nodes - it consumes too many I/O pins to link them either HIGH or LO and create say a 4 bit I.D.
You could use an ADC trick for this - it would only use up one AIO pin connected at the center of a voltage divider from Vcc to GND. Set the ADC to compare against Vcc and program the I.D. as the resistor ratio - the number of I.D. bits available will just depend on the resistor tolerances.
Might be a good excuse to investigate the ADC world ;-)
There is an experimental version of RF12Demo which can allocate node numbers via the radio link. It depends on your node topology, the experimental version assumes a star network with RF12Demo at the centre. https://github.com/jcw/jeelib/tree/RF12Demo
The simpler answer to your question:
> I’m trying to figure out a way of assigning different node IDs to each of them for the RF12 module, without having to code it into the sketch.
Is to use any version of RF12Demo to initialise the eeprom contents and then load your custom sketch which must then use a call to rf12_config() within your sketch to set up the radio using the eeprom contents to configure the radio details.