I am tearing my hair out with a silly problem.
I have a NodeMCU ESP8266 connected to a 3231 RTC module. Most of the time, everything is fine, and when the system powers up the RTC is read without problem.
But, just occasionally, the system comes up but can't find the RTC - at least, it says that no RTC is connected. I can reboot, remove power, remove RTC module etc but the problem remains... and then it doesn't - everything works again. And continues to work when I reboot the system, power cycle etc.
There is no logic to this - I can recompile and reload the program and all is fine. Or I can reload the program and the problem occurs. Sometimes, if I remove the RTC, replace it and reboot, things work, but not every time.
I thought it might be something to do with timing, but the first thing the program does is to initialise the serial port with a 500mS delay, then starts Wire with another 500mS delay, so there is plenty of time for the I2C to get going.
Before posting a load of code, I'm wondering if anyone has come across similar problems and maybe has a solution?