Skip to main content

File Transfer

In daily development, we often need to transfer files between the local machine and the development board. While there are various methods available, this article focuses on a few commonly used file transfer methods.


File Transfer Using Electerm

Electerm is an open-source SSH/SFTP client developed with Electron. It is compatible with Linux, macOS, and Windows operating systems.

  1. SSH Login to the Development Board.
  2. File Transfer.

File Transfer Using ADB

  1. Connect the development board to the PC via USB. 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
    • 效果如下:
  3. Download the file 1.txt from the /home/luckfox directory on the development board to the PC:

    adb pull /home/luckfox/1.txt .

Transferring Files with SCP

scp (Secure Copy Protocol) is a secure remote file copy command based on SSH. It supports copying files or directories between Linux servers. Unlike cp, which only works locally, scp enables cross-server file transfer.

All data transferred via scp is encrypted, ensuring secure transmission.

scp is ideal for quick and simple transfers of a few files, especially in resource-constrained environments. For complex file transfers or backups, consider using rsync, which only transfers differences between the source and destination, saving bandwidth and time, especially for large or 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 .