I am using Node-RED (v2.1.4) and node.js v14.17.0 to monitor an FTP server (FileZilla) where a Dahua IP camera uploads snapshots. By default, the camera creates a deeply nested directory structure:
The standard ftp list node only returns a flat list of the current directory. To find the images, I built a recursive loop to enter each subfolder. However, my logic is failing, and the folder path is being built incorrectly in an infinite loop.
The Setup
FTP Server: FileZilla Server 1.12.1.
Node-RED Node:node-red-contrib-ftp.
Flow Logic: An Inject node triggers every 5 seconds, starts at a base path, uses ftp list, and a function node determines if subfolders exist to loop back.
The Error:
When the recursive flow runs, my debug sidebar shows that the currentFolder variable is being corrupted. It continuously appends the same folder name to itself instead of moving down to the next date-stamped subfolder:
Thank you! Regarding the upgrade: I am worried If I upgrade from my current versions to teh newest ones, will this affect my other existing projects that are currently working correctly?
is there a risk of 'breaking changes' that would require me to rewrite my old code or reconfigure my nodes?
Yes. Always a risk. As you say it’s a function you have written that is failing then I wouldn’t upgrade. Maybe share the function so folk here can take a look instead.