Coder Social home page Coder Social logo

node-red-contrib-ftp-download's People

Contributors

karmaprod avatar teastman avatar

Watchers

 avatar  avatar

node-red-contrib-ftp-download's Issues

Connection not closed, fix found

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.

FTP Stops Working

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.
simple_ftp_application_1st_flow

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.
simple_ftp_application_2nd_flow

After that I get nothing. I can still access the FTP server from other applications, just not through node-red.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.