# ThingShield and repeated incoming messages

**URL:** <https://community.smartthings.com/t/thingshield-and-repeated-incoming-messages/34797>\
**Category:** Devices & Integrations\
**Tags:** zigbee, arduino, hubv2, thingshield\
**Created:** [January 7, 2016, 1:31am UTC](https://community.smartthings.com/t/thingshield-and-repeated-incoming-messages/34797 "2016-01-07T01:31:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![endoplasmic](https://avatars.discourse-cdn.com/v4/letter/e/e8c25b/32.png) [@endoplasmic](https://community.smartthings.com/u/endoplasmic)\
**Post date:** [January 7, 2016, 1:31am UTC](https://community.smartthings.com/t/thingshield-and-repeated-incoming-messages/34797/1 "2016-01-07T01:31:58Z")

</div>

I’m having a hard time getting the ThingShield to receive messages from the V2 hub in a reliable manner. I’m using the Switch on/off Shield device type.

Attached you can see the stLEDWithNetworkStatus sketch running:

 ![](https://global.discourse-cdn.com/smartthings/original/3X/e/4/e43932821b570d059fc9da3880646566796a1fc8.png)

This images shows me pressing the icon tile to turn the switch on (spammed with on and blank messages). Once that stopped spitting out, I hit the tile again to turn it off. Showed up in 1 line, hooray!

Hit the tile again to turn it on, got some spam, waited, hit the tile again and got “off” spam.

This may not be a problem when hitting the switch slowly and waiting, but if I do something like toggle the tile within 1-2 secs, I get mixed results, and more often than not I see extra ons or offs being fired after a single on or off.

eg. if I hit the tile to turn it on, then turned it off and back on again, I would see a single “on” message come in, but a bleed of “off” messages coming in after which would actually turn the switch off instead of being in the “on” position as being the last command I sent to it.

Has anyone else seen this issue and if so, how did you get around it?! (I’ve also tried the ST\_Anything library to see if that would help, and it also suffers from getting multiple messages which makes me think that the hub or cloud is to blame here).

---

<div class="post-metadata">

**Author:** ![ogiewon](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ogiewon/32/13743_2.png) [@ogiewon](https://community.smartthings.com/u/ogiewon)\
**Post date:** [January 7, 2016, 4:08am UTC](https://community.smartthings.com/t/thingshield-and-repeated-incoming-messages/34797/2 "2016-01-07T04:08:08Z")

</div>

I am the author of ST\_Anything. I’ve never seen multiple duplicate events received via the Arduino. Very interesting problem.

When the Arduino sends data to ST, does the Live Logging in the ST IDE show duplicates? What does the Live Logging show when the problem occurs?

The ’ ’ entries are fairly normal and can be ignored. ST\_Anything automagically ignores them.

I’ve never tried using the ThingShield with a Macintosh. Have you tried with a Windows PC just as a troubleshooting step?

Also, I use v1.6.5 of the Arduino IDE as I find it to be more reliable than 1.6.6. I haven’t tried 1.6.7 yet.

---

<div class="post-metadata">

**Author:** ![tgauchat](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/tgauchat/32/49516_2.png) [@tgauchat](https://community.smartthings.com/u/tgauchat)\
**Post date:** [January 7, 2016, 4:08am UTC](https://community.smartthings.com/t/thingshield-and-repeated-incoming-messages/34797/3 "2016-01-07T04:08:42Z")

</div>

> [@endoplasmic](#):
>
> Has anyone else seen this issue and if so, how did you get around it?! (I’ve also tried the ST\_Anything library to see if that would help, and it also suffers from getting multiple messages which makes me think that the hub or cloud is to blame here).

Do you have any log.debug, etc. commands in your Device Handler? I found and have heard they can mess up the steps of the ZigBee protocol used here.

My shield has been working fine in its assigned role for months now (controlling a projector and screen). I haven’t run a serial output on it too see if any duplication. Possibly I coded to ignore messages from the same state…

---

<div class="post-metadata">

**Author:** ![endoplasmic](https://avatars.discourse-cdn.com/v4/letter/e/e8c25b/32.png) [@endoplasmic](https://community.smartthings.com/u/endoplasmic)\
**Post date:** [January 7, 2016, 6:00pm UTC](https://community.smartthings.com/t/thingshield-and-repeated-incoming-messages/34797/4 "2016-01-07T18:00:42Z")

</div>

> [@ogiewon](#):
>
> When the Arduino sends data to ST, does the Live Logging in the ST IDE show duplicates? What does the Live Logging show when the problem occurs?

Yah it sure does. See here:

 ![](https://global.discourse-cdn.com/smartthings/original/3X/3/6/3611c44939d8247400db34f04e9e2c2353b73fe2.png)

> [@ogiewon](#):
>
> Also, I use v1.6.5 of the Arduino IDE as I find it to be more reliable than 1.6.6. I haven’t tried 1.6.7 yet.

I’m using 1.6.7

> [@tgauchat](#):
>
> Do you have any log.debug, etc. commands in your Device Handler? I found and have heard they can mess up the steps of the ZigBee protocol used here.

Nope, this is just using the On/Off Shield device type from the drop down.

> [@tgauchat](#):
>
> Possibly I coded to ignore messages from the same state…

I would do that too, but the problem is that after my final state I’m getting repeated messages from my previous state.
