Left here for archival purposes.

User avatar
By willwach
#42620 I'm trying to use the node.dsleep.

Code: Select allfunction startup()
    if abort == true then
        print('startup aborted')
        return
        end
    print('in startup')

    node.dsleep(60000)
    end

abort = false
tmr.alarm(0,5000,tmr.ALARM_SINGLE,startup)


Timer works as expected and waits 5second before startup.
But after starting it results in an unreadable error message and rebooting again and again.

I'm using the development firmware build by frightanic.com
branch: master
commit: c8037568571edb5c568c2f8231e4f8ce0683b883
SSL: true
modules: bmp085,dht,enduser_setup,file,gpio,i2c,mqtt,net,node,ow,tmr,uart,wifi
build built on: 2016-02-14 13:27
powered by Lua 5.1.4 on SDK 1.4.0

Any ideas?

Man y thanks,
Marc
User avatar
By willwach
#42621
Code: Select all
NodeMCU custom build by frightanic.com
   branch: master
   commit: c8037568571edb5c568c2f8231e4f8ce0683b883
   SSL: true
   modules: bmp085,dht,enduser_setup,file,gpio,i2c,mqtt,net,node,ow,tmr,uart,wifi
 build    built on: 2016-02-14 13:27
 powered by Lua 5.1.4 on SDK 1.4.0
> in startup
 �~?�4�!��I�O�:�COAE�����aR

NodeMCU custom build by frightanic.com
   branch: master
   commit: c8037568571edb5c568c2f8231e4f8ce0683b883
   SSL: true
   modules: bmp085,dht,enduser_setup,file,gpio,i2c,mqtt,net,node,ow,tmr,uart,wifi
 build    built on: 2016-02-14 13:27
 powered by Lua 5.1.4 on SDK 1.4.0
> in startup
0�~�4�!��Y�O�:�COAE�����aR

NodeMCU custom build by frightanic.com
   branch: master
   commit: c8037568571edb5c568c2f8231e4f8ce0683b883
   SSL: true
   modules: bmp085,dht,enduser_setup,file,gpio,i2c,mqtt,net,node,ow,tmr,uart,wifi
 build    built on: 2016-02-14 13:27
 powered by Lua 5.1.4 on SDK 1.4.0
> in startup
0�~?�4�!��Y�O�:�C_AE�����aR


User avatar
By jankop
#42630 Yes:
Code: Select allprint ('WakeUp')
function startup()
   if abort == true then
      print('Sleep aborted')
      return
   end
    print('Go to sleep')
    node.dsleep(5000000)-- sleep 5s
end

abort = false

tmr.alarm(0,5000,tmr.ALARM_SINGLE,function() startup() end)