I'm facing a challenge while trying to display a real-time graph based on data retrieved from an MQTT node in Node-RED. My approach involves reading data from the MQTT node and transforming it into the appropriate format. However, despite my efforts, I'm unable to visualize a functional graph. It seems that I might be missing something in my approach.
Here's a snippet of the code I'm currently using in the function node:
Regardless of that, the format you are trying to assemble with series, data and labels arrays is for stored data and I believe that when you send data in that form, the chart node will redraw with a clean sheet. If there's only one data point you don't get any lines on the chart.
Sorry, multiple edits to adjust what my phone thinks I should be saying.
Experiencing timestamp inaccuracies on Node-RED charts due to a time difference between microcontroller data and the clock of the Raspberry Pi running Node-RED.
My issue revolves around the challenge of displaying the data I receive from an MQTT node at specific time intervals on a chart.
Probably the stored data format is what you need them, but you need to store the data.
Personally I get data from sensors and store it in a database then at intervals run a query to get the most recent couple of hundred records and feed it to the chart.
No doubt it could be done with context storage too
I provided the dataset above. The data I intend to display consists of timestamps on the X-axis and measurements on the Y-axis. The chart should be a linear graph.
Do you mean each sample is sent to MQTT when the button is pressed? Or is a complete sequence sent when the button is pressed?
If it is a complete sequence then the ideal would be to change the sender so that it sends the whole set as an array instead of a sequence of separate samples.
Yes, I have two buttons for triggering data transmission and stopping. Is it possible to achieve this without using a database, directly from the data I currently have?