Azure connection Telemetry data is not send

Hi,

I’m working with the Two-Channel-Vib node and send the data to our company Azure portal via the node-red environment on the NCD gateway.
In node-red I use the example flow with the Azure node from the NCD / Github repository.
The Azure node is connected and is sending the “Property” data to the Azure portal.
But the “Telemetry” data is not.

The Property node is setup as follows :

var newMSG = {};
newMSG.payload = {};
newMSG.topic = “property”;

newMSG.payload.nodeId = msg.data.nodeId;
newMSG.payload.firmware = msg.data.firmware;
newMSG.payload.sensor_type = msg.data.sensor_type;
newMSG.payload.addr = msg.data.addr;
newMSG.payload.modem_mac = msg.data.modem_mac;

return newMSG;

The Telemetry node is setup as follows :

var newMSG = {};
newMSG.payload = {};
newMSG.topic = “telemetry”;

newMSG.payload.battery_percent = msg.data.battery_percent;
newMSG.payload.counter = msg.data.counter;
newMSG.payload.rssi = msg.data.rssi;
for(var key in msg.data.sensor_data){
newMSG.payload[key] = msg.data.sensor_data[key];
}
return newMSG;

I did not change anything in the NCD flow syntax.

What is going wrong that the Telemetry data is not correctly interpreted by the Azure node?

Many thanks in advance.

Cheers,
Leendert
The Netherlands.

Hi Leendert,

Are you getting data from the sensors out of the Gateway Node? Can you provide the payload that is being output when those sensors transmit?

Do you have any debug nodes setup in the flow? If so what are you getting out of them.

Hi Travis,

Thanks for replying!

Yes, the data is flowing super! : See screenshot.

It is your example json flow and it seems that the sensor dataformat and the “Telemetry” node syntax is not matching.

Is there something changed? Because when I bought the Two-channel-Vib sensors and you helped me then, it worked and the data was visible in our Azure portal.

Thanks.

Cheers,
Leendert

Hi Leendert,

You are correct. That flow was developed for different sensors who’s sensor telemetry was held in a sub object called data.

You’ll need to change that function node. Remove the for loop and replace it with:

newMSG.payload = msg.s1_odr;
newMSG.payload = msg.s1_temperature;
etc....

Hi Travis,

A, that makes sense!
I will try and will let you know.

Regards,
Leendert

is it NOT

newMSG.payload = msg.data.s1_temperature;

No, look at the debug output for the sensor telemetry. There is no data object. It needs to be:

newMSG.payload = msg.s1_temperature;

Ok, many thanks.
Till now it is not functioning …:frowning:

Do I have to keep the “property” node AND the “telemetry” node?

Because an error is still throwed :

Thanks.

change:

newMSG.payload = msg.s1_temperature

to:

newMSG.payload.temperature = msg.s1_temperature

Hi Travis,

I found a way to send the “sensor_data” to our Azure portal:

In the telemetry node the syntax:

newMSG.payload.s1_temperature = msg.data.sensor_data.s1_temperature;

did the trick.

Apparently the “Property” values are not data object oriented and the sensor_data is.

See if it will be stable.
I’ll keep you informed.

Have a nice weekend.

Regards,
Leendert