Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Networking, Protocols, and Devices / Re: Ftp Server on Arduino on: June 25, 2014, 12:15:45 pm
Quote
I spent some time debugging this FTP server library after the RX poor performances.

After reading your post I make the following comparative test:
I run the ftp server on three hardware configurations:
 - Arduino Mega 2560 with Arduino Ethernet shield ( based on Wiznet 5100 )
 - Arduino Due with the same Arduino Ethernet shield
 - Arduino Due with Wiz820io module ( based on Wiznet 5200 )
The Wiz820io module is not 5V compliant, so  I can't connect it to the Mega 2560.
In all configurations I upload the same file of 3,7 Mega bytes from a FtpRush client.
The results:
   time   speed
Mega + W5100   8m 44s   7,33 kbytes/s
Due + W5100   8m 43s   7,33 kbytes/s
Due + W5200   22,12s   173,5 kbytes/s

Using the Wiznet 5100, I obtain the same speed with both boards, so it is obvious the Wiznet 5100 is the bottleneck. You get the same conclusion:
Quote
this function is called many times, waiting the W5100 to have something in his RX buffer

With Arduino Due, Wiznet 5200 is approximately 20 times faster than Wiznet 5100. According to the documentation, this is mainly due to the High Speed Serial Peripheral Interface (SPI Mode 0,3) of the Wiznet 5200. I read somewhere than the SPI frequency of Wiznet 5200 is 80 MHz anf only 4 MHz for Wiznet 5100. That is the same ratio than I get with my test.
But replacing the Wiznet 5100 by a Wiznet 5200 on an Arduino Mega 2560 would not increase the speed so much. Because the next limitation would be the max speed of the SPI interface of the ATmega2560. As it is clocked to 16MHz, I guess the speed limit of the SPI interface is the half, 8 MHz.

So, "the RX poor performance", as you say, is due to your hardware.

Note that they are now several manufacturers of shields equiped with the Wiznet 5200, so you don't need to adapt a Wiz820io as I do. And they work with 5V or 3,3V boards.
2  Using Arduino / Networking, Protocols, and Devices / Re: Ftp Server on Arduino on: June 14, 2014, 08:03:57 pm
Quote
Could You tell me which libraries you used.
you need to install SdFat and Streaming libraries

Use version 1.5.6-r2 of Arduino IDE
Don't forget to modify iostream.h  of SdFat library as explained in Reply #17
And modify EthernetServer.h and EthernetServer.cpp as explained in the header of FtpServer.cpp
3  Using Arduino / Networking, Protocols, and Devices / Re: Ftp Server on Arduino on: June 10, 2014, 09:19:56 pm
I upload to GitHub the last version of my Ftp Server.
It now also works with Arduino Mega2560
The software is on GitHub at http://github.com/gallegojm/Arduino-Ftp-Server
4  Using Arduino / Networking, Protocols, and Devices / Re: Ftp Server on Arduino on: June 09, 2014, 03:25:29 pm
Quote
My Arduino IDE is 1.0.5 version Windows and try this with Mega2560
I suggest you to download version 1.5.6-r2 of Arduino Software
They said it is beta but it is really stable.
I probe just now to compile FtpServeur.ino selecting Arduino Mega2560 with no problem
Remember to make the change suggested by Thierry:
Code:
FtpServer.cpp : line 101 : millisTimeOut = FTP_TIME_OUT * 60 * 1000 => millisTimeOut = (uint32_t)FTP_TIME_OUT * 60 * 1000;
5  Using Arduino / Networking, Protocols, and Devices / Re: Ftp Server on Arduino on: June 09, 2014, 02:22:01 pm
Quote
But only see this error compiling FTPServeur:

In file included from D:\Arduino\arduino-1.0.5\libraries\SdFat/SdStream.h:27,
                 from D:\Arduino\arduino-1.0.5\libraries\SdFat/SdFat.h:39,
                 from /FtpServer.h:31,
                 from FtpServer.cpp:20:
