Giter Site home page Giter Site logo

Comments (8)

me-no-dev avatar me-no-dev commented on June 23, 2024

that is caused by SPIFFS being filled and needing to wipe blocks in order to fit the new file.
when it hits that point, the process of rearranging and wiping blocks takes enough to trigger the watchdog and reset the sketch. In the regular web server you are running from the loop and the process yields, in async there is no such thing :)
if you upload a clean SPIFFS image to the flash, you will find the upload working fine (till you fill it up again by writing to it)

from espasyncwebserver.

vitotai avatar vitotai commented on June 23, 2024

Thank you for your response.

I've tried to isolate the issue and used the following empty handleUpload() to test.
ESP8266 will hang or stop when the index went over 200,000.
There is no useful output but a strange string "$T0b#e6".
I am trying to make GDBSTUB work, so I have no idea what's going on.

void handleUpload(AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final)
{
    if(!index){ // initial start
        if(!_username.length() || request->authenticate(_username.c_str(),_password.c_str()))
            _uploadAuthenticated = true;

        WiFiUDP::stopAll();
        DEBUGF("Update: %s size:%d\n", filename.c_str());

    }
    if(_uploadAuthenticated && len){
//        ESP.wdtDisable(); request->_tempFile.write(data,len); ESP.wdtEnable(10);
        DEBUGF("Update:%d - %d\n",index,len);
    }
    if(_uploadAuthenticated && final){
        DEBUGF("Update End.\n");
    }
}

from espasyncwebserver.

me-no-dev avatar me-no-dev commented on June 23, 2024

I'll give this exact code a go. Why do you stop UDP?

from espasyncwebserver.

me-no-dev avatar me-no-dev commented on June 23, 2024

ok I can confirm some sort of issue
depending on the file, the upload hangs at the exact same progress for each file. Hmmmm

from espasyncwebserver.

vitotai avatar vitotai commented on June 23, 2024

I was trying to port ESP8266HTTPUpdateServer and had this issue.
The code is copied from that porting. I wanted to make it clear so delete the commented-out code.

from espasyncwebserver.

me-no-dev avatar me-no-dev commented on June 23, 2024

I'll figure it out :) interesting thing is that it was working fine for a long time and nothing related has changed recently...

from espasyncwebserver.

me-no-dev avatar me-no-dev commented on June 23, 2024

please try the latest git :)

from espasyncwebserver.

vitotai avatar vitotai commented on June 23, 2024

It's working perfectly now.
Thank you for your effort to create such a wonderful library.

from espasyncwebserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.