Node-red-contrib-ftp-server

I'm trying to create an FTP server with Node Red on the node-red-contrib-ftp-server where its working. The screen shot below is the ftp node ingesting some data I sent to the Node Red server via FT.

The debug for the what the data looks like is a confusing, highlighted yellow on the right hand side above.

Ultimately this is what the data file looks like in Excel:

Can someone help me understand:

  • Do I need a JavaScript function block to recreate the data structure of the csv file? Its time series data of an electric meter

    1. Would anyone have tips for saving the data? I dont know a lot about data bases, is there any easy one to work with for the newbie? What I am hoping for is to find some solution that I can implement where an electric meter csv file will get uploaded via ftp to the Node Red ftp server ONCE PER DAY (or something similar) and the data can be continuously appended to a database; where then on some future date I can retrieve the data on hopefully somewhat of an easy process.

Any help and tips, links to tutorials greatly appreciated. I don't have a ton of JavaScript experience.

The buffer is probably the binary content of the file.

You can convert it to a string in a function node using

msg.payload = msg.payload.toString();
return msg;

Then you can feed it to a CSV node to covert the text to usable objects.

Connect a debug node to every node to see how the data changes as it passes through the nodes.

Once you have that, search the forum and flows library for database examples - there are LOTS of them

Thanks Steve that worked perfect to convert to string.

@Steve-Mcl on Ubuntu would you know where the node red static directory would be located?

There's a YouTube video where I can append CSV files and serve them through the node red static directory and retrieve the CSV data through the browser which will work great for now but I am having a difficult time trying to find where the static directory exists.

I can access the settings.js no problem here ben@ben-HP-ProBook-6550b:~/.node-red$

When I can nano settings.js I did uncomment out:

httpStatic: '/home/nol/node-red-static/'

But the only thing that exists in /home is:

ben@ben-HP-ProBook-6550b:/home$ ls
ben

No nol directory, any ideas to try?

The directory is any directory that exists on your device. Often a sub folder of .node-red but it's up to you. For example, if you create a directory node-red folder called /home/ben/node-red-static then that's what it'll be.

Can't think of any other way to explain it does that make sense?