D:\Arduino\arduino-1.0.5\libraries\SdFat/iostream.h: In function 'ostream& endl(ostream&)':
D:\Arduino\arduino-1.0.5\libraries\SdFat/iostream.h:40: error: 'ostream& endl(ostream&)' redeclared as different kind of symbol
D:\Arduino\arduino-1.0.5\libraries\Streaming/Streaming.h:100: error: previous declaration of '_EndLineCode endl'

You right.
I forgot to mention that endl is defined twice: once in Streaming.h (line 100) and again in iostream.h of SdFat library.
So you have to eliminate one of this definition.
I comment lines 40 to 43 in iostream.h
Code:
/** insert endline
 * \param[in] os The Stream
 * \return The stream
 */
 /*             <==  ADD THIS LINE
inline ostream& endl(ostream& os) {
  os.put('\n');
#if ENDL_CALLS_FLUSH
  os.flush();
#endif  // ENDL_CALLS_FLUSH
  return os;
}
*/            <==  AND THIS
The error must disappear, keep me informed
6  Using Arduino / Networking, Protocols, and Devices / Re: Ftp Server on Arduino on: June 07, 2014, 05:36:35 pm
Remember you need to install SdFat and Streaming libraries in order to run this sketch
Have a look a this link if you don't know how to install libraries: http://arduino.cc/en/Guide/Libraries
7  Using Arduino / Networking, Protocols, and Devices / Re: Ftp Server on Arduino on: May 20, 2014, 07:30:54 pm
Quote
Concerning the change I made :
FtpServer.cpp : line 101 : millisTimeOut = FTP_TIME_OUT * 60 * 1000 => millisTimeOut = (uint32_t)FTP_TIME_OUT * 60 * 1000;
I did that because the timeout systematically triggered because millisTimeOut was not casted to uint32.
Thank you Thierry for the correction.
It is not necessary with the 32 bit CPU of a Due but needed with the Mega.
Speaking of Due and Mega... I think that once you have replaced the ethernet controller with a W5200, throughput will be limited by the speed of the ATmega2560. Maybe you have to consider the use of an Arduino Due
By the way, your project looks great!
8  Using Arduino / Networking, Protocols, and Devices / Re: Ftp Server on Arduino on: May 16, 2014, 11:30:37 pm
Quote
I made some debugging and found that the data.read call in FtpServer::doStore very often returns 0 meaning the Arduino board is waiting for the FTP client to send something

