Git Product home page Git Product logo

Comments (9)

boblemaire avatar boblemaire commented on July 29, 2024 1

I've started a project that uses this on ESP32, so I'll be working through issues over the next month or so. Stay tuned for updates.

from asynchttprequest.

JarrettR avatar JarrettR commented on July 29, 2024

@MkLHX it seems to work (sort of) if you simply change all #include <ESPAsyncTCP.h> to #include <AsyncTCP.h> in all the library files. However, it seems to be causing heap poising after a few minutes of activity. Not yet investigated whether this is an issue with this repo, or AsyncTCP

from asynchttprequest.

boblemaire avatar boblemaire commented on July 29, 2024

from asynchttprequest.

MkLHX avatar MkLHX commented on July 29, 2024

@MkLHX it seems to work (sort of) if you simply change all #include <ESPAsyncTCP.h> to #include <AsyncTCP.h> in all the library files. However, it seems to be causing heap poising after a few minutes of activity. Not yet investigated whether this is an issue with this repo, or AsyncTCP

Hi @JarrettR, i tested this, but still crash my esp32 every time i call the lib's methods.

Since few hours, i fixed an other issue from arduino-esp32 sdkconfig file in platformio core.
The WiFi feature looks working better.
May have the time to try debug the lib with AsyncTCP instead of ESPAsyncTCP

from asynchttprequest.

rljonesau avatar rljonesau commented on July 29, 2024

I've been trying and finding that a core panic usually takes place within the IDF tcp code, and the stack back trace seems to suggest AsyncTCP may be to blame by using more closed slots than allowed after several client connects.
This is using an esp-prog in JTAG mode.

The (un-commented) printed debug info seems to suggest that the FIN handlers never get called despite FIN packets being present in the Wireshark trace.

Will be interesting to find others experiences.

from asynchttprequest.

rljonesau avatar rljonesau commented on July 29, 2024

Have made some progress with my core panics.

Firstly I have added some bounds checking to all the places in AsyncTCP tries to use _closed_slot as an array index, this prevents badness in several places there - but the cause still needs to be understood:

if(msg->closed_slot >= 16 || msg->closed_slot < -1) {
  Serial.printf("CLOSED SLOTS BOUNDS!! _tcp_recv_api (%d)\r\n", msg->closed_slot);
  return msg->err;
}
if(msg->closed_slot == -1 || !_closed_slots[msg->closed_slot]) {
    ... 

I then still had random failures where it looked like a race condition during the connect / send phases of asyncHTTPrequest causing core panics.
I solved that by altering the sample code to NOT call send() after open(), but hold that off until the request callback, adding a readyState = 1 condition:


void sendRequest(){
    if(request.readyState() == 0 || request.readyState() == 4){
        request.open("GET", "http://worldtimeapi.org/api/timezone/Europe/London.txt");
    }
}

void requestCB(void* optParm, asyncHTTPrequest* pRequest, int readyState){
    if(readyState == 4){  // response
        String JSONinfo(pRequest->responseText());
        Serial.println(JSONinfo);
        Serial.println();
    }
    if(readyState == 1) {  // connected
      pRequest->send();
    }
}

It has now ran for a good deal longer without issue, scraping a simple webpage for now.

The AsyncTCP closed slot issue is obviously not directly this library's fault, but needs to understood so it can be rectified. (eg: WTF is a closed slot anyway?)

from asynchttprequest.

boblemaire avatar boblemaire commented on July 29, 2024

I've started using asyncHTTPrequest in an ESP32 project. Now using the correct AsyncTCP library for ESP32 and have added a mutex semaphore to protect the data structures in multi-threaded operation. Seems to be working well now in my application (IoTaWatt). Have bumped version to 1.2.0 for ESP32 support. Assuming all will be fine with ESP8266 as nothing really changed there, but will update the ESP8266 version of IoTaWatt to use 1.2.0. Going to close this issue as most of this looks like it could be the thread corruption problem. Please file new issue if problems persist with this version.

from asynchttprequest.

thecodingfrog avatar thecodingfrog commented on July 29, 2024

Hi,
I keep getting an error :
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x400556d5 PS : 0x00060130 A0 : 0x8205273c A1 : 0x3fcebe30
A2 : 0x00000000 A3 : 0xfffffffc A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x3fcb7f50 A11 : 0x3c15c740 A12 : 0x00000004 A13 : 0x3fcb7f54
A14 : 0x20544547 A15 : 0x00000000 SAR : 0x00000018 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x400556d5 LEND : 0x400556e5 LCOUNT : 0xffffffff

Backtrace: 0x400556d2:0x3fcebe30 |<-CORRUPTED

from asynchttprequest.

boblemaire avatar boblemaire commented on July 29, 2024

I'm not supporting this for ESP32. You can get async HTTP by running any client in a FREErtos task. My esp32HTTPrequest works for me in that environment.

from asynchttprequest.

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.