Esp8266 throwing MemoryError:

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
kkumar326
Posts: 16
Joined: Wed Nov 15, 2017 5:30 am

Esp8266 throwing MemoryError:

Post by kkumar326 » Wed Nov 22, 2017 5:19 pm

I'm working on nodemcu. I've created main.py file which gets executed automatically. Now, when I'm running the device, it is throwing this error - MemoryError:

It is not running a single thing on main.py. It is throwing error directly.
I commented the whole code and I'm still getting this error. So, it's not associated with variable size or import package size.

Filesize of main.py is 18kb which seems to be the problem according to me.

Please let me know how should I get around it?

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: Esp8266 throwing MemoryError:

Post by SpotlightKid » Wed Nov 22, 2017 8:14 pm

* Separate your code into smaller modules and import them from main.py.
* Precompile your modules with mpy-cross on your PC and only copy the .mpy files to your board.
* Use frozen modules.

http://docs.micropython.org/en/latest/e ... ash-memory

kkumar326
Posts: 16
Joined: Wed Nov 15, 2017 5:30 am

Re: Esp8266 throwing MemoryError:

Post by kkumar326 » Tue Jan 02, 2018 11:51 am

SpotlightKid wrote:
Wed Nov 22, 2017 8:14 pm
* Separate your code into smaller modules and import them from main.py.
* Precompile your modules with mpy-cross on your PC and only copy the .mpy files to your board.
* Use frozen modules.

http://docs.micropython.org/en/latest/e ... ash-memory
I'm going to try .mpy file first. I couldn't try these as I had started working on the website. Thanks for these.

Post Reply