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

User avatar
By raz123
#13384 You might want to read about "require" vs "dofile".

Hint: replace "require('ds18b20')" by dofile('ds18b20.lua')(parameter_here) -- ds18b20.lua will have to be modified so as to have a returning function.
User avatar
By snice
#13385 hi raz123,

I'm beginner in Lua coding (expert of .NET/C++ apps)... I replaced the require('ds18b20') by dofile('ds18b20.lua'), still same problem:

dofile("tempLogger.lua")
not enough memory
User avatar
By raz123
#13421
snice wrote:hi raz123,

I'm beginner in Lua coding (expert of .NET/C++ apps)... I replaced the require('ds18b20') by dofile('ds18b20.lua'), still same problem:

dofile("tempLogger.lua")
not enough memory


If you aren't able to squeeze any more memory from your program, then you could compile a lightweight version of Nodemcu without all the extra modules/features that you won't be using.

For my part, I tend to compile without floating point, pwm, i2c, spi, adc, ow, bit, mqtt, coap, u8g, ws2812 and cjson.