More precisely, the Arduino is waiting for the ethernet controller to receive data. The latter is the bottleneck, not the FTP client.
9  Using Arduino / Networking, Protocols, and Devices / Re: Ftp Server on Arduino on: May 16, 2014, 11:53:50 am
First of all, I am happy to know that this application runs on an Arduino Mega.
Secondly, I would like more clarification on the 'tiny bug fix'. Is it specific to Mega?
There certainly has room for improvement in my code, or to correct errors.
About the transfer velocity, as you know, this is the slowest link which affects the final speed.
Here, I think the most penalizing links are ethernet controller, memory card and how it is connected to the microcontroller.
With a Wiznet Wiz820io and a generic micro SDHC card connected directly to the SPI bus of an Arduino Due (only possible with 3V3 micros, don't try this with your Mega!) I get write transfers above 130 Kbytes per second speeds on files of several mega size, using FTP Rush
I made my first test with an ethernet shield equipped with the W5100 controller and I remember that the bitrate was in the order you specify.
You can now find shields equipped controller W5200, without the necessity to adapt a Wiz820io yourself as I do
About Filezila: do you have the same problem as me, about the fact that FileZila seeks to reconnect before starting a transfer?
Thank you for your interest in my library
10  Using Arduino / Networking, Protocols, and Devices / Re: Ftp Server on Arduino on: May 16, 2014, 11:51:56 am
I receive this message from Thierry and I think this discussion may be of interest to other people, so I transcribe his message:
Quote
Hi,

I recently had to implement a FTP server on a Arduino Mega board and I found yours very interesting !
It works fine after a tiny bug fix (timeout casting).

My problem now is that it is quite slow when storing data on my embedded SD card.
I made some debugging and found that the data.read call in FtpServer::doStore very often returns 0 meaning the Arduino board is waiting for the FTP client to send something. I tried with several FTP Client as Filezila running on a PC and it seems the consequence of this is that the maximum rate is abouty 10 KBits/s...

Did you face this kind of problem as well ?

Thanks for your help and, once again, thanks a lot for your hard work on the FTP protocol implementation !

Regards,
Thierry
11  International / Français / Re: DUE + Shield Ethernet W5200 Seeedstudio on: May 03, 2014, 11:11:20 pm
Bonjour!
Je pense que ton problème n'est pas dû au W5200 mais plutôt à un conflit au niveau du bus SPI entre le W5200 et la carte mémoire.
Pour ma part, je fais fonctionner ensemble un circuit Wiz820io (à base de W5200), une mémoire SD et un décodeur MP3 (circuit VS1053).
Il faut, entre autre, prendre quelques précautions au niveau de la sélection des pins Chip Select de chacun de ces circuits.
J'ai posté un petit article qui peut t'intéresser: http://forum.arduino.cc/index.php?topic=167068.0
12  Development / Other Software Development / Re: Updated versions of ChibiOS/RT, NilRTOS, and FreeRTOS on: April 11, 2014, 12:40:11 pm
I plan to modify my ftp server ( http://forum.arduino.cc/index.php?topic=182382.0 ) so it works under one of the rtos ChibiOS/RT, NilRTOS or FreeRTOS.
The server make use of libraries SdFat and Ethernet.
After reading different posts on the blog, I have some questions:
- Does one of this os allows me to use simultaneously two (or more) devices accessed through SPI?
- Would it be possible to have two thread, one reading a file, an other creating and writing to file, working simultaneously?
- Witch of this os would be the most adapted?
 I understand, after searching the forum, than I should make some changes in the libraries, such as removing the calls to the delay() function, but I think the effort is worth it.
13  Development / Suggestions for the Arduino Project / Re: FREE RTOS INTO THE IDE on: April 02, 2014, 10:22:44 am
I support!
14  Development / Other Software Development / Re: How to Port FreeRTOS in Arduino IDE on: March 24, 2014, 02:36:34 pm
Hi
As we are in the forum dedicated to Due, I assume you are trying to use FreeRTOS on a Due.
So you have to use use the FreeRTOS_ARM library. Not the FreeRTOS_AVR one as it seems you are doing:
Quote
frBlinkPrint.ino:3:26: warning: FreeRTOS_AVR.h: No such file or directory
Hope this could help you to solve your problem
15  Using Arduino / Networking, Protocols, and Devices / New version of Ftp Server on Arduino on: March 16, 2014, 07:35:18 pm
Here is the last version of my FTP server:
https://mega.co.nz/#!C5gQHKiR!JcfZ6RoQrLHpvcu0D59IlDmkg4b3c4x7bKqgmWRq8GA
 
It is much more complete than the previous version.
It now accept clients in both active or passive mode.
Here is the list of recognized commands:
   USER, PASS
   CDUP, CWD, QUIT
   MODE, STRU, TYPE
   PASV, PORT
   ABOR
   DELE
   LIST, MLSD, NLST
   NOOP, PWD
   RETR, STOR
   MKD,  RMD
   RNTO, RNFR
   FEAT, SIZE

And an additional command  SITE FREE that send the amount of free space in the SD card and his total capacity.
The library is divided into two classes. One handle the ftp server functions: FtpServer . The other handle the calls to the SdFat library: SdList.
For this version, I abandoned the use of long file names, and the class SdList can seem superfluous but it will facilitate in the future a change in handling of file names (I am working on that).
You must care of not delete or rename a file that has a long name because the SdFat library does not handle it and this would result in orphan directory entries.

The server always works fine with client FTP Rush.
I still do not know how to solve the problem of FileZila with RETR and STOR.
It works well also with gFTP under Ubuntu.
And a second Arduino can connect to Ftp Server running the sketch of SurferTim. You can download it at http://playground.arduino.cc/Code/FTP

As always I would appreciate remarks, suggestions, testing
Pages: [1] 2 3 ... 5