FTPFileSender (community library)
Summary
Name | Value |
---|---|
Name | FTPFileSender |
Version | 0.1.6 |
Installs | |
License | ISC |
Author | wvdv2002 |
URL | https://github.com/wvdv2002/Particle-FTPFileSender |
Repository | https://github.com/wvdv2002/Particle-FTPFileSender.git |
Download | .tar.gz |
All Versions | 0.1.6, 0.1.3, 0.1.2, 0.1.1 |
Send compressed and get uncompressed files over FTP to/from a server. This library can be used to send and get files over FTP to a server. It uses the compressFile library to make the files smaller.
Library Read Me
This content is provided by the library maintainer and has not been validated or approved.
FTPFileSender
A Particle library, FTPFileSender, to send compressed and receive uncompressed files over FTP to/from a ftp server. Using this library you can call a function on a particle device and the Particle will compress and then send a file to the designated FTP server.
Getting started
Add some files to an SDcard and connect this SDcard to your Particle device. Setup the right pins and SD card configuration in the example. Set the ip address, username and password of the server in the FTPFileSender constructor. Run the example by compiling and flashing the files to a particle device.
Setup a server that works as required by the particleftpclient library. I use ProFTPD as the ftp server.
See the examples folder for more details.
When running the example, you can run particle call "name" sendFile "/path/to/file" to send a file. Run particle call "name" status to get the status of the file sending.
Documentation
After sending a file, it can be decompressed as described in the compressFile library.
Setting up a server tips:
In my work environment the Electrons are all in a seperate network with a VPN connection with the server. The server has a set IP Address, some DNS lookup might be necessary if your server has no set IP address. There might be some challenges in setting up a safe passive FTP server without a seperate VPN. if using proFTPD make sure to at least set some limits in the config file and don't forget to open some passive ports as well as the main ftp port. I added a user particle-ftp that can only access the folder /particle-ftp on the server. It cannot start a terminal session, only upload files over FTP. In the linux folder in examples is an example script on how to unheatshrink a file automatically after receiving it.
Contributing
- There is no option to send files uncompressed for now. This might be a useful addition.
- There is no option to download files from the same ftp server.
- A nice update would be to let the user instantiate the particleftpclient and add a reference in the ftpfilesender constructor, so the ftp client can be used for more things than only file sending.
- Another nice update would be to be able to upload a file with the complete file structure on the sd card.
LICENSE
Copyright 2017 wvdv2002
Licensed under the ISC license
Browse Library Files