Embedded FTP client

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Could anyone point me in the right direction in setting up an ftp client on custom board using the 32uc3a1512. I'm using FreeRTOS and lwIP 1.2.0. I've got an http server going by adapting the example but, as yet, am struggling to find anything useful regarding ftp.

The idea is to have the device log onto an ftp server (running on an XP machine) and upload a text file every so often.

Thank you,

Phil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Check the software framework :-)
avr32/services/os/freertos/demo/lwip_avr32_uc3_dhcp_example (basic two-in-one web server and TFTP server demo) :-)

http://asf.atmel.no/source/asf-2...
http://asf.atmel.no/readme.html

-sma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the response sma. The problem here though is that I want to be a FTP client. I've looked into the TFTP server and I don't think it'll meet my needs here. There's also some worry about port 69 being blocked by firewalls and such...

I've just started looking through the SMTP example (as it's a client) and it seems to be rather helpful. It would seem the only real change that need be made is the negotiation of the data connection...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just in case anyone comes across this thread and wishes to know the result; the approach starting from the smtp client example worked :D

I modified it using this as a reference http://www.eventhelix.com/RealtimeMantra/Networking/FTP.pdf

For the activity on port 21 I borrowed from the http server example to get it working in the active connection mode.

There are quite a few network connections involved, I'd caution watching that you close and delete them timeously.

Also, in my opinion, sticking all those cascading if statements into a state machine helps make it a whole lot easier to read and modify.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Phil,

Sounds like you already have a solution, but I found this a while back while browsing around for lwIP information. Might be useful:

http://savannah.nongnu.org/task/...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey rlemaster,

Thanks for the link. I was sceptical of the authors implementation as he wrote his own socket API while lwIP already has a perfectly good one imho...

Aside from that, there was a good reason why I didn't use his code as a reference for the actual client, I just cannot remember what it was :oops:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Maddy2k,

That does look like a rather neat implementation. Will have to go through it properly sometime and see what there is that I'm leaving out...