Memory issue with Blynk

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
Posts: 4
Joined: Tue Jan 07, 2020 11:15 am

Memory issue with Blynk

Post by mybigman » Tue Jan 07, 2020 11:32 am

Hi Guys,

I am using Wemos D1 mini pro with latest MP flashed to it and have been playing around with different examples and am really enjoying tinkering again as python makes it alot easier then using C/C++.

I wanted to try out the blynk library from the offical repo, however as soon as I import it I get a memory error :/

Code: Select all

from libs import blynklib_mp as BlynkLib

# serial
MemoryError: memory allocation failed, allocating 138 bytes
I assume its over the memory limit based on the error and that's the only thing I am importing other than the initial wifi setup.

I have had more item imported than this at once such as mqtt, weather api, dictionary parser and it hasn't been an issue.

Is there something I can do other than compile the library into the framework?


User avatar
Posts: 2262
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: Memory issue with Blynk

Post by jimmo » Wed Jan 08, 2020 12:41 am is quite a large piece of code, which the ESP8266 has to both load and compile. You might find more success to pre-compile it into a .mpy file and use that instead.

Here's a .mpy version of blynklib_mp -- ... p.mpy?dl=0 (Make sure you remove the .py file from your ESP first otherwise it'll use that instead).

Even better would be to freeze it into the firmware, but that will require building your own MicroPython firmware, but it will save a lot more RAM.

Posts: 4
Joined: Tue Jan 07, 2020 11:15 am

Re: Memory issue with Blynk

Post by mybigman » Wed Jan 08, 2020 10:22 am

thanks... appreciate it.

Posts: 30
Joined: Sun Jan 14, 2018 3:54 pm

Re: Memory issue with Blynk

Post by wr300000 » Mon Jul 13, 2020 2:30 am

Hello Jimmo,
May I have source code of that used for producing blynlib.mpy for further education ?

Post Reply