Page 1 of 1

Using TFTP

Posted: Fri Jun 28, 2024 8:30 am
by SeeCwriter
I would like to add TFTP as a server to my NANO project. But the functions in tftp.cpp appear to be designed only for client use. Is there a server option available for the v2.9.5/6/7 version of the tools?

Re: Using TFTP

Posted: Fri Jun 28, 2024 11:14 am
by pbreed
Server sourcing files or receiving files?
Where are the files the server is getting/sending coming from?
Programmatically generated/consumed?
To/From SDRAM?
Device Flash.
Device Flash file system
external SD Fat file system?

TFTP is a really simple protocol would not be hard to do, please be specific about the details...of what transactions you want this server to perform?

Re: Using TFTP

Posted: Fri Jun 28, 2024 12:59 pm
by SeeCwriter
We only need to source/send a file. The file is installed at the factory during the manufacturing process via a different method and stored in EEPROM.
We receive a TCP command to prepare for file transfer, which causes the file to be copied to a buffer in sram. File size is around 128k.

It seems like a simple task could be created that just listened on UDP port 69, and when a WREQ command arrived, it would ack the command and call a modified version of function SendTFTP to send the file.

This is a rather convoluted process to send a file, but we need to be backward compatible with legacy processes.

Re: Using TFTP

Posted: Mon Jul 01, 2024 12:42 pm
by pbreed
I'll try and get this working this week...

Re: Using TFTP

Posted: Wed Jul 03, 2024 10:24 am
by pbreed
Would this work for you:

TFTP_Server MyServer(port_num);

//Now add files to the server....
TFTP_Server_File(MyServer,"Filename.dat", pFileData, file_len);
TFTP_Server_File(MyServer,"Filename2.dat", pFileData2, file_len2);
*
*
*
etc for as many files as you want to serve.

Re: Using TFTP

Posted: Wed Jul 03, 2024 10:30 am
by SeeCwriter
Yes. We only have one file to send.

Re: Using TFTP

Posted: Mon Jul 08, 2024 12:06 pm
by pbreed
Done, submit a support request to get the code.