Open kenjican opened 11 months ago
Is this still the case after the recent commits?
- Python pkg MicroWebSrv2 -
- version 2.0.6 -
- by JC`zic & HC2 -
---------------------------
Same here. Breaking commit is 2f1e982cad28be776d124bfeaae34e01f82fe177. The server starts and hangs on MWS2-INFO> Starts the managed pool to wait for I/O events.
When I try to open a webpage the curl/browser
hangs and also the webserver hangs. If I try to stop it with CTRL+C it doesn't responds for about 30 seconds before the key presses get registered and the server stops
Micropython versions tested: 1.22.2 and all in between the latest master ESP-IDF versions tested: latest 5.1 and 5.2
Hello and thank you for your feedback. can you try to start the server with : StartManaged(0) or StartManaged(2) ?
With StartManaged(2) the server hangs and even CTRL+C does not work With StartManaged(0) I am able to halt the server with CTRL+C. Once I was able to download the index.html, but even then the server responded about 20 seconds later and then hanged again.
Here is the output when I stop it with CTRL+C
MWS2-INFO> Server listening on 0.0.0.0:80. MWS2-INFO> Starts the managed pool to wait for I/O events.
hit 5-10 times CTRL+C
MWS2-INFO> Server 0.0.0.0:80 closed. MWS2-INFO> Stops the managed pool. Traceback (most recent call last): ... File "MicroWebSrv2/microWebSrv2.py", line 222, in StartManaged File "MicroWebSrv2/microWebSrv2.py", line 238, in Stop File "MicroWebSrv2/libs/XAsyncSockets.py", line 270, in StopWaitEvents KeyboardInterrupt: MicroPython v1.23.0-preview.233.gafeba9050 on 2024-03-15;
I'd like to help you debug it, but I do not know where to start.
Same problem here. Server starts but cannot get to any routes. (1.22.0 here too)
update: I rolled back to 1.20 Micropython and 2.0.6 of MicroWebSrv2 and I am now able to get responses from the webserver.
Not that I am running this on an ESP32-Wroom in embedded mode. So I can confirm what @ekondayan was saying about the commit breaking things.
I've been testing the latest commit (4a7f59938a83802d08d154774befea73a644b99e) - it is still not working reliably but this time with a twist.
This time I am able to get the index.html a few times in a row(using curl
) but then the server stops serving again. I wasn't able to get a complete webpage using a regular browser - index.html, CSS and two JS files( 420KB in total ). The difference now is that I can get at least one index.html served but the server blocks for the rest of the page assets. I also noted that in this blocked state, the server is handling the websocket messages correctly.
If you give me a modified XAsyncSockets.py, stuffed with debug print
statements, I can send you the output.
Hmm, thank you @ekondayan. Strange indeed. And how do you start the server at the beginning? I use it on big projects with TLS/SSL (on Azure cloud) and it still works. I launch it with 5 parallel processes. Do you use it in embedded mode or on a normal server (linux or other)?
mws2 = MicroWebSrv2()
mws2.RootPath = '/www'
mws2.SetEmbeddedConfig() # For embedded MicroPython, use a very light configuration,
mws2.DisableSSL()
mws2.NotFoundURL = '/' # All pages not found will be redirected to the home '/',
mws2.StartManaged()
My environment is:
I've tested the latest commit and it still does not work on esp32 with micropython
Are there any updates regarding compatibility in the meantime? i'm currently using MicroPython 1.24 on an ESP32-S3-DevKitC1U-N8R8 and it doesn't work here.
MWS2-INFO> Server listening on 0.0.0.0:80. MWS2-INFO> Starts the managed pool to wait for I/O events. MWS2-INFO> Server 0.0.0.0:80 closed. MWS2-INFO> Stops the managed pool.
Anyone bump into this problem also?