bejro
Posts: 6
Joined: Mon Sep 18, 2017 7:51 pm

Transfer files form raspberry pi 0 to pc

Mon Sep 18, 2017 8:17 pm

I would like to transfer files to my pc or any pc form my rpi 0 without connecting to internet. My preferable method would be to do that via USB connection but any cable is just fine. I was thinking about connecting two devices by ethernet and sharing network drive. What would be the easiest and the fastest method?

B.Goode
Posts: 4689
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Transfer files form raspberry pi 0 to pc

Tue Sep 19, 2017 6:58 am

Welcome to the Raspberry Pi forums.

Maybe this is what you need: http://blog.gbaman.info/?p=791

knute
Posts: 305
Joined: Thu Oct 23, 2014 12:14 am

Re: Transfer files form raspberry pi 0 to pc

Tue Sep 19, 2017 4:27 pm

Ethernet or WiFi, do you have a router? WinSCP and FileZilla run on Windows, are free, and can connect to your Pi via FTP or SFTP.

klricks
Posts: 4857
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Transfer files form raspberry pi 0 to pc

Tue Sep 19, 2017 5:19 pm

The easiest method is to connect to a router by WIFI or cable and create a local network..... And per your request you don't need an Internet connection to do this.

I use the built in file transfer tool in RealVNC which can easily transfer from desktop to desktop or wherever either direction.
Go here for my RPi writeup. Basic config, Serial Port add-on etc:
http://blackeagle12.net/Comp/RPi/Rpi.html Click contact icon then world icon --->

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4144
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Transfer files form raspberry pi 0 to pc

Tue Sep 19, 2017 5:24 pm

knute wrote: Ethernet or WiFi, do you have a router? WinSCP and FileZilla run on Windows, are free, and can connect to your Pi via FTP or SFTP.
+1
For most of my Pi's, if they're (locally) networked (wired or WiFi - for a Pi 0 using a USB-to-ethernet** or WiFi dongle) I usually use SFTP via FileZilla. If you can acquire an appropriate cable "USB-to-USB networking" is also possible w/o resorting to "gadget mode"****
(A serial connection could be used too - "novel" but probably somewhat slow ******)
Trev.
** http://www.cpmspectrepi.uk/raspberry_pi ... pters.html
**** http://www.cpmspectrepi.uk/raspberry_pi ... Cable.html
( ****** http://www.cpmspectrepi.uk/raspberry_pi ... Powered.22 )
Usually running Raspbian Jessie on up to 9 of 13 Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) and Stretch on my P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

bejro
Posts: 6
Joined: Mon Sep 18, 2017 7:51 pm

Re: Transfer files form raspberry pi 0 to pc

Tue Sep 19, 2017 11:39 pm

Thank you for help,
I have decided to use samba. Seems easy, takes 3 minutes to set up and then nothing. I can not see the drive on my desktop. I was looking for the solution for over 3 hours and still nothing worked. Can you please help me?

knute
Posts: 305
Joined: Thu Oct 23, 2014 12:14 am

Re: Transfer files form raspberry pi 0 to pc

Wed Sep 20, 2017 7:34 pm

bejro wrote:
Tue Sep 19, 2017 11:39 pm
Thank you for help,
I have decided to use samba. Seems easy, takes 3 minutes to set up and then nothing. I can not see the drive on my desktop. I was looking for the solution for over 3 hours and still nothing worked. Can you please help me?
I feel for you. I think Samba is black magic.

That's why I suggested you use FileZilla or WinSCP on your Windows PC and it will just work. The only thing you have to do is install the program on your PC.

bejro
Posts: 6
Joined: Mon Sep 18, 2017 7:51 pm

Re: Transfer files form raspberry pi 0 to pc

Wed Sep 20, 2017 7:49 pm

I have menaged to set up vnc without any problems. It can be the solution for all of my problems, however, I need one more thing. I need to automatically transfer specyfic file form raspberry to other computer. I was looking for some command that would be possible to use in the program that sent the file. I did not find anything like that. The only thing I found was position #CUSTOM_COMMAND with comment "uncomment if you want to.." (or so) in /etc/vnc. Is it possible to create a command that transfer the files?

