As the title says... Chat on...

User avatar
By cal
#13436 Moin,

timoline wrote:
snice wrote:then this firmware is a complete bullshit if we can't have 52 lines of custom program :shock:


or it is a challenge to get more with less :D


Exactly. You don't program a multi-GB multi-core environment here.
We are programming a chip for embedded programming here.
It has to deal properly with the following program

Code: Select allwhile true do end


doing a reboot and thats fine.
A programmer error would otherwise have made the chip "hang up", something you want to avoid
at all costs if this is some battery operated node in the wild.

Using a high level languags like lua doesn't change reality.
I am still struggling too, how to get memory demands low and what lua tricks to apply.
(Use locals in modules, avoid long variable names, use compiled lua, ...)
The nodemcu does a good job making lua possible and giving us a tool.
We have to learn how to use it.

Carsten
User avatar
By kellopeli
#13610
snice wrote:error loading module 'ds18b20' from file 'ds18b20.lua': not enough memory

I had the same problem and got around it by compiling the lua script to bytecode. The intepretation of lua skripts eats lots of that precious memory. To compile the bytecode just hit the "Save&Compile" button in ESPlorer and everything is hunky dory.
User avatar
By Mikey
#13646
snice wrote:then this firmware is a complete bullshit if we can't have 52 lines of custom program :shock:

I got a LUA script currently sitting at 135 lines, I only get "not enough memory" when the old is running at the same time. All I do is to delete init.lua, restart the ESP8266, then send the new code to it.