Does Gateway loop() required Wait or delay?
-
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
-
@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?
-
Hi,
@mfalkviddNo 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
-
@johnrob I'd remove wait. Less code makes the code easier to read.
-
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.
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
LAN8720A - will mysensors work with this module
Development • 13 Nov 2024, 17:06 • Marcin 15 Nov 2024, 10:59 -
Adding Listen only device to my system.
Development • 26 Feb 2025, 00:39 • dpcons 26 Feb 2025, 06:26 -
Radio waking up for no reason.
Development • 4 Jul 2020, 21:09 • Sasquatch 15 Jan 2025, 08:33 -
Home Assistant/MySensors quirks
Development • 16 days ago • OldSurferDude 16 days ago -
Gateway without a radio
Development • 12 Jan 2025, 23:19 • OldSurferDude 14 Jan 2025, 22:07