microwebsrv2 : not enought memory !

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
JacquesC
Posts: 16
Joined: Sun Feb 17, 2019 5:04 am

microwebsrv2 : not enought memory !

Post by JacquesC » Mon Feb 01, 2021 7:13 am

Hello,
I am a teacher and I have an automatism project with students
I have to run the web server and the management of the model in parallel.
Before I was using version 1 of microwebsrv (thanks JC BOS ;-) but as I have to manage in parallel the running of the model, I prefer use the version 2.
I'm using an ESP32 WROOM but I still get the same error message:
---------------------------
- Python pkg MicroWebSrv2 -
- version 2.0.6 -
- by JC`zic & HC2 -
---------------------------

Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "MicroWebSrv2/__init__.py", line 18, in <module>
File "MicroWebSrv2/microWebSrv2.py", line 8, in <module>
File "MicroWebSrv2/httpRequest.py", line 8, in <module>
MemoryError: memory allocation failed, allocating 444 bytes
>>>
Has anyone managed to run it on this ESP32 or is it necessary to use an ESP32 WROVER?
Thank you
Jacques C.

Divergentti
Posts: 67
Joined: Fri Sep 04, 2020 9:27 am
Location: Hanko, Finland
Contact:

Re: microwebsrv2 : not enought memory !

Post by Divergentti » Mon Feb 01, 2021 11:07 am

I don't have experience of that module, but I have hit to same problem with other classes.

Have you tried gc.collect() prior to code execution?

PythonKai
Posts: 4
Joined: Sun Jan 31, 2021 4:08 pm
Location: Bavaria Germany

Re: microwebsrv2 : not enought memory !

Post by PythonKai » Mon Feb 01, 2021 12:06 pm

Hello Jacques,

I have the same problem and unfortunaty I couldn't solve it.
For my project I use the first version of MicroWebServer and works very well.

Kai

VladVons
Posts: 60
Joined: Sun Feb 12, 2017 6:49 pm
Location: Ukraine

Re: microwebsrv2 : not enought memory !

Post by VladVons » Mon Feb 01, 2021 2:16 pm

indeed microwebsrv2 is not a micro.
it has over 4000 lines of source code.
on esp32 should work, but memory info needed to say something.

perhapse your download file is too big to fit in memory and server loads it into memory instead of splitting into portions of streaming.

Memory usage:
import gc
gc.collect()
print("free", gc.mem_free())
print("alloc", gc.mem_alloc())

Device type:
import sys
print("platform", sys.platform)

Post Reply