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.1k 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 Online
      mfalkviddM Online
      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 Online
          mfalkviddM Online
          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
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            15

            Online

            11.7k

            Users

            11.2k

            Topics

            113.0k

            Posts


            Copyright 2019 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