teastman / node-red-contrib-ftp-download Goto Github PK
View Code? Open in Web Editor NEWA Node-RED node for FTP Downloads.
License: Apache License 2.0
A Node-RED node for FTP Downloads.
License: Apache License 2.0
Hi, I am pretty new to GitHub, so please help me post this in a better way if I'm posting in the wrong section or whatever.
My setup:
I am using node-red-contrib-ftp-download v1.0.4 and I am encountering a couple issues, probably related each other.
My in/out parameters are:
[File(s)] -> msg.filenames, that is an array of filenames (strings)
[Directory] -> msg.localPath, that is a string
[Output] -> msg.payload, that is an array of filenames (strings)
My node is feeded every 240 seconds through an inject node. I have no wire loop, just a simple straight line [inject node]---[js function node]---[ftp-download node]---[debug node].
My issue:
Let me explain through a (simplified!) timing example.
time 0:00:00 - initial inject
0:00:04 - msg.payload out: the files are correctly downloaded and the output message is correct too (Node-Red debug console)
0:02:04 - FTP timeout message (why?!?)
0:04:04 - msg.payload out
0:04:04 - msg.payload out (again?!?)
0:06:04 - FTP timeout message (why?!?)
0:06:04 - FTP timeout message (why?!?)
0:08:04 - msg.payload out
0:08:04 - msg.payload out (again?!?)
0:08:04 - msg.payload out (again?!?)
0:10:04 - FTP timeout message (why?!?)
0:10:04 - FTP timeout message (why?!?)
0:10:04 - FTP timeout message (why?!?)
...and so on.
Forgive me if I am not precise, I am writing by memory.
The solution:
I fixed these issues editing the code of .js file.
(1) After line
msg[node.output] = filePaths;
I added the line
conn.end();
(2) Moved line
const conn = new ftp();
after line
node.on('input', (msg) => {
(3) Removed line
conn.destroy();
Edit no.1 fixed the timeout problem, edits no.2 and no.3 fixed the "multiple output" problem.
I think it would be useful do be able to define a variable other than msg.payload to append the output files list to.
Would be useful if instead of providing an array of strings, they could provide an array of objects that define a source and destination.
[{"source":"/ftp/path/to.file", "destination":"/local/path/to.save"}, ...]
Hi,
I'm new at this so if I leave out something critical please let me know.
I'm having some trouble with ftp-download. I've tried some other node-red ftp nodes and have had similar trouble so I'm thinking this is my application, but I can't find where.
The situation is I'm trying to pull some simple .txt files from an FTP server hosted on an industrial device. I want to do this in short intervals. Then I process the data in those files. The issue I run into is that if I execute the FTP node more than a couple times it stops pulling the files and nothing comes out on the debug node on the other side.
This .jpg shows the flow after one execution.
This .jpg shows the flow after the second execution. Notice that two messages come through with one execution of the flow, which seemed peculiar to me.
After that I get nothing. I can still access the FTP server from other applications, just not through node-red.
Currently all files are downloaded serially within a single connection. Would be useful to be able to define a max number of connections for files to be downloaded in parallel. Default to 1.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.