knute
Posts: 305
Joined: Thu Oct 23, 2014 12:14 am

Re: Transfer files form raspberry pi 0 to pc

Thu Sep 21, 2017 6:54 pm

bejro wrote:
Wed Sep 20, 2017 7:49 pm
however, I need one more thing. I need to automatically transfer specyfic file form raspberry to other computer. I was looking for some command that would be possible to use in the program that sent the file
Again I suggest you look at sftp and ssh. You can run that from a command line, call it from a program or run it periodically from cron.

Martin Frezman
Posts: 1021
Joined: Mon Oct 31, 2016 10:05 am

Re: Transfer files form raspberry pi 0 to pc

Thu Sep 21, 2017 7:09 pm

knute wrote:
Thu Sep 21, 2017 6:54 pm
bejro wrote:
Wed Sep 20, 2017 7:49 pm
however, I need one more thing. I need to automatically transfer specyfic file form raspberry to other computer. I was looking for some command that would be possible to use in the program that sent the file
Again I suggest you look at sftp and ssh. You can run that from a command line, call it from a program or run it periodically from cron.
Don't all of those solutions either assume Linux on both ends (which tends to make everything easy) or finding/verifying/installing/configuring some foreign software on the Windows PC side?

Again, if you have Linux on both sides, it is easy and there are a plethora of good solutions available (and they are easily automate-able/cron-able). It's the fact that one side of this is Windows that makes it difficult.
If this post appears in the wrong forums category, my apologies.

knute
Posts: 305
Joined: Thu Oct 23, 2014 12:14 am

Re: Transfer files form raspberry pi 0 to pc

Sun Sep 24, 2017 6:50 pm

It is certainly easier with Linux on both ends. FileZilla however has a server for Windows. You can write a batch file for windows that uses PuTTY to sftp into a Linux computer and retrieve a file. You could run apache on the Pi, put your file in a reachable directory and run curl on the Windows end from a batch file to retrieve it. There are numerous ways and in the end any of them will be simpler than trying to get his Samba working with an unknown version of Windows remotely through the forum.

User avatar
HawaiianPi
Posts: 1398
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Transfer files form raspberry pi 0 to pc

Mon Sep 25, 2017 7:35 am

knute wrote:
Sun Sep 24, 2017 6:50 pm
... and in the end any of them will be simpler than trying to get his Samba working with an unknown version of Windows remotely through the forum.
Or even with a known version. The only thing I hate more than Windows itself, is Samba! :x

In Windows 10 you can install a Linux subsystem. Basically bash with many common CLI applications. Comes in handy for those times you want Linux on both ends and your PC is running Windows. It sounds like the OP may not be too familiar with Linux, but I thought I'd mention it in case I got the wrong impression.
My password is the last 8 digits of Pi.

bejro
Posts: 6
Joined: Mon Sep 18, 2017 7:51 pm

Re: Transfer files form raspberry pi 0 to pc

Tue Sep 26, 2017 4:42 pm

I am trying to connect to my pi via filezilla or winscp but I keep failing. Is it necessary to locate pc and pi in the same network?

B.Goode
Posts: 4689
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Transfer files form raspberry pi 0 to pc

Tue Sep 26, 2017 5:13 pm

bejro wrote:
Tue Sep 26, 2017 4:42 pm
I am trying to connect to my pi via filezilla or winscp but I keep failing. Is it necessary to locate pc and pi in the same network?
What does "the same network" mean?

The two devices have to be able to communicate by exchanging TCP/IP packets with each other. If they can do that, they might be described as in the same network.

Your original enquiry said you did not wish to use the Internet. You don't have to transfer data over the 'public' internet, but you will need some form of network connectivity between the two devices.

Why not spell out exactly what equipment how have and what restraints you are working under, and maybe someone can provide focussed advice rather than unhelpful generalities.

Filezilla can use an SSH connection. I believe WinSCP does too. So I would start by making sure that an interactive (command line) SSH connection can be established between the pc and the RPi.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4144
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Transfer files form raspberry pi 0 to pc

