Sleep vs gw.sleep
This should be a relative easy question for those who know the answer, but I can't find it myself. Neither here, the API or google.
What is the difference between sleep() and gw.sleep(), and when should I use which function?
Welcome to the MySensors community @bloody2k !
sleep() is for MySensors 2.0 and later. gw.sleep() is for MySensors 1.x.
Thank you very much!
That would explain why I couldn't find the difference, since they do the same thing.
Before opening a new thread I would like to attach my question to this one.
I use sleep quite a lot and got the feeling that quite a lot of the time the first message sent after "waking" up is getting lost .. so here is my question:
What do I have to do after hitting sleep? I already noticed that sleep is a combination of:
If there is nothing I have to do this might be pure imagination and I would have to track down the issue further. Thanks in advance!
@cimba007 you shouldn't have to do anything else. There is a bug in 2.0 that can cause problems if the node goes back to sleep too soon after sending a message though. https://github.com/mysensors/MySensors/pull/558 It is fixed in the development branch and will be included in 2.0.1.
This might be the case. Thanks for the info .. i am looking forward to test it