MicroWebSrv2 icon indicating copy to clipboard operation
MicroWebSrv2 copied to clipboard

"Not Enough Memory" at startup on Raspberry-Pi Pico

Open mchobby opened this issue 2 years ago • 4 comments

Hi, Just for your information. I did install MWS2 on a Raspberry-Pi Pico and getting Memory issue when starting the main.py example. This error is always happening almost every time (the other time, it starts). I will have a look to the previous version.

Additional information:

  • I'm running last nightly build of MicroPython (currently 1.19.1 205)
  • Free Mem @ startup : 153296 bytes
  • Free Mem after error : 52544 bytes
  • Running gc.collect() hangs everything

Here the error:

>>> import main_test

       ---------------------------
       - Python pkg MicroWebSrv2 -
       -      version 2.0.6      -
       -     by JC`zic & HC2     -
       ---------------------------

 + [@WebRoute] GET /test-redir
 + [@WebRoute] GET /test-post (TestPost1/2)
 + [@WebRoute] POST /test-post (TestPost2/2)

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.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "main_test.py", line 170, in <module>
  File "/lib/MicroWebSrv2/microWebSrv2.py", line 223, in StartManaged
  File "/lib/MicroWebSrv2/microWebSrv2.py", line 220, in StartManaged
MicroWebSrv2Exception: Not enough memory to start 1 parallel processes.

mchobby avatar Jul 26 '22 08:07 mchobby

Just work pretty well with the MWS version 1 available at https://github.com/jczic/MicroWebSrv

mchobby avatar Jul 26 '22 09:07 mchobby

Build it as a module in your own micropython firmware then only it may work

krishnak avatar Aug 30 '22 09:08 krishnak

In my experience, uPy is a memory hog. I've had to either compile frozen modules (include in custom firmware) or use the mpy-cross tool to make .mpy files. https://forum.micropython.org/viewtopic.php?t=4510

BetterAutomations avatar Sep 10 '22 17:09 BetterAutomations

@BetterAutomations 👍🏻 That's right.

jczic avatar Sep 10 '22 22:09 jczic