Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. Sleep vs gw.sleep

Sleep vs gw.sleep

Scheduled Pinned Locked Moved General Discussion
7 Posts 3 Posters 2.4k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • bloody2kB Offline
    bloody2kB Offline
    bloody2k
    wrote on last edited by bloody2k
    #1

    Hi

    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?

    Thanks

    1 Reply Last reply
    0
    • mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      Welcome to the MySensors community @bloody2k !

      sleep() is for MySensors 2.0 and later. gw.sleep() is for MySensors 1.x.

      1 Reply Last reply
      0
      • bloody2kB Offline
        bloody2kB Offline
        bloody2k
        wrote on last edited by
        #3

        Thank you very much!

        That would explain why I couldn't find the difference, since they do the same thing.

        mfalkviddM 1 Reply Last reply
        0
        • bloody2kB bloody2k

          Thank you very much!

          That would explain why I couldn't find the difference, since they do the same thing.

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          @bloody2k yup :-D

          1 Reply Last reply
          0
          • cimba007C Offline
            cimba007C Offline
            cimba007
            wrote on last edited by
            #5

            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:

            transportPowerDown();

            and

            hwSleep

            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!

            mfalkviddM 1 Reply Last reply
            0
            • cimba007C cimba007

              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:

              transportPowerDown();

              and

              hwSleep

              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!

              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by
              #6

              @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.

              cimba007C 1 Reply Last reply
              0
              • mfalkviddM mfalkvidd

                @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.

                cimba007C Offline
                cimba007C Offline
                cimba007
                wrote on last edited by
                #7

                @mfalkvidd

                This might be the case. Thanks for the info .. i am looking forward to test it ;-)

                1 Reply Last reply
                1

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                8

                Online

                12.0k

                Users

                11.2k

                Topics

                113.4k

                Posts


                Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • MySensors
                • OpenHardware.io
                • Categories
                • Recent
                • Tags
                • Popular