A FTP server for under 70 $

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
gallegojm
Posts: 42
Joined: Mon Apr 06, 2015 2:02 am
Location: Cumaná, Venezuela
Contact:

A FTP server for under 70 $

Postby gallegojm » Fri Apr 17, 2015 6:00 pm

This is what cost a STM32-E407 and a 32 GB microSD
I adapt my ftp server for Arduino Due (see my post on Arduino forum) to the STM32-E407 and ChibiOS
The software is on Github and is developed under ChibiStudio and chibios 2.6.7
This is my first project with ChibiOS so please be indulgent ... :)
User name is STM32-E407 and password is chibi. They are defined in ftps/ftps.h with other parameters
I use dhcp so LWIP_DHCP is defined to 1 in file lwipthread.c
Tested with the following clients: FTP Rush and Filezilla under windows, gFTP and Filezilla under linux
The following commands are implemented:
USER, PASS
CDUP, CWD, QUIT
MODE, STRU, TYPE
PASV, PORT
DELE
LIST, MLSD, NLST
NOOP, PWD
RETR, STOR
MKD, RMD
RNTO, RNFR
FEAT, SIZE
SITE FREE
There are more details in file readme.txt
I would appreciate remarks, suggestions, testing, ...

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: A FTP server for under 70 $

Postby Giovanni » Tue Apr 21, 2015 6:30 pm

Very interesting project I must say :)

Probably it would be a good idea to port to ChibiOS 3.0 and put it as demo in the community repository.

Giovanni

gallegojm
Posts: 42
Joined: Mon Apr 06, 2015 2:02 am
Location: Cumaná, Venezuela
Contact:

Re: A FTP server for under 70 $

Postby gallegojm » Thu Apr 30, 2015 5:17 am

Thank you for your interest!

put it as demo

Well, for this, I must first polish the code and make the server capable of supporting multiple clients.
It is for this purpose that I worked on the web server presented in another post, because I think it is simpler and easier for me to concentrate on the multithreading aspect.I would like to know if my approach is correct.

port to ChibiOS 3.0

I have two questions about ChibiOS 3.0:
- is it actually stable enough?
- is there a post that resume the benefits and progress against version 2.6?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: A FTP server for under 70 $

Postby Giovanni » Thu Apr 30, 2015 9:04 am

Hi,

ChibiOS 3.0 has been stable enough for one year now. It is generally faster and includes new features (tickless mode, statistics and other things).

This a work document but still valid: http://www.chibios.org/dokuwiki/doku.ph ... _and_ideas

Giovanni

gallegojm
Posts: 42
Joined: Mon Apr 06, 2015 2:02 am
Location: Cumaná, Venezuela
Contact:

FTP server is now multi clients

Postby gallegojm » Thu Jun 25, 2015 8:25 pm

I put in GitHub the new version of my FtpServer.

It is compiled with ChibiOS version 3.0.0p5 and support multiple simultaneous clients.

Since a couple of weeks, I use it to store the images produced by IP cameras connected to the same local network.
The uploading and downloading speed is more than adequate for this application.

The number of simultaneous clients is defined by FTP_NBR_CLIENTS in file ftps.h
I set it to 5 for my own use ( 4 cameras and a client to download the images) but it can be increased.
Some definitions in lwipopts.h depend on the number of clients. The details are in the file readme.txt

I tested with the following clients:
on Windows: FTP Rush, Filezilla
on Ubuntu: gFTP, Filezilla
on Android: AndFTP
IP cameras: Panasonic BLC-131, Trendnet TV-IP121W, D-Link DCS-930L

Please feel free to download, test and make remarks...

gallegojm
Posts: 42
Joined: Mon Apr 06, 2015 2:02 am
Location: Cumaná, Venezuela
Contact:

FTP server now use RTC to timestamp files

Postby gallegojm » Mon Aug 03, 2015 11:09 pm

A new version is on GitHub.

The server now use the RTC clock to timestamp the uploaded files.
A NTP client is used to synchronize the clock.

A logger (using ChibiOS Messages) allows recording of events or statistics. It is useful to monitor the clock synchronization which is done every 24 hours.
You must create in the SD card the subdirectory /Log where are stored those files.

A new command: STAT (Status) returns some data from the server, especially the date and time.

It is compiled with ChibiOS 3.0
Configuration of the local IP and Mac address is done in main.cpp thanks to the patch lwip_bindings.zip uploaded by steved at:
download/file.php?id=863

User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Location: South Korea
Has thanked: 3 times
Been thanked: 3 times

Re: A FTP server for under 70 $

Postby DeusExMachina » Tue Apr 19, 2016 5:07 am

Interesting project! I wish I had time to check it :)

gallegojm
Posts: 42
Joined: Mon Apr 06, 2015 2:02 am
Location: Cumaná, Venezuela
Contact:

Re: A FTP server for under 70 $

Postby gallegojm » Mon May 02, 2016 6:14 pm

Hi DeusExMachina

Thank you for your interest!

Yesterday, Venezuela, where I am living, changed time zone, returning to what it was in 2007. So I have to recompile the code of my server, as time zone is hard coded.

The server was working without any interruption since the beginning of November of last year.

I took the opportunity to refresh the Github repository.

The other, and more interesting change since the last update, concerns the frequency of the RTC clock. It is now recalibrated each time a NTP server is called, using the register RTC_CALR of the STM32-E407 microcontroller. For monitoring purpose, the value written to this register is now stored in the file \Log\rtc.log

franek.bmw
Posts: 57
Joined: Thu Mar 13, 2014 11:15 am
Has thanked: 2 times

Re: A FTP server for under 70 $

Postby franek.bmw » Wed Apr 12, 2017 9:20 am

Hello,
I tested FTP and I have a problem. Everything works except transmission of .jpg files. There are always some problem and the transmitted image is very distorted. Do you know what could be the reason for this? With txt files all is correct.

Could anyone help me?

Best regards,
Franek

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: A FTP server for under 70 $

Postby Giovanni » Wed Apr 12, 2017 10:24 am

If I remember well FTP has a binary mode, probably you have to choose that in your client.

Giovanni


Return to “User Projects”

Who is online

Users browsing this forum: No registered users and 6 guests