2016年3月3日 星期四

遠端讀取Linkit Smart Duo上的檔案

由於使用終端機遠端SSH到Linkit Smart 7688 Duo中寫python實在麻煩  ((討厭用vim
所以想把Linkit Smart 7688 Duo的File System掛載到Ubuntu目錄下直接開IDE寫。
以下為流程

1. 將Linkit Smart 7688 Duo切換成Station Mode,使其連上網際網路下載東西

2. 透過ssh進入Linkit Smart 7688 Duo終端機,安裝sftp server,使其能被sshfs存取
    opkg update
    opkg install openssh-sftp-server


3. 在您的Ubuntu上安裝sshfs
    sudo apt-get update
    sudo apt-get install sshfsopkg update


4.在您的Ubuntu上透過sshfs遠端掛載Linkit Smart 7688 Duo的File System
    sshfs root@<Linkit Smart 7688 Duo IP>:/root <要把資料夾掛載哪>

舉例來說,要把IP為192.168.1.100的Linkit Smart 7688 Duo IP家目錄資料夾掛到桌面test資料夾,要下達下列指令
    cd ~/Desktop    // 中文版Ubuntu '桌面 '
    mkdir test  sshfs root@192.168.1.100:/root ~/Desktop/test

5. 直接開IDE寫python,存到掛載的資料夾中,開ssh連線執行python,最後不用時記得用umount把資料夾卸載  
    umount ~/Desktop/test


沒有留言:

張貼留言