miguelgrinberg/microdot

Memory Error in a basic hello world setup

NovaProtocol opened this issue · 1 comments

Describe the bug
Importing the microdot.py hits a memory error even with a one line code.

To Reproduce
Steps to reproduce the behavior:

  1. Copy the code from the microdot.py to the esp8266
  2. Make a boot.py to connect to the internet
  3. Put import microdot in main.py

Expected behavior
Nothing should happen or at least it shouldn't hit a memory error in a one-line code in the main.py

Additional context
Traceback:

Traceback (most recent call last):
  File "main.py", line 1, in <module>
MemoryError: 

I'm still new to Microdot so any info would be greatly appreciated.

Ngl, I'm not sure what I'm doing. I just followed a guide that said that I should download microdot.py and push it to esp8266 and use the boot.py and main.y that they provided. I tested the boot.py and it's not causing the issue and only happens once I imported microdot

Update: This is the same as #148 issue. Threading doesn't exists for micropython

@NovaProtocol It isn't really possible for me to diagnose memory problems in your board. As I explained in other tickets, the MicroPython compiler uses a lot of RAM, especially for larger files such as microdot.py. I have not investigated this, but my impression is that recent MicroPython versions have increased memory usage during compilation, and for that reason more people are finding issues now than before. Obviously this is compounded by the fact that microdot.py also grows in size, by no means I'm blaming everybody else but me here.

For the smaller boards it is better to pre-compile this file on your computer and upload the microdot.mpy file instead. This eliminates the need for the compiler to run when the file is imported.