Tue Sep 26, 2017 5:17 pm

bejro wrote: I am trying to connect to my pi via filezilla or winscp but I keep failing. Is it necessary to locate pc and pi in the same network?
It's much easier if they are on the same sub-net, more so if you don't have "router control". To some extent it depends if you want to transfer files both ways (from either "end" or just one). I'm "lucky" - before WiFi was "cheap" I installed a wired network "backbone" so, most of the time my Pi's are always on the same sub-net. However I also have a couple of WiFi routers "piggy-backed"** onto the main router/modem. They provide WiFi (internet) access for the family's mobile devices in parts of the house where the main router's wireless connection is "poor" but the "local network" for those routers is different (IIRC, any Pi's connected via their WiFi can, effectively, only be clients to servers on the main sub-net).
Trev.
** http://www.cpmspectrepi.uk/raspberry_pi ... uters.html
Usually running Raspbian Jessie on up to 9 of 13 Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) and Stretch on my P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

bejro
Posts: 6
Joined: Mon Sep 18, 2017 7:51 pm

Re: Transfer files form raspberry pi 0 to pc

Tue Sep 26, 2017 5:21 pm

SSH is enabled. Right now I'm using my phone to provide internet connection for my rpi0 and Wi-Fi connection for my pc. Eventually, two devices will be connected by Ethernet, However, I have not bought the connector yet.

B.Goode
Posts: 4689
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Transfer files form raspberry pi 0 to pc

Tue Sep 26, 2017 5:34 pm

bejro wrote:
Tue Sep 26, 2017 5:21 pm
SSH is enabled. Right now I'm using my phone to provide internet connection for my rpi0 and Wi-Fi connection for my pc. Eventually, two devices will be connected by Ethernet, However, I have not bought the connector yet.

Still ambiguous.

How is the RPi connected to the 'phone?

Is the WiFi for the pc from your 'home' Internet router, or is it also via the 'phone?

Either way, it is very likely that although both end devices can interact with the wider Internet they don't have a way of communicating with each other.

If this can be 'fixed' at all it will need a technique known as port forwarding. But depending on your ISP subscription(s) it may not be possible at all.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4144
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Transfer files form raspberry pi 0 to pc

Tue Sep 26, 2017 5:43 pm

bejro wrote: SSH is enabled. Right now I'm using my phone to provide internet connection for my rpi0 and Wi-Fi connection for my pc. Eventually, two devices will be connected by Ethernet, However, I have not bought the connector yet.
Presuming your pc connects to a router via WiFi (and then to the internet when it needs to) the simplest solution, when both it and your Pi0 are "within range" of the router is to use a WiFi dongle on the Pi0 (and, since both the pc and Pi0 will be on the same sub-net of the router they will "talk" with each other on that local network, no internet involved). IIRC, it's also possible, but trickier to set up a wireless connection between them without going via the router - that's similar to using a USB-to-LAN dongle on the Pi0 and connecting that via a wired LAN connection to the pc but means that the pc can no longer use the WiFi for the internet (at the same time, potentially providing internet access for the Pi0 too). TBH both WiFi and USB-to-LAN dongles are not that expensive so get one of each and "experiment"**.
Trev.
** FWIW, these are the devices I've used/tested/"played with":
http://www.cpmspectrepi.uk/raspberry_pi ... pters.html
http://www.cpmspectrepi.uk/raspberry_pi ... pters.html
http://www.cpmspectrepi.uk/raspberry_pi ... iZero.html
( http://www.cpmspectrepi.uk/raspberry_pi ... Cable.html )
Usually running Raspbian Jessie on up to 9 of 13 Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) and Stretch on my P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

bejro
Posts: 6
Joined: Mon Sep 18, 2017 7:51 pm

Re: Transfer files form raspberry pi 0 to pc

Sun Oct 01, 2017 11:15 am

I finally got samba to work! Unfortunately I can not say what was the problem or if there was any. I did everything I could just to realize it is still not going to work. Eventually I bought Ethernet connector and magically my drive logo appeared on my computer. Then i had to came up with the idea that logging in manually is necessary and now I have acces to my files.

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 58 guests