Using multiple external temp sensors with EmonTHv2 - eeprom gotcha

Thought I would just post my experience to save other people going round in circles. I am working on custom firmware with external temp sensors and my node address needs manually setting as it is outside the 23-26 range.

I made the mistake of having a test DS18B20 connected when saving my node address (in configuration mode). Of course, when I then connected my real set of 4 x DS18B20s and their breakout board the emonTH didn’t see any of them.

I hadn’t realised that saving the node address in the eeprom also saves all the connected temperature sensor addresses which then prevents any change in sensor hardware being recognised.

The only way to change the sensor configuration once saved is either erase the eeprom or manually program each individual sensor.

I would always - emonTH or emonTx - recommend storing the temperature sensor addresses, either in EEPROM or hard-coding them in the sketch, rather than allowing the software to find the sensors on each power-up. The reason for this is, if you don’t do this and a sensor fails and the remaining sensors are found by searching, the missing one will have it’s place filled by another, so they will probably not go back into the same ‘slots’, therefore at least some of the temperature inputs will need moving back into the correct feeds in emonCMS.

If you have saved the addresses, then you manually put the address of the new sensor into the slot occupied by the old, and everything is back as before.

(For anyone curious, the search algorithm is explained in ‘Learn’. Others have alleged the order sensors are found is random - it isn’t, but it’s not at all obvious what it is.)