I’m logging (via serial port) every command my shield receives. I’ve noticed two things:
When two commands are sent very close together (i.e. within 2 seconds of each other), one of them (typically the last one) is never received by the shield
When two commands are sent simultaneously (or as near as possible pressing two buttons on the iOS app) one command comes through twice, the other never arrives
Anyone else having the same issue? Any workarounds?
I had set it up so that the state in SmartThings only flipped to ON after the Arduino reported that it had successfully turned on the relay. I did this by having states like this:
And then reporting the state back from the Arduino code like this: smartthing.send("relayon0");
It seems the call to smartthing.send is what’s causing the problems. If I comment it out everything works just fine. The presence of debug code (Serial.print) doesn’t seem to affect things.
I take back my previous comment - without the smartthing.send it is much more reliable, but I’m still getting a few missed commands, which I recall being the reason I put the feedback mechanism in place to start with…