khoih-prog / WiFiWebServer

This is simple yet complete WebServer library for AVR, Portenta_H7, Teensy, SAM DUE, SAMD, STM32, RP2040-based, etc. boards running WiFi modules/shields (WiFiNINA, CYW43439, U-Blox W101, W102, etc.). The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Now using WiFiMulti_Generic library
MIT License
104 stars 21 forks source link

when webrequest is done , ESP32 crashes #18

Closed Ronald1817 closed 2 years ago

Ronald1817 commented 2 years ago

Describe the bug

Used example code for WifiServer on ESP32 , Heltec WIFI kit 32. When visited by browser, the handleRoot function crashes, i see a reboot in the serial monitor on platformio

A clear and concise description of what the bug is.

ESP32 crash when going to visit IP adres in my case 192.168.50.77. I

Steps to Reproduce

Visit from webbrowser the ip adres and ESP32 crashes, when closing browser it keeps running.

Steps to reproduce the behavior. Including the MRE sketches

Expected behavior

servicing of html request.

A clear and concise description of what you expected to happen.

functional servng of HTML code.

Actual behavior

A clear and concise description of what you expected to happen.

Debug and AT-command log (if applicable)

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Information

Please ensure to specify the following:

Example

My setup

Platformio V.2.5.0 framework-arduinoespressif32 @ 3.20003.220626 (2.0.3)


Context:
I encountered an endless loop while trying to connect to Local WiFi.

Steps to reproduce:
1. ...
2. ...
3. ...
4. ...

Additional context

Add any other context about the problem here. main code ESP32 webserver and mqtt.txt main code ESP32 webserver and mqtt.txt

Added maim.cpp that i use , it's a project for mqtt which works and wanted to add webserver also.

khoih-prog commented 2 years ago

Hi @Ronald1817

Try the original WebServer example first on regular or other ESP32_DEV board and Arduino IDE v1.8.19, ESP32 core v2.0.4, to see if there is any issue.

If no, the problem is is your combined code, not this library. Ask for help in Arduino / ESP32 / PIO Forum if the problem persists and you can't solve.

Moving on to PIO, etc. after you're sure your combined code is OK with Arduino IDE, etc.

I'm closing the issue now, and won't reopen until a library's bug is proven by a Minimal, Reproducible Example

Good Luck,

Ronald1817 commented 2 years ago

Hi,

Thanx for your answer,

I am building a clean project but keep getting this:

Member funciton problem and a constant ,

I copied the code and wire.h must be included foro digitalwrite but the errors in above code i can not solve

I am in learning curve fort his.

Regards,

Ronald.

