Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Receiving and sending data from CR1000/X by ftp


artyb May 26, 2021 11:02 AM

Hi,

I'm after some advice for a project where we would need to retrieve files from an ftp server and then send them onto a different ftp server on a timed schedule.

I'll number my questions to allow people to refer to them:

1) Is there some information about how the ftp servers should be configured and how to increase security (SFTP)?

2) Can someone confirm that the logger can store downloaded files (probably a few kB each) on a memory card and then read and send them (pretty sure this can be done!)?

3) Does anyone have any examples of code to detect and then retry pulls and pushes if any transfers have failed?

4) Does the CR basic code have to manage how much of the memory card is used up and delete older files (if they were kept at all, or can the logger manage that as it does with data tables?

5) Anything else to watch out for?

Thank you,

A


Nico May 27, 2021 06:40 AM

You want a datalogger to move files via FTP from one FTP server to another?

Be aware that the firmware has got a 1-digit kB TCP/IP buffer size.. which means if you want to transfer over a longer connection (pings > 100 ms) it will take a while to transfer data (will not be apprent for smaller files though).

to 1) .. for SFTP security, public/private keys is the way to go. Ask your server admin/IT guy.

to 2) .. I only tested FTP so far, up/downloading to/from CR3000, CR1000, CR1000X with a FTP client. This way the FTP part of the firmware of the logger deals with things. Involving CRbasic usually slows things down a lot, i.e. CRbasic being in control of up/dpownload. Wouldn't recommend it unless really necessary.

to 4) .. you have to take care IMHO

to 5) .. well, actually, there is always plenty different ways to skin a cat. If you can - tell us a bit what you actually want to do and maybe there is some better/other way to solve this? Maybe some tiny ARM/linux or android based SBC with Ethernet can do this job?


artyb May 28, 2021 03:39 AM

Hi Nico,

Thank you for your reply. I'm not sure that a logger is the best approach, but was investigating it due to familiarity with them, their robustness and accuracte clocks etc and we might want to use some other functionality of them too, eg to monitor the power supply.

The task is to retrieve data from a local piece of equipment using ftp and send it to a remote ftp server on a schedule. I'd rather not have remote access into the system via ftp. 

Accessing the data locally via ftp is one option, but so might be Modbus RTU, then sending via ftp as before.

This site would have a satellite connection, so the comment about longer pings is pertinent.

Cheers,
A


JDavis May 28, 2021 02:56 PM

1) Is there some information about how the ftp servers should be configured and how to increase security (SFTP)?

SFTP is recommended for security reasons. To handle the additional processing the encryption requires, you want to use newer generation dataloggers like the CR1000X and CR6.

2) Can someone confirm that the logger can store downloaded files (probably a few kB each) on a memory card and then read and send them (pretty sure this can be done!)?

It is not a problem to do FTPClient() to grab a file from one server then FTPClient() to send the same file to a different server. As the previous post said, it won't be fast.

3) Does anyone have any examples of code to detect and then retry pulls and pushes if any transfers have failed?

FTPClient() provides a result code to show if it was successful. You can build a pretty simple For Loop around it, and exit the loop early if successful.

4) Does the CR basic code have to manage how much of the memory card is used up and delete older files (if they were kept at all, or can the logger manage that as it does with data tables?

If the files are received with the logger acting as an FTP server, there is a File Manage setting that can be used to limit the number of files. With grabbing files with FTPClient() there is not an automatic means to manage the files. Code would need to be written. Simplest is to delete each file after you send it successfully.

5) Anything else to watch out for?

If you have two IP interfaces on a datalogger, such as cell modem and Ethernet, you may need to use IPRoute(). IPRoute() lets you specify which interface to use for connecting to a particular server.

Log in or register to post/reply in the forum.