C:\Users\hajime>tftp -i 192.168.1.23 put sample.txt Transfer successful: 153 bytes in 1 second(s), 153 bytes/s
C:\Users\hajime>tftp -i 192.168.1.23 get hello.c Transfer successful: 63 bytes in 1 second(s), 63 bytes/s
C:\Users\hajime>tftp
Transfers files to and from a remote computer running the TFTP service.
TFTP [-i] host [GET | PUT] source [destination]
-i Specifies binary image transfer mode (also called octet). In binary image mode the file is moved literally, byte by byte. Use this mode when transferring binary files. host Specifies the local or remote host. GET Transfers the file destination on the remote host to the file source on the local host. PUT Transfers the file source on the local host to the file destination on the remote host. source Specifies the file to transfer. destination Specifies where to transfer the file.
Linuxでは、つぎのようなコマンドが使えます。
hajime@vm:~$ tftp tftp> connect 192.168.1.23 tftp> binary tftp> get hello.c Received 63 bytes in 0.0 seconds tftp> put helloworld.c Sent 97 bytes in 0.0 seconds
tftp> ? Commands may be abbreviated. Commands are:
connect connect to remote tftp mode set file transfer mode put send file get receive file quit exit tftp verbose toggle verbose mode trace toggle packet tracing status show current status binary set mode to octet ascii set mode to netascii rexmt set per-packet retransmission timeout timeout set total retransmission timeout ? print help information tftp> q hajime@vm:~$
使い方は簡単なのですが、セットアップには、いくつかのピットフォール(落とし穴)があり、
そう簡単には動きませんでした (^_^;)
まず、Raspberry PiにTFTPサーバーをインストールします。
つぎのコマンドでインストールできます。
sudo apt-get install tftpd-hpa
ところが、なんということでしょう~
結果は、つぎのように、TFTPサーバーはエラーで起動しませんでした!
pi@raspberrypi ~ $ sudo apt-get install tftpd-hpa Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: syslinux-common The following NEW packages will be installed: tftpd-hpa 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 46.1 kB of archives. After this operation, 142 kB of additional disk space will be used. Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main tftpd-hpa armhf 5.2-4 [46.1 kB] Fetched 46.1 kB in 1s (25.3 kB/s) Preconfiguring packages ... Selecting previously unselected package tftpd-hpa. (Reading database ... 77058 files and directories currently installed.) Unpacking tftpd-hpa (from .../tftpd-hpa_5.2-4_armhf.deb) ... Processing triggers for man-db ... Setting up tftpd-hpa (5.2-4) ... [....] Starting HPA's tftpd: in.tftpdinvoke-rc.d: initscript tftpd-hpa, action "start" failed. dpkg: error processing tftpd-hpa (--configure): subprocess installed post-installation script returned error exit status 71 Errors were encountered while processing: tftpd-hpa E: Sub-process /usr/bin/dpkg returned an error code (1) pi@raspberrypi ~ $