1. 程式人生 > >基於MT7688模組的開發筆記10——通過TFTP實現Ubuntu與開發板之間的檔案傳輸

基於MT7688模組的開發筆記10——通過TFTP實現Ubuntu與開發板之間的檔案傳輸

本篇文章是上一篇文章的繼續,在這篇文章裡我通過在Ubuntu上搭建TFTP伺服器,實現了在MT7688開發板上上傳和下載Ubuntu中的檔案,這為後面的程式開發提供了方便。

一、安裝TFTP伺服器:安裝tftp-hpa和tftpd-hpa軟體

1.1安裝第一個軟體

[email protected]:/home# apt-get install tftp-hpa
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  tftp-hpa
0 upgraded, 1 newly installed, 0 to remove and 523 not upgraded.
Need to get 19.1 kB of archives.
After this operation, 75.8 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  tftp-hpa
Install these packages without verification [y/N]? Y
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main tftp-hpa i386 5.2-1ubuntu1 [19.1 kB]
Fetched 19.1 kB in 2s (7,362 B/s)
Selecting previously unselected package tftp-hpa.
(Reading database ... 150828 files and directories currently installed.)
Unpacking tftp-hpa (from .../tftp-hpa_5.2-1ubuntu1_i386.deb) ...
Processing triggers for man-db ...
Setting up tftp-hpa (5.2-1ubuntu1) ...

