dantose
Posts: 10
Joined: Mon Mar 14, 2016 12:48 pm

Moving files to the pi over network

Sat Apr 16, 2016 12:51 am

Yes, I already googled, but can't seem to get it working.

I've got a windows box and the pi

i know the general format is:

Code: Select all

scp - [file path] pi@192.168.0.108 [destination path]
I've tried two things:
1. ssh into the pi, try to copy the files. Problem is i can't seem to specify a local (windows file system) file when logged into the pi remotely. I can specify the destination, but not the source

Code: Select all

scp - [???] pi@192.168.0.108 /media/pi/Media/
2. work from cygwin. Two issues, one, don't have scp, but figured I'd try cp since there isn't anything sensitive getting moved. now I can obviously specify a local file, but can't seem to get it to accept the remote location:

Code: Select all

scp - /cygdrive/f/file.txt pi@192.168.0.108 [???]

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Moving files to the pi over network

Sat Apr 16, 2016 1:13 am

Code: Select all

scp -P 22 pi@rasppi4:~/work/filename  .
[/size]

The above :roll: will copy filename (from the remote mach rasppi4) on port 22 to 'this' machines current directory (please notice the little 'dot' at the end .

Code: Select all

scp -P 5793 ~/work/filename pi@rasppi4:~/work/
[/size]

The above :roll: will copy filename from ~/work/ on 'this' machine to the remote machine rasppi4 to user pi in pi's working directory on port 5793.

Notice the -P is upper case... the port switch for ssh is lower case, the port switch for scp is upper case.
marcus
:ugeek:

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Moving files to the pi over network

Sat Apr 16, 2016 2:43 am

dantose wrote:i know the general format is:

Code: Select all

scp - [???] pi@192.168.0.108 /media/pi/Media/
You are putting in spaces where they can't be, I think:

Code: Select all

scp theFile      jimBob@wallyGator:/home/jimBob/theFile
You should be able to leave the theFile off the destination since it should default to the name you used to copy it with. You should also be able to leave off jimBob if you are logged in as jimBob. Note the colon after the host name, if you leave off the user name, that's important for ssh at least. So you might say:

Code: Select all

scp theFile      wallyGator:/home/jimBob

dantose
Posts: 10
Joined: Mon Mar 14, 2016 12:48 pm

Re: Moving files to the pi over network

Sat Apr 16, 2016 10:33 am

The problem ended up being a bit more straightforward. Cygwin doesn't have scp, and cp can't reach the remote machine. From the putty SSH window, it can't reach the windows machine since windows doesn't accept SSH requests.

I was assuming that scp was basically an encrypted cp, but, of course, it isn't.

Putty has a scp tool that works from the windows command line, which forces me to work with the obnoxious windows shell, but confirmed it could push a file from one computer to another.

The better solution is actually installing ssh/scp in cygwin, which I've now done.

User avatar
brekee12
Posts: 335
Joined: Wed Feb 03, 2016 3:36 pm
Location: HU

Re: Moving files to the pi over network

Sat Apr 16, 2016 3:55 pm

Why do not you set up a samba file server and you can copy (even print) any time simple commands?
Brekee12
on a Raspberry B+ with whezzy, two Zero with Jessie Light

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: Moving files to the pi over network

Sat Apr 16, 2016 3:57 pm

#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

User avatar
liudr
Posts: 685
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Moving files to the pi over network

Sat Apr 16, 2016 5:54 pm

If you want drag-n-drop convenience, use mobaxterm program. Once you ssh to your pi, it shows the whole file system in a left panel, like in windows file browser. Then you can copy from to pi by drag-n-drop. Command line mastery is not necessary.
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

User avatar
electronicsguy
Posts: 156
Joined: Wed Jan 21, 2015 11:20 pm
Contact: Website

Re: Moving files to the pi over network

Sun Apr 17, 2016 1:15 am

liudr wrote:If you want drag-n-drop convenience, use mobaxterm program. Once you ssh to your pi, it shows the whole file system in a left panel, like in windows file browser. Then you can copy from to pi by drag-n-drop. Command line mastery is not necessary.
I second mobaxterm :D It's very easy to use. It has ssh, x11 server and sftp all built right-in. It also has a portable version and is free.
blog: https://electronicsguy.wordpress.com
github: https://github.com/electronicsguy

ghans
Posts: 7871
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Moving files to the pi over network

Sun Apr 17, 2016 6:37 am

FileZia and WinSCP are programs for Windows which are
also useful for this purpose.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
DougieLawson
Posts: 35814
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Moving files to the pi over network

Sun Apr 17, 2016 12:47 pm

electronicsguy wrote:
liudr wrote:If you want drag-n-drop convenience, use mobaxterm program. Once you ssh to your pi, it shows the whole file system in a left panel, like in windows file browser. Then you can copy from to pi by drag-n-drop. Command line mastery is not necessary.
I second mobaxterm :D It's very easy to use. It has ssh, x11 server and sftp all built right-in. It also has a portable version and is free.
If you install PuTTY first then install MobaXterm it will use your PuTTY configuration (saved sessions) including shared public/private keys. For new folks coming from Windows it's probably an ideal tool. It gives you PuTTY, VNC (kind of because it's an X11 server) and FileZilla all in one.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
liudr
Posts: 685
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Moving files to the pi over network

Sun Apr 17, 2016 6:03 pm

PuTTY has a nice scripting language BTW. Did some data logging with it and eventually replaced it with python. May be nice to use PuTTY to process some responses and issue automated actions.
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: Moving files to the pi over network

Sun Apr 17, 2016 6:08 pm

is there a tutorial about how to install putty and ssh and then access the Pi from a PC ?
a link would be very nice!
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

User avatar
liudr
Posts: 685
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Moving files to the pi over network

Sun Apr 17, 2016 6:09 pm

Nothing official I know off. Google is your friend:

https://www.google.com/search?q=putty+r ... 8&oe=utf-8
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

Return to “Beginners”