jczic / MicroWebSrv2

The last Micro Web Server for IoTs (MicroPython) or large servers (CPython), that supports WebSockets, routes, template engine and with really optimized architecture (mem allocations, async I/Os). Ready for ESP32, STM32 on Pyboard, Pycom's chipsets (WiPy, LoPy, ...). Robust, efficient and documented!
https://github.com/jczic/MicroWebSrv2
MIT License
662 stars 97 forks source link

Large js File on ESP32 #59

Closed ehtnevets closed 3 years ago

ehtnevets commented 3 years ago

I'm trying to use js files that are rather large (up to 200KB). On desktop computer, microWebSrv2 downloads the files to the browser fine and running. But on ESP32, it gets stuck. I think it's due to memory issue.

Can microWebSrv2 allocate memory in a smaller block and continue downloading blocks until all bytes sent?

ehtnevets commented 3 years ago

Well, somehow it's now working. I don't know how but I did replace all sleep with machine.idle in loops. I'm not sure if this has any effect on microWebSrv2 but it does on WLAN.isconnected loop. It makes connection so much reliable and faster on my case.