This repository was archived by the owner on Jan 16, 2022. It is now read-only.

Description
Hi
when writing about 10k of data, the ESP8266 randomly resets (software watchdog). I tracked this down to the for loop "//wait up to 50ms for the write to complete" and changed it to this:
for (uint8_t i=50; i; --i) {
ESP.wdtFeed();
delay(1); //no point in waiting too fast
communication->beginTransmission(ctrlByte);
if (_nAddrBytes == 2) communication->write((byte)0); //high addr byte
communication->write((byte)0); //low addr byte
txStatus = communication->endTransmission();
if (txStatus == 0) break;
}
i read somewhere that the delaymicroseconds thing interferes with the ESP watchdog and so I changed it to delay(1), reduced the loop execution count to 50 and added ESP.wdtFeed();. so far no more resets happening.