Pages: 1 [2] 3   Go Down
Author Topic: Ftp Server on Arduino  (Read 4409 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok,

I found this site:  http://code.google.com/p/sdfatlib/
And this version that brought Santa Claus Dec 25:  sdfatlib20131225.zip

And the other:

http://arduiniana.org/libraries/streaming/
The latest version:  Streaming5.zip

I hope this is correct. I'll try with Mega2560.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The SdFat:  http://code.google.com/p/sdfatlib/
And this version that brought Santa Claus Dec 25:  sdfatlib20131225.zip

Installed and Checked, SD Info is very good and long names too.
With default: Arduino Ethernet shield, pin 4.

I Get this SDInfo:

Code:
SdFat version: 20131225

type any character to start

init time: 3 ms

Card type: SD2

Manufacturer ID: 0X2
OEM ID: TM
Product: SA01G
Version: 0.3
Serial number: 151072924
Manufacturing date: 3/2010

cardSize: 987.76 MB (MB = 1,000,000 bytes)
flashEraseSize: 128 blocks
eraseSingleBlock: true

SD Partition Table
part,boot,type,start,length
1,0X0,0X6,39,1927232
2,0X0,0X0,0,0
3,0X0,0X0,0,0
4,0X0,0X0,0,0

Volume is FAT16
blocksPerCluster: 32
clusterCount: 60210
freeClusters: 17420
freeSpace: 285.41 MB (MB = 1,000,000 bytes)
fatStartBlock: 40
fatCount: 2
blocksPerFat: 236
rootDirStart: 512
dataStartBlock: 544
Data area is not aligned on flash erase boundaries!
Download and use formatter from www.sdcard.org/consumer!

type any character to start

The Streaming from: http://arduiniana.org/libraries/streaming/
The latest version:  Streaming5.zip

Installed and Checked, I get from Serial port this:

Code:
This is an example of the new streaming
library.  This allows you to print variables
and strings without having to type line after
line of Serial.print() calls.  Examples:
A is 65.
The current date is 17-4-2009.
You can use modifiers too, for example:
A is 41 in hex.


I do the adds In File EthernetServer.h add:
Code:
           EthernetClient connected();


and the other file  EthernetServer.h add:
Code:
           EthernetClient EthernetServer::connected()
           {
             accept();
             for( int sock = 0; sock < MAX_SOCK_NUM; sock++ )
               if( EthernetClass::_server_port[sock] == _port )
               {
                 EthernetClient client(sock);
                 if( client.status() == SnSR::ESTABLISHED ||
                     client.status() == SnSR::CLOSE_WAIT )
                   return client;
               }
             return EthernetClient(MAX_SOCK_NUM);
           }



But only see this error compiling FTPServeur:

Code:
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'


I appreciate your time and attention.
Logged

Offline Offline
Jr. Member
**
Karma: 3
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you very much

Want to think optimistically we're making progress.

My Arduino IDE is 1.0.5 version Windows and try this with Mega2560


Code:
FtpServeur\FtpServer.cpp.o:(.bss.ftpServer+0x0): multiple definition of `ftpServer'
FtpServer.cpp.o:(.bss.ftpServer+0x0): first defined here
d:/arduino/arduino-1.0.5/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions
FtpServeur\FtpServer.cpp.o: In function `FtpServer::readChar()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:517: multiple definition of `FtpServer::readChar()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:517: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::closeTransfer()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:491: multiple definition of `FtpServer::closeTransfer()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:491: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::doStore()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:475: multiple definition of `FtpServer::doStore()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:475: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::doRetrieve()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:462: multiple definition of `FtpServer::doRetrieve()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:462: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::disconnectClient()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:116: multiple definition of `FtpServer::disconnectClient()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:116: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::userIdentity()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:122: multiple definition of `FtpServer::userIdentity()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:122: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::userPassword()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:139: multiple definition of `FtpServer::userPassword()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:139: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::clientConnected()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:108: multiple definition of `FtpServer::clientConnected()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:108: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::processCommand()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:155: multiple definition of `FtpServer::processCommand()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:155: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::service()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:42: multiple definition of `FtpServer::service()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:42: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::init()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:25: multiple definition of `FtpServer::init()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:25: first defined here
FtpServeur\LongNames.cpp.o: In function `dirLfnNext(char*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/LongNames.cpp:49: multiple definition of `dirLfnNext(char*)'
LongNames.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/LongNames.cpp:49: first defined here
FtpServeur\LongNames.cpp.o: In function `dirLfnFirst(char*, char*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/LongNames.cpp:32: multiple definition of `dirLfnFirst(char*, char*)'
LongNames.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/LongNames.cpp:32: first defined here
FtpServeur\LongNames.cpp.o: In function `l2sName(char*, char*, char*, unsigned int)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/LongNames.cpp:136: multiple definition of `l2sName(char*, char*, char*, unsigned int)'
LongNames.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/LongNames.cpp:136: first defined here
FtpServeur\LongNames.cpp.o: In function `l2sPath(char*, char*, unsigned int)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/LongNames.cpp:161: multiple definition of `l2sPath(char*, char*, unsigned int)'
LongNames.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/LongNames.cpp:161: first defined here
FtpServeur\SdList.cpp.o: In function `SdList':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:7: multiple definition of `SdList::SdList()'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:7: first defined here
FtpServeur\SdList.cpp.o: In function `SdList':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:7: multiple definition of `SdList::SdList()'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:7: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::free()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:81: multiple definition of `SdList::free()'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:81: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::capacity()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:76: multiple definition of `SdList::capacity()'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:76: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::openFile(SdFile*, char const*, unsigned char)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:66: multiple definition of `SdList::openFile(SdFile*, char const*, unsigned char)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:66: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::nextFile(char*, bool*, unsigned long*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:48: multiple definition of `SdList::nextFile(char*, bool*, unsigned long*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:48: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::rename(char const*, char const*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:45: multiple definition of `SdList::rename(char const*, char const*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:45: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::chdir(char const*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:11: multiple definition of `SdList::chdir(char const*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:11: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::rmdir(char const*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:40: multiple definition of `SdList::rmdir(char const*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:40: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::mkdir(char const*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:32: multiple definition of `SdList::mkdir(char const*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:32: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::remove(char const*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:27: multiple definition of `SdList::remove(char const*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:27: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::exists(char const*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:19: multiple definition of `SdList::exists(char const*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:19: first defined here
« Last Edit: June 09, 2014, 03:23:18 pm by riphet » Logged

Offline Offline
Jr. Member
**
Karma: 3
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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;
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can post the code its latest version including corrections you use?

I'm a newbie and not clear: how to make this last correction.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Feeling optimistic.

Maybe forgetting something, now with arduino-1.5.6-r2


Code:
Arduino: 1.5.6-r2 (Windows XP), Placa:"Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

FtpServer.cpp: In member function 'void FtpServer::service()':
FtpServer.cpp:58: error: ambiguous overload for 'operator==' in '((FtpServer*)this)->FtpServer::client == 1'
FtpServer.cpp:58: note: candidates are: operator==(int, int) <built-in>
D:\Arduino\arduino-1.5.6-r2\libraries\Ethernet\src/EthernetClient.h:27: note:                 virtual bool EthernetClient::operator==(const EthernetClient&)

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 31
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


As far as I did.

This does not work with Mega2560

maybe with Due

I appreciate related information.
Logged

Offline Offline
Jr. Member
**
Karma: 3
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could You tell me which libraries you used.
I keep getting compile errors when I try to compile ftpServeur.ino.
for example:
In file included from D:\arduino-1.0.5\Projecten\libraries\SdFat/SdStream.h:27,
                 from D:\arduino-1.0.5\Projecten\libraries\SdFat/SdFat.h:39,
                 from FtpServeur.ino:9:
D:\arduino-1.0.5\Projecten\libraries\SdFat/iostream.h: In function 'ostream& endl(ostream&)':
D:\arduino-1.0.5\Projecten\libraries\SdFat/iostream.h:40: error: 'ostream& endl(ostream&)' redeclared as different kind of symbol
D:\arduino-1.0.5\libraries\Streaming/Streaming.h:100: error: previous declaration of '_EndLineCode endl'

I don't know what to do to solve that.
Logged

Offline Offline
Jr. Member
**
Karma: 3
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everybody,

I spent some time debugging this FTP server library after the RX poor performances.

This is what I found out : in FtpServer:doStore function, I added a printf (commented here below) in order to understand what was happening :
Code:
boolean FtpServer::doStore()
{
  if( data.connected() )
  {
    int16_t nb = data.read( buf, FTP_BUF_SIZE );

    if( nb > 0 )
    {
//Serial << millis() << " " << nb << endl;
      file.write( buf, nb );
      bytesTransfered += nb;
    }
tlStoring = true;
    return true;
  }
  closeTransfer();
  return false;
}

Actually, this function is called many times, waiting the W5100 to have something in his RX buffer. In fact, the 2K RX buffer is filled up "rapidly" and then nothing is available for about 170 ms.
Code:
millis() nb Timediff (ms)
416442 128
416448 128 6
416450 128 2
416452 128 2
416454 128 2
416456 128 2
416458 128 2
416460 128 2
416462 128 2
416464 128 2
416466 128 2
416468 128 2
416471 128 3
416473 128 2
416475 128 2
416477 128 2
416645 128 168
416647 128 2
416649 128 2
416650 128 1
416653 128 3
416655 128 2
416657 128 2
416659 128 2
416661 128 2
416663 128 2
416665 128 2
416667 128 2
416669 128 2
416671 128 2
416673 128 2
416675 128 2
416847 128 172
416849 128 2
416851 128 2
416854 128 3
416856 128 2
416858 128 2
416860 128 2
416862 128 2
416864 128 2
416866 128 2
416868 128 2
416870 128 2
416873 128 3
416874 128 1
416876 128 2
416878 128 2
417051 128 173
.......

I tried with a different FTP buffer size (FTP_BUF_SIZE), ie 256 and 512 and the behaviour is still the same ?!

I found a way to increase the W5100 RX buffer but as its maximum size is 8K divided by the number of sockets and taking into account the fact that I need these 4 sockets, I am not able to do that... :-(

The problem is that the maxiumum RX bandwidth I am able to reach is 80 Kbits/s !

Any idea here ?

Thanks,
Thierry
Logged

Offline Offline
Jr. Member
**
Karma: 3
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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



Hi gallegojm,

I have follow your instruction to modify the iostream.h as above quote.
But I found following compiling error:

---------------------------------------------------------------------------------------------------
C:\Program Files\Arduino\libraries\BS_Arduino-Ftp-Server-master\FtpServer.cpp: In member function 'void FtpServer::service()':
C:\Program Files\Arduino\libraries\BS_Arduino-Ftp-Server-master\FtpServer.cpp:121:24: error: 'class EthernetServer' has no member named 'connected'
     client = ftpServer.connected();
                        ^
C:\Program Files\Arduino\libraries\BS_Arduino-Ftp-Server-master\FtpServer.cpp: In member function 'int FtpServer::dataConnect()':
C:\Program Files\Arduino\libraries\BS_Arduino-Ftp-Server-master\FtpServer.cpp:842:25: error: 'class EthernetServer' has no member named 'connected'
       data = dataServer.connected();

---------------------------------------------------------------------------------------------------

Could you please help ...
Logged

Offline Offline
Jr. Member
**
Karma: 3
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
C:\Program Files\Arduino\libraries\BS_Arduino-Ftp-Server-master\FtpServer.cpp: In member function 'void FtpServer::service()':
C:\Program Files\Arduino\libraries\BS_Arduino-Ftp-Server-master\FtpServer.cpp:121:24: error: 'class EthernetServer' has no member named 'connected'
     client = ftpServer.connected();
                        ^

Hi badank
Did you modify EthernetServer.h and EthernetServer.cpp as I explain in FtpServer.ccp on lines  11 to 32 ?
Remember to restart the ide after you make the modification.
Logged

Pages: 1 [2] 3   Go Up
Jump to: