5 ways to copy data from Raspberry Pi to PC
You have succeeded with your latest Raspberry Pi project. Perhaps you are using it to create photos, music or even videos, right? Whatever the purpose, at some point, you will want an easy way to get data out of Pi's SD card, and insert it into your PC's hard drive.
This can be complicated.
Almost no support from cloud services. You can only do this through mobile media, email and local network tricks. If you've ever had to copy data into or from the Raspberry Pi and have trouble, the 5 methods in this article will be useful for you in the future.
5 ways to copy data from Raspberry Pi to PC
- 1. Send data via email
- 2. Access cloud storage in the browser
- 3. Use a USB drive
- 4. Send and receive data with SCP
- 5. SFTP - The best option
1. Send data via email
This is probably the most obvious option and definitely the first thing you should try. By accessing the default email application of Raspberry Pi (Claws Mail is like the PIXEL desktop version of Raspbian Jessie), it's quite simple to set up your email account, add attachments and send data.
You can access Gmail via the Chromium web browser as well. Both of these options are good.
How to send an email depends on your choice. If you are using Gmail, you will be able to save the message as a draft. Then, when you log into Gmail on your main computer, the document you need will be there. Otherwise, if you are using an email application, just send an email to your own address, or the second email account you have access to.
If you don't have a second email account but have a Facebook account, please send it to Facebook email. This way is also quite fast and convenient.
2. Access cloud storage in the browser
Another effective but slightly slower option is to access one of your cloud accounts and synchronize data in this way. Unfortunately, no famous cloud service provides an application for Raspberry Pi, so it's best to upload your file via Chromium browser.
But which service should you use?
Dropbox and OneBox are both available via the browser but very slowly. Meanwhile, OneDrive and Google Drive are hardly used. You should use the service you find most helpful.
3. Use a USB drive
Another reasonable option is to use a USB drive. Simply insert a formatted drive into a spare USB slot in your Raspberry Pi, and wait for it to appear in the Raspbian file manager. If you are using an old Pi or a Raspberry Pi Zero and lack a USB port, it's time to use a USB hub. Although a standard USB port is fine for USB flash devices, be aware that a powered hub will be needed for Pi-based devices.
With the USB drive installed, it will automatically mount. If not, you will need to mount it manually. Start by finding its unique ID:
ls -l / dev / disk / by-uuid /
Normally, you will find an item named sda1 (or maybe with another name), so please note the name of this item before continuing.
Next, create a mount point. This is essentially a folder that will display the contents of the drive.
sudo mkdir / media / usb
(You don't need to call it "usb" but that will help.)
Next, make sure you have ownership of that folder. If not, you will not be able to view the content in the directory!
sudo chown -R pi: pi / media / usb
You can then mount the drive with:
sudo mount / dev / sda1 / media / usb -o uid = pi, gid = pi
Once completed, you can easily copy the files to a USB drive and after removing the USB safely, copy them to your main computer. To disconnect using manually, enter the following command:
sudo umount / media / usb
4. Send and receive data with SCP
This is a bit complicated, but the general idea is that you can use the command line, to send and receive data between your Raspberry Pi and PC.
A command called scp (Secure Copy Protocol) will help accomplish this. To use it, you'll first need to set up an SSH connection to your Raspberry Pi. This works best with Linux, because Windows users will need to install an SSH client to make it work. Once connected, in Linux, enter:
scp pi@192.168.0.15: file.txt
This uses the scp command, specify the device and the default user name, then specify the name of the file. The document file.txt will be transferred from Pi to the Home folder on your computer.
To copy file.txt to Pi, use:
scp file.txt pi@192.168.0.15:
(Seal : last is very important!)
As mentioned above, the Home folder is selected as the destination. To change this, specify a different directory, such as:
scp file.txt pi@192.168.0.15: subdirectory /
This method is similar to the ADB push command, used to send data to or from an Android device, when flash or root a new ROM.
5. SFTP - The best option
If you have a good FTP client, have secure SFTP support, this is probably the best option to get data from your Raspberry Pi. For this, the flexible FileZilla project is a good place to start. You can download a copy from filezilla-project.org.
- Instructions for setting up individual FTP Server with FileZilla
SFTP stands for SSH File Transfer Protocol. As long as SSH is enabled on your Raspberry Pi (usually via raspi-config screen), you can use SFTP to push and pull files in the GUI.
With FileZilla running, open File> Site Manager and click New Site. From here, enter the IP address of Raspberry Pi in the Host box (or just raspberrypi.local if you have Bonjour services running).
Continue to fill out the form, select SFTP - SSH File Transfer Protocol for the Protocol and Normal section for the Login Type section . Enter the current Raspbian username and password for the User and Password sections (by default pi and raspberry). You can click Rename to name the description for the connection. This is especially useful if you use FileZilla regularly.
As long as the Pi has been started, you can press Connect to start the connection. In FileZilla, the local device (your PC) is shown on the left and your remote computer (Raspberry Pi) is on the right. You will need to browse the directories on both sides to find the source and destination files. Once you've done this, you can copy the file from the Raspberry Pi by dragging them into the left pane, or right-clicking and selecting Download. To copy files to Pi, just move them from left to right.
Although it is difficult to install, SFTP is probably the best solution to transfer files to or from your Raspberry Pi.
Do you see data transfer between your PC and Raspberry Pi troublesome? Have you tried any of these methods, or do you have a tip of your own? Let us know in the comment section below!
See more:
- What you need to know about retro gaming on Raspberry Pi
- 4 ways to set up Raspberry Pi as a media server
- How to set up Raspberry Pi touch screen
You should read it
- How to send backup copies of Raspberry Pi files to email
- How to backup Raspberry Pi
- How to turn a Raspberry Pi 4 into an Edge Gateway
- How to add an ADC to Raspberry Pi: What you need to know
- Raspberry Pi Zero vs Model A and B, how are they different?
- What is the Raspberry Pi and how is the Raspberry Pi used?
- How to start Raspberry Pi 3 from USB
- Why should people try Raspberry Pi 4?
- Learn Pi Imager, How to Use Raspberry Pi Imager
- How to use Raspberry Pi Imager to install Raspberry Pi OS
- 5 ways to make good use of Raspberry Pi 4
- 7 best Raspberry Pi 4 cases
Maybe you are interested
How to use Raspberry Pi 400 as a laptop
Raspberry Pi Pico 2 W Launched: Wireless-Enabled Microcontroller Board for Just $7
How to build Android TV Box with Raspberry Pi 4
Raspberry Pi Touch Display Releases New Version After 9 Years
6 ideas to utilize old Raspberry Pi
Raspberry Pi AI Kit: Bring AI to Raspberry Pi