The concept is I'm trying to view my single result in debug node red function like shown in the flow below:
My query is about to read the last entry value from my measurements InfluxDB like:
"SELECT volt1 FROM Voltage ORDER BY DESC LIMIT 1"
I don't know how to setup my InjectNode, Influxdb In Node and my DebugNode in a proper way. Is it possible I can get a single output result from debug console? Is there any complete tutorial how to do that?
While not an "influxdb for node-red" tutorial, based on your questions, you really should spend a little time learning since many of the principles apply to all nodes.
So 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.
yup... i know about this but how to i want to read data from influxdb using node red debug node? the essential video didn't explain about the influxdb in at all..
Is there any post that can show me how to extract the value from the non-Raw Output? Because I'm thinking to get the value of "volt1" only... such as "402". After this I'm thinking to process the value and do some analysis.
You said you had watched the Essentials Guide videos, but I am sure there would be help with that question there. Also see this page from the docs. Working with messages : Node-RED
I notice that your query appears to have returned a string for volt1. Does that mean that you are writing string values to database for something that is actually a number. If so then that is a bad idea. Make sure you provide it to influx as a Number not as a String. Unfortunately I think that means you will have to DROP the measurement and start again as it is not possible to change the field type once the field has been created.
Yup I watched the videos so many times, and I make a lot of note about it. What I'm trying to say is I'm trying to extract the value using external Python Script for process it. Sorry for the incomplete question I asked just now. I hope you @Colin and @Steve-Mcl don't blame me.
Do you mean you want to extract the value from a message in node-red using a Python script to extract it? If so then that doesn't make any sense.
If you mean you want to extract the value in node red (which is described in the link I posted) and pass it to a python script then that is a different question. You can call a Python script using an Exec node and pass it whatever you like.
However, if that is what you mean, what are you doing in the script that cannot be done in node-red?
Because I'm facing the node red consume my CPU usage (about 96%) when I try to process everything inside it... FYI, I have about 23 pcs of different sensors which are been located far from each other.... and each sensor having 3 topics to send through MQTT.... all raw data will be display in grafana.... As I just try just now, it seem like grafana also had a problem with streaming/refresh....
I'm still figuring it out how to solve the problem which is I don't know what it's going on when I deploy my extraction processes inside node red...
How often are the data arriving from each sensor? What hardware are you running on? Are you running node red, mosquito, influx and grafana all on the same computer? Where are you running the browser?
Each node need to send all the data every 100ms for 2 minutes. After the 2 minutes, the node will be in deep sleep mode for 58 minutes. I'm using TTGO T-Call board (ESP32+GSM SIM800L) and the sensors is ADS1115 (Sensing the voltage), soil pH sensor and DHT22 (but i'm using humidity value only).
And yes, I'm running mosquitto (as MQTT broker), node red (as client and as input via dashboard), influxdb (for database) and grafana (as graph display including data that I try to perform externally). I'm running everything on cloud server (Alibaba Elastic Server) with Ubuntu 20 installed. I'm running the browser remotely using chrome.
Node a.k.a the device which is the microcontroller with sensors. For each node, I'm not sure how much data been sending but what can I know is 3 data (voltage, ph value, humidity).
In python i'm trying to detect any kind of anomaly created. It just like graph pattern recognition. The value of voltage difference will be then plotted in grafana. I'm using influxdb data insertion for plotting.
Initially, I'm thinking to make the nodes send the data at the same time according to the time that has been sync with the gsm clock.
Ok, in that case, you can run the python command from an exec node. Or you could run it separately from node red picking up the data directly from mqtt. Or you could run it from a Daemon node, numerous possibilities.
WOW... you are really helpful @Colin. I didn't expect so much brilliant ideas I can get from around the world. But you are AWESOME!!!... Really appreciate it. I will try every suggestion you gave me. Thanks a lot.