NorthernMan54 / homebridge-mcuiot

Homebridge platform plugin that support's a network of nodemcu's running nodemcu-dht-yl69-mdns to display Temperature and Humidity.
30 stars 11 forks source link

Getting error during the dofile("test.lua") #30

Closed SwatGuard closed 5 years ago

SwatGuard commented 5 years ago

I'm getting the led.lua:14: attempt to call field 'alarm' (a nil value) when i execute the test.lua file with ESplorer. I did not edit this file. I followed your instructions. I'm using NodeMcu Amica with DHT-11 connected according to your instructions. Both of the NodeMcu leds are turned on (blue) when i test the file . What am I doing wrong ?

Thanks!

NorthernMan54 commented 5 years ago

Just looking at the docs and they have changed the API slightly ;-(

https://nodemcu.readthedocs.io/en/master/modules/tmr/

NodeMCU formerly provided 7 static timers, numbered 0-6, which could be used instead of OO API timers initiated with tmr.create(). After a long period of deprecation, these were removed in 2019 Q1.

Give me a couple of days to refactor the code around this

If your anxious, the change is a medium complexity

Lines like this

tmr.alarm(0,1000,1,function()

Need to go to something like this

local mytimer = tmr.create() mytimer:register(5000, 1, function (t) mytimer:start()

NorthernMan54 commented 5 years ago

This is fixed with release v0.1.65