-->
Page 1 of 1

Running mqtt and net:server: I got an Out of Memory Error

PostPosted: Mon Apr 13, 2020 9:15 am
by Warthog
I want to contol an awning via esp8266. My first approach was to set up a net server an add 3 buttons for up/down/stop. That worked very well.
Now I want to add mqtt to this, but when I add the code for creating mqtt publish/subscribe LUA gives me an "Out of memory error":

load main
node heap=39112 --> (free heap before loading the lua file main.lus)
E:M 592
PANIC: unprotected error in call to Lua API (not enough memory)

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 28156, room 16
tail 12
chksum 0x38
ho 0 tail 12 room 4
load 0x3ffe8000, len 2576, room 12
tail 4
chksum 0xe0
load 0x3ffe8a10, len 8, room 4
tail 4
chksum 0x4d
csum 0x4d


What can I do to reduce memory/heap consumption? Are mqtt and net too big to use them together?

Re: Running mqtt and net:server: I got an Out of Memory Erro

PostPosted: Tue Apr 14, 2020 1:54 am
by Warthog
Ok, now I got it working.
I had to split the lua file in two pieces. It seems that the lua interpreter does not have had enough memory for handling my file (8kb).