(Using nodemcu adafruit feather HUZZA..)
The behavior of "tmr" does not match the documentation.
dly = 500
ledPin = 4
ledState = 0
tmr.alarm( 0, dly, 1, function()
ledState = 1 - ledState;
This is the auto timer and it works as expected. If I uncomment tmr.stop(0), it will stop.
What I cannot do is: (Despite of the documentation stating that the timer will not be de-registerd by a stop command.
-> attempt to call field 'start' (a nil value))
Same happens when I do a tmr.ALARM_SINGLE, but that is expected as this will unregister the timer automatically as expected.
Somebody else suggested tmr.ALARM_SEMI, but that will not work at all for me:
tmr.alarm( 0, dly, 2, function() ....
yields: wrong arg type
I looked into the source code for nodemcu https://nodemcu.readthedocs.io/en/lates ... r/#tmrstop and everything is happily defined...
I also tried this, right out of the documentation:
mytimer = tmr.create()
mytimer:register(5000, tmr.ALARM_SINGLE, function()
-> attempt to call field 'create' (a nil value)
The only thing that seems to works is tmr.alarm( 0, 500 , "0 or 1" , function()
Nobody else had issue with this??
IOsens wrote:-> attempt to call field 'create' (a nil value)
At this point I am reasonably certain that you are using an outdated version of the firmware.
Depending on the version you use not even node.info() will give you much useful information. So, I suggest you take a look at https://nodemcu.readthedocs.io/en/latest/#releases and make sure you run a recent version.