Van: Khoi Hoang @.> Verzonden: vrijdag 22 juli 2022 14:58 Aan: khoih-prog/WiFiWebServer @.> CC: Ronald1817 @.>; Mention @.> Onderwerp: Re: [khoih-prog/WiFiWebServer] when webrequest is done , ESP32 crashes (Issue #18)

Hi @Ronald1817 https://github.com/Ronald1817

Try the original https://github.com/khoih-prog/WiFiWebServer/tree/master/examples/WebServer WebServer example first on regular or other ESP32_DEV board and Arduino IDE v1.8.19, ESP32 core v2.0.4, to see if there is any issue.

If no, the problem is is your combined code, not this library. Ask for help in Arduino / ESP32 / PIO Forum if the problem persists and you can't solve.

Moving on to PIO, etc. after you're sure your combined code is OK with Arduino IDE, etc.

I'm closing the issue now, and won't reopen until a library's bug is proven by a https://stackoverflow.com/help/minimal-reproducible-example Minimal, Reproducible Example

Good Luck,

— Reply to this email directly, view it on GitHub https://github.com/khoih-prog/WiFiWebServer/issues/18#issuecomment-1192546813 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AMTJQPOXU7TPOGRBQPY7BR3VVKLF3ANCNFSM54LC43JQ . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AMTJQPP3ZQGWQSDM3VV3R5TVVKLF3A5CNFSM54LC43J2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOI4KND7I.gif Message ID: @. @.> >

Ronald1817 commented 2 years ago

Hi,

thanx for yoyr reply. i will try the original project.

Ronald1817 commented 2 years ago

Hi,

I want to confirm that when loaded in Arduino IDE 1.8.19 and ESP32 core 2.0.4 it works! I did not get compiler error that member funtion was not present , it compiled and when i go to the webbrowser i get the graph like the one in the example screenshot. The conclusion of this is that platformio is not compatible , the examples where written in Arduino IDE , what is your IDE ? is that alway Arduino IDE or do you use VSC + platformio also?

I am glad that it works. I will now combine my code and see is that works , i will let you know.

khoih-prog commented 2 years ago

Hi @Ronald1817

It's good to know you're doing OK now.

The conclusion of this is that platformio is not compatible

IMO, PIO is not totally mature yet, and must require more knowledge and skills to manually configure / modify the settings of PIO as well as related libraries, or receiving compiler errors. This currently is the price you have to pay for better debugging environment, if necessary or a must.

We're still waiting the days PIO can compile as easily as Arduino IDE, without changing anything internally to the libraries' settings.

You can contribute to PIO by posting an issue in PIO Forum and make that day closer.

It'll be beneficial if you'd post the link here after having created the PIO Forum issue.

Ronald1817 commented 2 years ago

Hi,

Thanx for your answer.

I will indeed make a contribution to the PIO forum and maybe it wil be solved.

I wil make use of the Arduino IDE fort his project and wil work in reverse

So i will ad my code tot he project in the Arduino IDE and i tink it wil work then.

Regards,

Ronald Hofman.

Van: Khoi Hoang @.> Verzonden: dinsdag 26 juli 2022 18:08 Aan: khoih-prog/WiFiWebServer @.> CC: Ronald1817 @.>; Mention @.> Onderwerp: Re: [khoih-prog/WiFiWebServer] when webrequest is done , ESP32 crashes (Issue #18)

Hi @Ronald1817 https://github.com/Ronald1817

It's good to know you're doing OK now.

The conclusion of this is that platformio is not compatible

IMO, PIO is not totally mature yet, and must require more knowledge and skills to manually configure / modify the settings of PIO as well as related libraries, or receiving compiler errors. This currently is the price you have to pay for better debugging environment, if necessary or a must.

We're still waiting the days PIO can compile as easily as Arduino IDE, without changing anything internally to the libraries' settings.

You can contribute to PIO by posting an issue in PIO Forum and make that day closer.

It'll be beneficial if you'd post the link here after having created the PIO Forum issue.

— Reply to this email directly, view it on GitHub https://github.com/khoih-prog/WiFiWebServer/issues/18#issuecomment-1195682334 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AMTJQPIUBWYSZPRLGCQVN4TVWAEPJANCNFSM54LC43JQ . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AMTJQPJFQHDPSI4SKGHID5LVWAEPJA5CNFSM54LC43J2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOI5CKUHQ.gif Message ID: @. @.> >

Ronald1817 commented 2 years ago

Hi,

First i want to inform that the ESP32 webserver runs for days now.

I created a topic on platfformio with the following link.

https://community.platformio.org/t/webserver-esp32-fails-and-in-arduino-ide-it-works/28969

I hope that someone wil try it.

For now i stick with the Arduino IDE because it;s clear that there are compatibility issue’s.

It’s a pitty that Arduino IDe has little debug capabilities.

Met vriendelijke groet,

Ronald Hofman.

Van: Khoi Hoang @.> Verzonden: dinsdag 26 juli 2022 18:08 Aan: khoih-prog/WiFiWebServer @.> CC: Ronald1817 @.>; Mention @.> Onderwerp: Re: [khoih-prog/WiFiWebServer] when webrequest is done , ESP32 crashes (Issue #18)

Hi @Ronald1817 https://github.com/Ronald1817

It's good to know you're doing OK now.

The conclusion of this is that platformio is not compatible

IMO, PIO is not totally mature yet, and must require more knowledge and skills to manually configure / modify the settings of PIO as well as related libraries, or receiving compiler errors. This currently is the price you have to pay for better debugging environment, if necessary or a must.

We're still waiting the days PIO can compile as easily as Arduino IDE, without changing anything internally to the libraries' settings.

You can contribute to PIO by posting an issue in PIO Forum and make that day closer.

It'll be beneficial if you'd post the link here after having created the PIO Forum issue.

— Reply to this email directly, view it on GitHub https://github.com/khoih-prog/WiFiWebServer/issues/18#issuecomment-1195682334 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AMTJQPIUBWYSZPRLGCQVN4TVWAEPJANCNFSM54LC43JQ . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AMTJQPJFQHDPSI4SKGHID5LVWAEPJA5CNFSM54LC43J2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOI5CKUHQ.gif Message ID: @. @.> >

khoih-prog commented 2 years ago

It’s a pitty that Arduino IDe has little debug capabilities.

You can have more debugging messages in Arduino IDE, when necessary, by modifying to use max _WIFI_LOGLEVEL_ in defines.h, such as

#define _WIFI_LOGLEVEL_             4

from these lines

https://github.com/khoih-prog/WiFiWebServer/blob/d7048a2814c9a07139c5ed3f7edd8c722e052299/examples/WebServer/defines.h#L17-L19