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

crashes with ESP8266 when writing big amounts of data #19

@mamama1

Description

@mamama1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions