Skip to main content

File Transfer

In daily development, we often need to transfer files between the local machine and the development board. Although there are multiple transfer methods to choose from, this article will focus on several commonly used file transfer methods.

Transfer via Electerm Software

Electerm is an SSH/SFTP client developed based on Electron. It supports Linux, MAC, and Windows operating systems, and it is free and open - source.

  1. Log in to the development board via SSH.
  2. Transfer files.

File Transfer via ADB

  1. Connect the development board to the computer through the USB interface. Then upload files or folders from the PC to the root directory of the development board.

  2. Execute the adb push command in PowerShell to upload files or folders to the development board.

    adb push test/ /home/luckfox
    • The effect is as follows:
  3. Download the 1.txt file in the /home/luckfox directory of the development board to the PC.

    adb pull /home/luckfox/1.txt .

File Transfer via SCP

SCP (Secure Copy Protocol) is a secure remote file copying command based on SSH. It supports copying files or directories between Linux servers. Different from the cp command, which is only used for local copying and cannot work across servers, SCP is based on the SSH protocol, and all data is encrypted during transmission, ensuring the security of the transfer. The scp command is suitable for quickly and simply transferring one or a few files, especially in resource - limited environments. For complex file transfers or full backups, it is recommended to use rsync, which only transfers the differences between the source and the target, saving bandwidth and time. It is especially suitable for large files and frequently updated files.

  1. Transfer a local file to the development board.

    scp  luckfox.txt luckfox@192.168.10.95:/home/luckfox
  2. Transfer a local directory to the development board.

    scp -r luckfox luckfox@192.168.10.95:/home/luckfox
  3. Transfer a file from the development board to the local machine.

    scp luckfox@192.168.10.95:/home/luckfox/luckfox.txt .
  4. Transfer a directory from the development board to the local machine.

    scp -r luckfox@192.168.10.95:/home/luckfox/luckfox .