Hello everyone. I have the following problem: i want to send data (temperature,humidity and water level) in Stream Analytics of Azure IoT Hub and after Stream analytics, in power bi. Everytime i send it, the stream analytics recognize only one value (for example, the humidity). So, in "Table" of Stream Analytics i have only one column instead of three columns. What can i do for it?
By the way in node red my outputs are like these:
And my nodes, like these:
Fianally, the function has the following code:
msg.payload = Number(msg.payload)
if (msg.payload>20 && msg.payload<45)
msg.payload = {"temp":msg.payload};
if (msg.payload>=45)
msg.payload = {"humidity":msg.payload};
if (msg.payload>=0 && msg.payload<20)
msg.payload = {"mmwaterValue":msg.payload};
return msg;
By Debug output is meant feed the serial node into a Debug node and show us what the debug node displays.
As you are a beginner I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.
In 1 question i can answer you. The other 2 i will think more. The serial values sended from 2 Arduino. Also, i have added 2 Dragino in every Arduino and i have LoRa communication. So, i send data (temperature,humidity, water leve) from Arduino to node red via LoRa.
As i said yesterday, the serial values sended from 2 Arduino. Also, i have added 2 Dragino in every Arduino and i have LoRa communication. So, i send data (temperature,humidity, water leve) from Arduino to node red via LoRa. So, the first debug message without function is like this:
The problem with that is any one of those values could be temperature or humidity. There is nothing to indicate which value is which. If the serial read is out of step with your flow, the values can (and will) get assigned to the wrong variable.
You say "from Arduino to node red via LoRa" but I am fairly certain that is not how LoRa sends data (it is normally a fixed length buffer of bytes - where they are always in the same order)
Can you show me the code in your Arduino where you write the values to serial port?
Serial.println(h);
delay(5000); // vazoyme to delay etsi wste i node red na ksexwrisei ta dedomena apo to Arduino
Serial.println(t);
delay(5000); //vazoyme to delay etsi wste i node red na ksexwrisei ta dedomena apo to Arduino
Serial.println(mmwaterValue);
delay(5000); //vazoyme to delay etsi wste i node red na ksexwrisei ta dedomena apo to Arduino
As we do a Serial.println(json) it will automatically add a carriage return \r and a newline \n
Serial.println()
Description
Prints data to the serial port as human-readable ASCII text followed by a carriage return character (ASCII 13, or '\r') and a newline character (ASCII 10, or '\n')
So you need to set the split character on the serial port.