# Azure IOT hub - 4 sensors running simultaneously

**URL:** https://discourse.nodered.org/t/azure-iot-hub-4-sensors-running-simultaneously/25203
**Category:** General
**Created:** [20 April 2020 17:53 UTC](https://discourse.nodered.org/t/azure-iot-hub-4-sensors-running-simultaneously/25203 "2020-04-20T17:53:07Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Beefy\_carrot](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@Beefy\_carrot](https://discourse.nodered.org/u/Beefy_carrot)
#### Post date: [20 April 2020 17:53 UTC](https://discourse.nodered.org/t/azure-iot-hub-4-sensors-running-simultaneously/25203/1 "2020-04-20T17:53:08Z")

</div>

Hi! im working with 4 sensors, possibly adding more sensors to the project. My current project has 4 sensors all with their own inject node and azure iot hub. the problem is when all these sensors run, they all send and establish a new connection with azure iot hub (causing other sensors to disconect bacause of the traffic) . How can i mitigate this? tried thinking a bit outside the box, adding different delay on each sensor inject ( which works) but is far from ideal.

**Current structure of the function node that passes data to azure iot hub node :**

_msg1 = '{"deviceId": "InputValue\_1\_i02", '_  
_msg1 = msg1 + '"key": "6wSV2+ZimiNr4HFjFCGJBIWflSgwlfydZRS33nx5uKs=", '_  
_msg1 = msg1 + '"protocol": "mqtt", '_  
_msg1 = msg1 + '"data": { "' + msg.topic + '": "' + msg.payload + '"}}'_  
_newmsg = { payload: msg1 };_  
_return newmsg_

---

<div class="post-metadata">

### Author: ![aderici](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aderici/32/37279_2.png) [@aderici](https://discourse.nodered.org/u/aderici)
#### Post date: [21 April 2020 00:03 UTC](https://discourse.nodered.org/t/azure-iot-hub-4-sensors-running-simultaneously/25203/2 "2020-04-21T00:03:47Z")

</div>

please specify which contrib node you are using.

Try specifying your server url and credentials inside the node configuration and not in the message payload so that it doesn't re-connect every time,

---

<div class="post-metadata">

### Author: ![Beefy\_carrot](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@Beefy\_carrot](https://discourse.nodered.org/u/Beefy_carrot)
#### Post date: [23 April 2020 21:48 UTC](https://discourse.nodered.org/t/azure-iot-hub-4-sensors-running-simultaneously/25203/3 "2020-04-23T21:48:51Z")

</div>

I am using the Azure IOT hub node  
 ![chrome_mFncJpgg5b](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/0/a07b5b6105e55a179f0d934b6e95551177a92969.png)

---

<div class="post-metadata">

### Author: ![aderici](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aderici/32/37279_2.png) [@aderici](https://discourse.nodered.org/u/aderici)
#### Post date: [23 April 2020 22:01 UTC](https://discourse.nodered.org/t/azure-iot-hub-4-sensors-running-simultaneously/25203/4 "2020-04-23T22:01:40Z")

</div>

I see, obviously this one does not allow specifying device id and device key

> **[node-red-contrib-azureiothubnode](https://flows.nodered.org/node/node-red-contrib-azureiothubnode)**
>
> An Azure IoT Hub node for node-red

this one is from the actual microsoft guys themselves maybe thats better?

---

<div class="post-metadata">

### Author: ![Beefy\_carrot](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@Beefy\_carrot](https://discourse.nodered.org/u/Beefy_carrot)
#### Post date: [24 April 2020 00:03 UTC](https://discourse.nodered.org/t/azure-iot-hub-4-sensors-running-simultaneously/25203/5 "2020-04-24T00:03:35Z")

</div>

dude, it's the same node

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [23 June 2020 00:16 UTC](https://discourse.nodered.org/t/azure-iot-hub-4-sensors-running-simultaneously/25203/6 "2020-06-23T00:16:03Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
