Current Lua downloadable firmware will be posted here

User avatar
By alonewolfx2
#2980
Hans174 wrote:Hello,

@ zeroday

Thank you very much for your LUA implementation. I flashed your latest file and it works fine.

@ scargill

Maybe you can switch to an I2C temperature sensor. The LM75 should do the job.

Hans

Have you tried lm75 with esp8266?
User avatar
By picstart1
#2986
Code: Select allfile.open("blinkled.lua","w")
  file.writeline([[led = 8]])
    file.writeline([[gpio.mode(led,gpio.OUTPUT)]])
    file.writeline([[for i=0,5,1]])
    file.writeline([[do]])
     file.writeline([[gpio.write(led,gpio.HIGH)]])
     file.writeline([[tmr.delay(1000000)]])
     file.writeline([[gpio.write(led,gpio.LOW)]])
     file.writeline([[tmr.delay(1000000)]])
   file.writeline([[end]])
file.close()
dofile("blinkled.lua")

The led blinks every second so the improved tmr.delay is very likely now resetting the watchdog.
My guess is the watchdog is integral to many expessif routines and is set maybe as a fuse at compile time so one way to prevent it from
counting out is to reset the watchdog counter..What is confusing is there are AT commands that claim to disable and enable the watchdog...The AT is just plain messy.
Anyway having the watchdog always running is very often what you want and resetting it within tmr.delay is a good solution especially since a tmr.delay is blocking
What with various dialects and often more varied responses it is nice to see the AT mess in the rear view mirror thanks to NodeMcu and lua scripts.