-->
Page 1 of 2

node.sleep - does not work for me

PostPosted: Mon Feb 12, 2018 2:58 pm
by candoit
Can't figure out, why this is not working.

->file.writeline([==[cfg={}]==]) -> ok
->file.writeline([==[cfg.duration=10*1000*1000 -- 10 sec]==]) -> ok
->file.writeline([==[cfg.wake_pin=3]==]) -> ok
->file.writeline([==[]==]) -> ok
->file.writeline([==[node.sleep(cfg)]==]) -> ok
->file.flush() -> ok
->file.close() -> ok
->dofile("main.lua") -> send without checkdofile("main.lua")
main.lua:37: attempt to call field 'sleep' (a nil value)
stack traceback:
main.lua:37: in main chunk
[C]: in function 'dofile'
stdin:1: in main chunk

---------

NodeMCU custom build by frightanic.com
branch: master
commit: 5073c199c01d4d7bbbcd0ae1f761ecc4687f7217
SSL: true
modules: ds18b20,file,gpio,net,node,ow,pwm,tmr,uart,wifi,tls
build built on: 2018-02-12 15:30
powered by Lua 5.1.4 on SDK 2.1.0(116b762)

Re: node.sleep - does not work for me

PostPosted: Tue Feb 13, 2018 1:11 am
by marcelstoer

Re: node.sleep - does not work for me

PostPosted: Tue Feb 13, 2018 4:06 pm
by candoit
1. How can I enable this when using https://nodemcu-build.com/ ?
2. I am using master which I thought relates to https://nodemcu.readthedocs.io/en/maste ... ules/node/

Re: node.sleep - does not work for me

PostPosted: Wed Feb 14, 2018 1:15 am
by marcelstoer
candoit wrote:1. How can I enable this when using https://nodemcu-build.com/ ?


You'll have to build the firmware manually as per https://nodemcu.readthedocs.io/en/latest/en/build/. I suggest you use the Docker image.

candoit wrote:2. I am using master which I thought relates to https://nodemcu.readthedocs.io/en/maste ... ules/node/


That's correct, I posted the wrong link. However, IIRC we missed to add that note to the documentation in 'master' when the feature got disabled. It'll be available with the next dev->master snap.