nRF5 IoT SDK  v0.9.0
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
TFTP

Trivial File Transfer Protocol (TFTP) is a simple protocol to transfer files over the IP network. It operates on the UDP layer and delivers basic functionalities like flow control, parameters negotiation, or error notification.

TFTP currently only operates on Nordic's IPv6 stack, and two examples have been prepared to show Nordic's TFTP Client capabilities. The configuration of the TFTP server has been described in the following section.

TFTP client example

DFU over TFTP example

Setup of a TFTP server on Linux

There are many free TFTP servers, but we have tested with the tftp-hpa server (tftpd-hpa) and recommend you use that one.

Installing on Ubuntu/RPi

Install the tftpd-hpa package and its dependencies by typing:

sudo apt-get install tftpd-hpa

If that operation ends successfully, you can go directly to the configuration section - Configuring the TFTP server service.

Installing from sources

If there is no official package for your distribution, you can install it from an official Linux kernel repository:

  1. Install the Git content tracker.
  2. Download files from the repository:
    git clone git://git.kernel.org/pub/scm/network/tftp/tftp-hpa.git
    By default it will create the directory tftp-hpa and download all source files.
  3. Follow the instructions for building and installing.

Configuring the TFTP server service

By default, the tftp-hpa server listens only on IPv4 addresses, so it is necessary to change its configuration file. Replace the contents with the following configuration:

# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS="[::]:69"
TFTP_OPTIONS="-s -l -6 -c"

Create the TFTP serving folder:

sudo mkdir /srv/tftp

Restart the service by typing:

sudo service tftpd-hpa restart
Note
The root path for TFTP transmission is /srv/tftp
Remember to set the correct owner of the files placed in this folder.
// inside /srv/tftp
sudo chown tftp:tftp FILE