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. Development
  3. Does Gateway loop() required Wait or delay?

Does Gateway loop() required Wait or delay?

Scheduled Pinned Locked Moved Development
5 Posts 2 Posters 1.7k Views 2 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.
  • JohnRobJ Offline
    JohnRobJ Offline
    JohnRob
    wrote on last edited by
    #1

    Hi,

    I have a functioning sensebender gateway with one sensor. The sensor is just counting and being used for my 1st system learning.

    My gateway does nothing else but be a gateway. In this configuration do I need a Wait(xx) or delay(xx) in the gateway loop()?

    Early on I thought I read a delay was needed else a lot of unneeded traffic was generated by the gateway, but now I can't find that statement and the examples have no delay in the loop() function.

    Thanks

    mfalkviddM 1 Reply Last reply
    0
    • JohnRobJ JohnRob

      Hi,

      I have a functioning sensebender gateway with one sensor. The sensor is just counting and being used for my 1st system learning.

      My gateway does nothing else but be a gateway. In this configuration do I need a Wait(xx) or delay(xx) in the gateway loop()?

      Early on I thought I read a delay was needed else a lot of unneeded traffic was generated by the gateway, but now I can't find that statement and the examples have no delay in the loop() function.

      Thanks

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

      @johnrob using delay can cause the gateway to miss messages. Use wait.

      I've never seen anything about unnecessary traffic, and I can't imagine how that could happen. Do you have any more information?

      1 Reply Last reply
      1
      • JohnRobJ Offline
        JohnRobJ Offline
        JohnRob
        wrote on last edited by JohnRob
        #3

        Hi,
        @mfalkvidd

        No I don't, when I first started learning MySensors (not too long ago) I was reading a lot of the website information and posts and whatever. I had the impression an empty loop() routine could be an issue but I must have mixed up what I read on something else. And not really understanding the inner workings of the MySensors code I figured I would ask before I removed the wait(2000) I have.

        So do you recommend nothing or wait(2000) as I have now?

        Thanks

        John

        mfalkviddM 1 Reply Last reply
        0
        • JohnRobJ JohnRob

          Hi,
          @mfalkvidd

          No I don't, when I first started learning MySensors (not too long ago) I was reading a lot of the website information and posts and whatever. I had the impression an empty loop() routine could be an issue but I must have mixed up what I read on something else. And not really understanding the inner workings of the MySensors code I figured I would ask before I removed the wait(2000) I have.

          So do you recommend nothing or wait(2000) as I have now?

          Thanks

          John

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

          @johnrob I'd remove wait. Less code makes the code easier to read.

          1 Reply Last reply
          0
          • JohnRobJ Offline
            JohnRobJ Offline
            JohnRob
            wrote on last edited by
            #5

            For those who read this post:

            Since my original post I found the wait(time) command is a MySensors macro that essentially is a "wait millis()" function.

            1 Reply Last reply
            0

            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


            19

            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