Developers can use three methods to copy files to the gateway or from the gateway to a computer.
Network file transfer: On macOS or Linux, use the scp command; on Windows, use the WinSCP tool.
MicroSD card file transfer: Use a MicroSD card and a card reader.
USB flash drive file transfer: Use a USB flash drive.
Network file transfer scp command on macOS or Linux
// Single file, from local to gateway
scp hello.txt root@192.168.1.100:~/
// Directory, from local to gateway scp -r hello root@192.168.1.100:~/
// Single file, from gateway to local scp root@192.168.1.100:~/hello.txt hello.txt
// Directory, from gateway to local scp -r root@192.168.1.100:~/hello hello MicroSD card file transfer The file system format of the SD card is recommended to be FAT32 or Ext4. FAT32 can be read and written normally on Windows and Linux, while Ext4 can only be read and written on Linux.
Insert the SD card into the TF card slot on the gateway. Mount it in the system to read and write. After use, you must unmount it before removing it.
mount -t vfat /dev/mmcblk0p1 /mnt
cp hello.txt /mnt
cp /mnt/hello.txt .
umount
USB flash drive file transfer The file system format of the USB flash drive is recommended to be FAT32 or Ext4. FAT32 can be read and written normally on Windows and Linux, while Ext4 can only be read and written on Linux.
Insert the USB flash drive into the USB Host port on the gateway. Mount it in the system to read and write. After use, you must unmount it before removing it.
mount -t vfat /dev/sda1 /mnt
cp hello.txt /mnt
cp /mnt/hello.txt .
umount