Hello, as you will perceive I am new to Node-Red. I have a sensor that outputs serial data every minute in an XML format. I use a Serial IN node to capture the data. I send the XML data to a file using the write file node so that I could eventually (after learning more on Node-Red) read the file, transform to JASON, parse the data etc. and even send it to a DB.
When the serial node first sends its block of data to the write node the data is saved correctly if I use the APPEND TO FILE Action. If I use Overwrite file only the first line of the XML file is saved.
I want to capture the entire block of data and over write the data next time a new data set is retrieved. Here lies my problem. I was able to resolve it by copying the incoming data to a new file and erasing the old file but this is not elegant and I don’t understand why this step is causing me so much grief using the WRITE FILE NODE.
Hi, welcome to the forum.
Can you share a reduced flow which demonstrates your problem?
Not sure I understand why you pass your data through a file, rather than parse & process the flow message all the way to the DB, or whatever final target. You have nodes which can convert your XML to JSON, CSV etc., or any proprietary format.
I have been able to send data to the Table but I cannot seem to be able to get all incoming data to display in one row. Instead it places some in a column and in its own row. I have tried removing \n from the serial node but then no data steam in. I believe the incoming data stream is not formatted correctly so only partial data is handled by the serial node and XML node. Here is a partial list of the errors.
I am placing a sample of the XML incoming serial table output and the xml serial feed to see if anyone has any ideas on how to send just one row of data to the table versus each data having its own row. I have a Serial node the XML Node the Table Node. Many thanks!!
The data output from the table and xml file are not exactly the same as the interval changed when I was capturing the screen shot. But its clear that only 5 variables are captured while I should have at least 7