1.2安裝第二個軟體
[email protected]
:/home# apt-get install tftpd-hpa
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  tftpd-hpa
0 upgraded, 1 newly installed, 0 to remove and 523 not upgraded.
Need to get 39.4 kB of archives.
After this operation, 140 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  tftpd-hpa
Install these packages without verification [y/N]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main tftpd-hpa i386 5.2-1ubuntu1 [39.4 kB]
Fetched 39.4 kB in 0s (45.5 kB/s)
Preconfiguring packages ...
Selecting previously unselected package tftpd-hpa.
(Reading database ... 150834 files and directories currently installed.)
Unpacking tftpd-hpa (from .../tftpd-hpa_5.2-1ubuntu1_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Setting up tftpd-hpa (5.2-1ubuntu1) ...
tftpd-hpa start/running, process 3770 二、在home目錄下建立shareFiles資料夾,更改資料夾的許可權,建立test.txt檔案,寫入檔案內容。
[email protected]
:/home# dir
MT7688Share  openwrt  shareFiles
[email protected]:/home# cd shareFiles/
[email protected]:/home/shareFiles# ls
test.txt
[email protected]:/home/shareFiles# cat test.txt
This is a test file in Unbuntu. It is mainly used as the tftp test file! 三、修改配置檔案
[email protected]
:/home/shareFiles# ls
test.txt
[email protected]:/home/shareFiles# vim /etc/default/tftpd-hpa
[email protected]:/home/shareFiles#
配置內容如下:192.168.1.107為我的Ubuntu系統的IP地址
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/home/shareFiles"
TFTP_ADDRESS="192.168.1.107:69"

TFTP_OPTIONS="-l -c -s"

四、啟動服務
[email protected]:/home/shareFiles# service tftpd-hpa restart
tftpd-hpa stop/waiting
tftpd-hpa start/running, process 3933
[email protected]:/home/shareFiles# ps -au | grep tftpd-hpa
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root      3959  0.0  0.0   4388   832 pts/2    S+   01:36   0:00 grep --color=auto tftpd-hpa

[email protected]:/home/shareFiles#

五、測試
這裡說明一下:下面的IP地址為TFTP伺服器的地址,以下兩個命令在開發板上使用,你首先Telnet到開發板即可
tftp -g -r file ip//從TFTP下載檔案
tftp -p -l file ip//向TFTP上傳檔案


5.1在Ubuntu系統TFTP伺服器的共享目錄上建立一個test.txt的測試檔案,可以簡單在檔案中寫入一些內容
[email protected]:/home/shareFiles# ls
hello  test.txt
[email protected]:/home/shareFiles# cat test.txt
This is a test file in Ubuntu

[email protected]:/home/shareFiles#

5.2在Unbuntu中通過Telnet方式登入MT7688開發板,嘗試下載TFTP中的檔案
[email protected]:/home/shareFiles# telnet 192.168.1.1
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
Mediatek login: admin
Password:
BusyBox v1.12.1 (2015-07-14 09:33:29 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.
# tftp -g -r test.txt 192.168.1.100
# ls
etc       bin       init      media     etc_ro    test.txt
home      mnt       var       dev       tmp
sys       proc      usr       sbin      lib
# cat test.txt
This is a test file in Ubuntu

下載成功,而且可以正確檢視該檔案!

5.2測試將MT7688開發板上的檔案上傳到Ubuntu:我在MT7688上建立了123.txt檔案
現在處於MT7688開發板上:
# ls
etc       bin       init      media     etc_ro    test.txt
home      mnt       var       dev       tmp
sys       proc      usr       sbin      lib
# touch 123.txt
# echo "This is a test file in MT7688" >> 123.txt
# cat 123.txt
This is a test file in MT7688
# tftp -p -l 123.txt 192.168.1.100
# exit
現在處於Ubuntu系統上:
[email protected]:/home/shareFiles# pwd
/home/shareFiles
[email protected]:/home/shareFiles# ls
123.txt  hello  test.txt
[email protected]:/home/shareFiles# cat 123.txt
This is a test file in MT7688
[email protected]:/home/shareFiles#


成功!綜上測試,我們已經實現了通過tftp服務在Ubuntu系統與MT7688開發板之間實現檔案的互傳!有了這個功能就方便我們把Ubuntu系統編寫的程式放到開發板上執行!
















相關推薦

基於MT7688模組開發筆記10——通過TFTP實現Ubuntu開發之間檔案傳輸

本篇文章是上一篇文章的繼續,在這篇文章裡我通過在Ubuntu上搭建TFTP伺服器,實現了在MT7688開發板上上傳和下載Ubuntu中的檔案,這為後面的程式開發提供了方便。 一、安裝TFTP伺服器:安裝tftp-hpa和tftpd-hpa軟體 1.1安裝第一個軟體 [ema

將lrzsz工具移植到ARM開發 ---只通過串列埠實現window和ARM之間檔案互傳

事情背景:由於需要在windows和ARM板之間只通過串列埠傳輸檔案(windows的檔案只通過串列埠傳輸到ARM板上) 這時超級終端SecureCRT+lrzsz工具可以完成這項使命!(其他終端軟體

基於MT7688模組開發筆記8——TFTP方式燒寫Uboot韌體

通過TFTP方式,燒寫Uboot.bin韌體需要準備tftpd、SecureCRT,還要準備網線,串列埠線。 一、我的MT7688開發板出廠的IP地址為:192.168.1.1/24,所以給電腦設定一個同網段的靜態IP地址。然後用網線將開發板的LAN與電腦的網絡卡連線。如果

基於MT7688模組開發筆記4——編譯Linux系統和Uboot

之前搭建Linux系統的時候,在make dep之後再make的時候老是出錯,實在無語至極!後來使用Ubuntu12.4.2版本的系統,居然成功的通過了編譯,韌體也生成了。 一、以下軟體是必須要有的。 apt-get install -y libncurses5-dev a

基於MT7688模組開發筆記1——關於Ubuntu版本

        本人最近正在做一個無線產品的應用開發,由於涉及到WIFI,所以需要使用具備WIFI模組的開發板。之前由於沒有這方面的設計經驗,一開始選用了ESP8266這種型號的WIFI模組,ESP8266模組在物聯網、智慧家居等領域有較為廣泛的應用,但是後來在實際的測試中

STM32F0開發筆記10: Keil開啟時提示”Warning #440“警告的解決方法

首先指明的是此問題是升級keil以後造成的,keil版本升級到V5.26.2.0後,開啟原先的程式提示”Warning #440“警告,如下圖所示。 此問題的解決方法,在Keil的官方網站中,有詳細的描述,網址如下:http://www.keil.com/support/docs/40

開發筆記16 | 通過 Eclipse Marketplace 安裝Alibaba Cloud Toolkit

通過 Eclipse Marketplace 安裝 Alibaba Cloud Toolkit 友情提示:Eclipse Marketplace 站點位於美國,如果網路無法訪問,可嘗試選擇其他安裝方式 第 1 步:啟動 Eclipse 第 2 步:在選單欄中選擇 Help > Eclipse Ma

開發筆記19 | 通過 JetBrains 外掛市場安裝 Alibaba Cloud Toolkit

通過 Intellij JetBrains 外掛市場安裝 Alibaba Cloud Toolkit 第 1 步:開啟 Intellij 的 Settings ( Windows下 ) 或 Preferences( Mac下 )視窗 第 2 步:進入 Plugins 選項,搜尋“Alibaba Cloud

通過TFTP伺服器,往開發下載程式

通過TFTP伺服器,往開發板下載程式  主要內容: (1):設定開發板的網路配置 (2)開啟window下的tftp終端軟體(即啟動window下的fttp服務) (3)在u-boot下輸入下載命令進行下載 進行下載 具體步驟  一、設定開發板的網路配置  根據把開發板

python開發筆記--如何通過python程式碼進行shell命令執行

    話說又到了做學習筆記的時間,感覺現在做總結筆記已經成了我工作的一部分~    今天來說一下我們在python中如何去執行shell命令操作:(以前我竟然不知道,簡直不能太簡單了)    1.第一種方式:    import os    os.system('cd /U

Linux筆記 #10# 用於支持Web應用開發&部署&配置的一些自定義腳本

普通 相關 啟動 image 分享圖片 linu snapshot sta pps // 留著備用 一、本地開發與測試相關腳本 個人習慣在項目的根目錄下建立一個script文件夾用來存放各種自定義的腳本, 這樣在根目錄下不僅可以使用mvn命令和還可以很方便地執行自

開發技巧-Java通過HttpProxy實現穿越

efault collected ddr apach pac 建立 create set 設置 需求描寫敘述 在正常的項目開發需求中。連接遠程server的場景一般有二: 1 自家實現的httpserver,api接口都已經約定好。

Modbus庫開發筆記之四:Modbus TCP Client開發

creat 需要 修改 status command 協議格式 sin 服務器端 這一 這一次我們封裝Modbus TCP Client應用。同樣的我們也不是做具體的應用,而是實現TCP客戶端的基本功能。我們將TCP客戶端的功能封裝為函數,以便在開發具體應用時調用。 對於T

Modbus庫開發筆記之五:Modbus RTU Slave開發

edm hold 還需 add rtu 需要 man access 服務器端 Modbus在串行鏈路上分為Slave和Master,這一節我們就來開發Slave。對於Modbus RTU從站來說,需要實現的功能其實與Modbus TCP的服務器端是一樣的。其操作過程也是一樣

Modbus庫開發筆記之六:Modbus RTU Master開發

客戶端 hold 不同的 rtu 客戶 and 一個 服務器端 操作 這一節我們來封裝最後一種應用(Modbus RTU Master應用),RTU主站的開發與TCP客戶端的開發是一致的。同樣的我們也不是做具體的應用,而是實現RTU主站的基本功能。我們將RTU主站的功能封裝

Modbus庫開發筆記之九:利用協議棧開發Modbus TCP Server應用

數根 網絡 received ant getc multiple 利用 這不 tar 前面我們已經完成了Modbus協議棧的開發,但這不是我們的目的。我們開發它的目的當然是要使用它來解決我們的實際問題。接下來我們就使用剛開發的Modbus協議棧開發一個Modbus TCP

Web筆記(一) Web 簡介開發環境搭建

tro env 原理圖 start log auc wid serve enc Web應用程序的工作原理 大多數的Web應用程序結構都是采用最為流行的B/S軟件開發體系結構,將Web應用程序部署在Web服務器上,只要Web服務器啟動,用戶就可以通過客戶端瀏覽器發送HTTP

基於SSH2的新聞信息管理平臺的設計開發——論文隨筆

百度 完成 得到 技術分享 alt 搜索功能 方法 ron 身份驗證 一、基本信息 標題:基於SSH2的新聞信息管理平臺的設計與開發 時間:2017-03 出版源:青島大學 領域分類:系統設計與架構 二、研究背景 問題定義:如何人性化、個性化的為不同用戶提供不同的特定的新聞

muduo網路庫學習筆記(四) 通過eventfd實現的事件通知機制

目錄 muduo網路庫學習筆記(四) 通過eventfd實現的事件通知機制 eventfd的使用 eventfd系統函式 使用示例 EventLoop對eventfd的封裝 工作時序 runInLoo

muduo網絡庫學習筆記(四) 通過eventfd實現的事件通知機制

添加 最大的 atom times sin eas functor lee 單純 目錄 muduo網絡庫學習筆記(四) 通過eventfd實現的事件通知機制 eventfd的使用 eventfd系統函數 使用示例 EventLoop對eventfd的封裝 工作時序 ru