본문으로 건너뛰기

9. 파일 전송

이 섹션에서는 파일 전송을 용이하게 하기 위해 네트워크 케이블이나 Wi-Fi를 통해 PC와 armsom 보드를 동일한 LAN에 배치하도록 선택해야 합니다.

네트워크 케이블이나 Wi-Fi를 사용하여 네트워크에 연결하는 경우 "V. 네트워크 연결 및 설정" 섹션을 참조하세요.

암솜보드의 경우 파일 전송을 위해 두 가지 방법을 권장합니다.

  1. SSH 링크

  2. nfs 마운트

차이점은 다음과 같습니다.

SSH 링크를 통해서는 일반 파일만 전송할 수 있으며 링크 파일은 전송할 수 없습니다.

nfs 마운트를 통해 Ubuntu와 armsom 보드 사이의 모든 파일을 전송할 수 있습니다.

Wi-Fi를 사용하기로 선택한 경우 다음 명령을 사용하여 Wi-Fi 켜기 및 끄기를 제어할 수 있습니다(명령에 익숙해지기 위한 경우에만 필수는 아님).

sudo ip link set dev wlan0 up //Turn on wlan0 device, but will not affect the power status of wifi
sudo ip link set dev wlan0 down //Turn off wlan0 device, but will not affect the power status of wifi

sudo rfkill block wifi //Completely turn off Wi-Fi hardware
sudo rfkill unblock wifi //Completely turn on WIFI hardware

ip a or ip addr show //Used to display and operate the IP layer (network layer) properties of the network interface, mainly used to display information such as the IP address to the user
ip link show //Used to display and operate the link layer properties of the network interface, you can see whether the interface is disabled, display the MAC address, display the interface speed, and do not directly display the IP address configuration

sudo nmtui //Graphical interface configuration wifi
  1. Windows 데스크톱 환경에서 Windows 키(필드 아이콘 키) + r 키를 동시에 누르고 팝업 옵션 상자에 cmd를 입력한 후 Enter 키를 누르고 cmd 터미널에 ipconfig를 입력합니다.
  2. armsom 보드 직렬 터미널에 sudo nmtui를 입력하고 팝업 그래픽 인터페이스에서 연결 활성화를 선택한 후 화살표 키로 연결하려는 WiFi 이름을 선택한 다음 Enter를 누릅니다. 1초 후에 비밀번호를 요구하는 대화상자가 나타납니다. 연결하려면 비밀번호를 입력하세요
  3. 암썸보드의 1단계 창 아래 cmd 환경에 보이는 IP 주소를 ping합니다. ping이 가능하다면 라우터가 동일한 네트워크 세그먼트 IP 주소를 PC와 보드에 할당했다는 의미입니다.
  4. mobaXterm 소프트웨어를 통해 보드를 연결하고 armsom 보드에서 ip a를 사용하여 보드 ip를 볼 수 있습니다. 그런 다음 PC에서 mobaXterm을 열고 SSH를 통해 보드에 연결합니다.

​image​

image​

SSH 전송에 대해 주의해야 할 두 가지 사항이 있습니다.


1. ssh can only transfer ordinary files, not link files

2. It can only be transferred to the folder whose group belongs to the user name entered in step 4 of Figure 1. If you want to transfer to other folders, please use the root user ssh to log in to the board

9.2 nfs를 사용하여 파일 마운트 및 전송​

NFS를 사용하여 위의 실험 환경을 구축합니다. 이는 주로 네트워크 연결, 호스트에서 NFS 서비스 시작, 보드에 파일 시스템 마운트의 세 단계로 구성됩니다.

우리의 목표는 개발 호스트와 보드의 다음 디렉터리를 매핑하는 것입니다.

개발 호스트 공유 디렉터리: /home/username/nfs

보드 마운트 디렉터리: /mnt

9.2.1 V동일한 Wi-Fi에 연결된 가상 머신 ubuntu Armsom 보드​

다음과 같이 가상 머신에서 모드를 브리지 모드로 설정합니다.

​image​

​image​

‍

가상 네트워크 편집기에서 관리자 권한을 사용하여 브리지 모드에서 사용되는 네트워크 카드를 전용 Wi-Fi 네트워크 카드로 변경합니다. vmware 소프트웨어의 수정 단계는 다음과 같습니다.

​image​

​image​

Windows 제어판에서 다음을 찾으세요.

​image​

가상 네트워크 편집기에서 브리지 모드에 사용되는 네트워크 카드를 위 그림에서 선택한 Wi-Fi 장치 이름으로 변경합니다.

​image​

Windows에서는 Avery-m이라는 Wi-Fi에 연결합니다. 나중에 Ubuntu에서는 Wi-Fi 네트워크 카드를 사용하여 브리지 모드를 통해 이 Wi-Fi에 연결합니다.

Ubuntu에 표시되는 IP는 172.20.10.13입니다.

​image​

Windows에 표시되는 IP는 172.20.10.2입니다.

​image​

armsom 보드에서 sudo nmtui 명령을 통해 Wi-Fi 설정의 그래픽 인터페이스로 들어갑니다.

​image​

​image​

키보드의 화살표 키를 사용하여 연결하려는 Wi-Fi를 선택하고 Enter를 누른 후 연결을 기다립니다. 성공적으로 연결하려면 다음 인터페이스에 Wi-Fi 비밀번호를 입력하세요.

​image​

연결에 성공하면 IP는 172.20.10.11입니다.

​image​

9.2.2 Ubuntu nfs 활성화​

우분투에서 다음 명령을 실행하십시오.
# Install nfs server
sudo apt-get install nfs-kernel-server

# ubuntu creates /nfs path
sudo mkdir /nfs

# Modify /etc/exports in ubuntu
sudo gedit /etc/exports

# Modify the /etc/exports file in the pop-up interface, add the following content at the end, remember to click save after modification
/nfs *(rw,sync,no_root_squash)

수정된 /etc/exports 파일 내용은 다음과 같습니다.

​image​

# Then use the command to restart the nfs service
sudo /etc/init.d/nfs-kernel-server restart

# The meaning of this command is to use the TCP protocol to mount the /nfs path in the device with IP 172.20.10.13 (linux ubuntu IP, please modify it according to the actual situation) to the /mnt folder of the current armsom board
# Enter the following command in the armsom board:
sudo mount -t nfs -o proto=tcp,nolock 172.20.10.13:/nfs /mnt

이 시점에서 Ubuntu에 새 파일이 생성되고 armsom 보드의 /mnt 경로 아래에 새 파일이 나타나 nfs 파일 전송이 성공했음을 나타냅니다.

문의하기