1. 程式人生 > >[mini2440]tftp download file to arm

[mini2440]tftp download file to arm

1. Arm already had tftp client, because busybox include "tftp" command.

2.Install tftp server in ubuntu, see appendix.

3.Connect arm board to main computer network, such as connect to a same router.

Make sure that vritual machine using "bridge" mode as below:

Config mini2440 network.

vi /etc/eth0-setting

Note: vi must using "h","j", "k", "l" to move edite place.

After reboot the arm board, using "ping" command to test if connect to virtual machine ubuntu (Both bing ok to each other).

As below: (Of cause, not always need ping www.baidu.com)

Error: Sometime doesn't connet to the net, maybe need use computer to login the net first.

4.Get file from server.

tftp -g -r test.txt 192.168.xxx.xxx

 

Appendix 1 TFTP server in win7

1.Download from official site: http://tftpd32.jounin.net/tftpd32_download.html Then install.

(to be continue ...)

Appendix 2 TFTP server in ubuntu.

NOTE: 'NAT' mode also work, although ip is not in same stage, but if can ping ok each other, so can send file.

1.Install TFTP.

sudo apt install tftp-hpa tftpd-hpa

2.Creat directory.

cd 
mkdir tftpboot
cd tftpboot
vim test.txt

3.Config

cd /etc/default/
vim tftpd-hpa

tftp-hpa is:

# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="~/tftpboot" # 這裡是你的tftpd-hpa的服務目錄,這個想建立在哪裡都行
TFTP_ADDRESS=":69"
TFTP_OPTIONS="-l -c -s" # 這裡是選項,-c是可以上傳檔案的引數,-s是指定tftpd-hpa服務目錄,上面已經指定 

4.reset

sudo service tftpd-hpa restart

5.test

$ tftp localhost
tftp> get test.txt
tptp> put text1.txt

(end)