# Node-Arduino connects after MQTT in nodes

**URL:** https://discourse.nodered.org/t/node-arduino-connects-after-mqtt-in-nodes/16750
**Category:** General
**Created:** [15 October 2019 21:55 UTC](https://discourse.nodered.org/t/node-arduino-connects-after-mqtt-in-nodes/16750 "2019-10-15T21:55:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![m\_elias](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@m\_elias](https://discourse.nodered.org/u/m_elias)
#### Post date: [15 October 2019 21:55 UTC](https://discourse.nodered.org/t/node-arduino-connects-after-mqtt-in-nodes/16750/1 "2019-10-15T21:55:20Z")

</div>

On a Pi Zero W, I have an Arduino connected via ttyUSB0 running the StandardFirmataPlus example sketch. If it wire a _MQTT In_ node to an _Arduino Out_ node, the mqtt in node fires on a full deploy before the arduino out node connects. Is there a way to delay the mqtt connection only on deploy or other strategy to deal with this?

_edit_ Only seems to be an issue on a full deploy

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [15 October 2019 22:47 UTC](https://discourse.nodered.org/t/node-arduino-connects-after-mqtt-in-nodes/16750/2 "2019-10-15T22:47:36Z")

</div>

If your prepared to always do a full-deploy, then node-red-contrib-queue-gate could do the job for you

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/50b86d5506944e1522bfa23297e906bb202ae6df.png)

```auto
[{"id":"efc0f3da.a1e92","type":"q-gate","z":"7e03a06d.7d71d","name":"","controlTopic":"control","defaultState":"queueing","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","queueCmd":"queue","defaultCmd":"default","triggerCmd":"trigger","flushCmd":"flush","resetCmd":"reset","maxQueueLength":"100","keepNewest":false,"qToggle":false,"persist":false,"x":370,"y":160,"wires":[["6309d877.1ad288"]]},{"id":"1955893a.374627","type":"inject","z":"7e03a06d.7d71d","name":"","topic":"control","payload":"open","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":"1","x":230,"y":240,"wires":[["efc0f3da.a1e92"]]}]

```

It will let you delay any messages at startup (assuming it activates quick enough to catch the 1st message from your MQTT node)
