When we have need to deploy multiple nodes on the same application, it entails replicating same code and changing APPKEYs and DEVEUIs. This in my view limits the ability to scale without a certain level of expertise.
As a solution, we decided to write APPKEYs and DEVEUIs to the device EEPROM. And reading them out from there in the sketch. However in doing so I notice the EEPROM write commands eliminate the leading zero in any byte. So for example, 0x08, 0x09, 0x0F, 0x4F, 0x0C when written to EEPROM is read out as 0x8, 0x9, 0xF, 0x4F, 0xC.
I would appreciate any help getting the leading zeros retained.
Yes that is so. From your response, I figured it might not be the leading zero and tried with a DEVEUI which had no leading zeros. when keys are read from EEPROM the node is unable to join.
DEVEUI is declared as … static uint8_t DEVEUI[8];
I use this code to read them from EEPROM for ( int s = 0; s < 8; ++s ){ DEVEUI[s] = EEPROM.read(s); }