Hi all,
I'm working on a project that combines a HTTP and FTP servers. The FTP server was implemented in later stage in the project because of the need to transfer large amount of data approximately 1 GB of data file. The applications both the ftp and the http are using raw PAW on top of lwIP.
Since the http server was provided by the vendor Atmel, there are no many problems with it.
My problem occurs when I want to implement both two applications to run at the same time, at the current state the ftp works if the http is enabled and other way around.
Brief Periodically retrigger timeout process.
After managing the lwIP timers. trigger corresponding ethernet process.
////////////////////////////////////////////////////////////////////////////////////////////////////////////
~~~
void ethernettask(void)
{
/* Run polling tasks */
ethernetifinput(&gsnetif);
/* Run periodic tasks */
timers_update();
}
~~~
Brief Create ethernet task, for ethernet management.
////////////////////////////////////////////////////////////////////////////////////////////////////////////
~~~
void initethernet(void)
{
/** set a unique MAC address from falsh**/
setMAC_addresses();
/** Initialize lwIP */
lwip_init(); //initializes the functions enabled in lwipopts.h
/** Set hw and IP parameters, initialize MAC too */
ethernet_configure_interface();
//LLMNR_init(&gs_net_if); //initializes the LLMNR responder
if defined(HTTPRAWUSED)
/** Bring up the web server */
http_init();
endif
if defined(FTPRAWUSED)
/** Bring up the FTP server */
ftpd_init();
endif
}
~~~
////////////////////////////////////////////////////////////////////////////////////////////////////////////
~~~
define TASKwebserverSTACKSIZE (4096/sizeof(portSTACKTYPE))
define TASKwebserverSTACKPRIORITY (tskIDLEPRIORITY + 3)
~~~
////////////////////////////////////////////////////////////////////////////////////////////////////////////
~~~
static void webservertask(void *pvParameters)
{
UNUSED(pvParameters);
/** Wait for user to read instructions. */
WAITFOR_EVENT;
while (1) {
ethernet_task();
}
}
~~~
//////////////////////////////////////////////////////
MAIN.
~~~
sysclkinit();
boardinit();
init_ethernet();
if (xTaskCreate(webservertask, "webserver", TASKwebserverSTACKSIZE, NULL,TASKwebserverSTACK_PRIORITY, NULL) != pdPASS) {
}
~~~
My question is how I can possibly proceed to get the two servers working?
Should I create another task for the FTP server?
Thanks in advance!
I'm afraid lwIP support is out of scope for this forum. We do however
have our own FTP and [basic] HTTP examples running on Atmel hardware:
http://www.freertos.org/FreeRTOS-Plus/FreeRTOSPlusTCP/TCPIPFATExamplesAtmelSAM4E.html
Thank you for your quick response!!
To simplify my question... Why the FTP server cannot work when I enable the HTTP server.?
Do I have to cr4eate a separate task?
Thank you!!
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.