scargill wrote:I REALLY thought I'd cracked this - but the timer just keeps on ticking.... I can inject tmr.stop() via serial but as shown here as part of the setup... it doesn't stop.... just keeps repeating. Thoughts, anyone.
file.remove("init.lua")
file.open("init.lua","w")
file.writeline([[print("Petes Tester 4")]])
file.writeline([[tmr.alarm(5000, 0, function() dofile("thelot.lua") end )]])
file.close()
I use a similar approach, but I execute the file with my lua functions directly with dofile, so NO timer. Works for me.
init.lua just contains:
dofile("functions.lua")
print("functions.lua executed")
Bootlog:
> file.list()
init.lua size:56
functions.lua size:1522
> node.restart()
c_..RS.fJ..fJS.f.
functions.lua executed
NodeMcu 0.9.2 build 20141119 powered by Lua 5.1.4
>
Not sure if this helps!?