Azure IOT hub - 4 sensors running simultaneously

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

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,

I am using the Azure IOT hub node
chrome_mFncJpgg5b

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

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

dude, it's the same node

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