mishel
Posts: 1
Joined: Wed Sep 04, 2019 10:24 pm

SEND IMAGE BETWEEN 2 RASPBERRY PI

Wed Sep 04, 2019 10:30 pm

HELLO everyone, i´m new on raspberry pi, and i dont know how could i send images between 2 raspberry, via the wifi network maybe an script in python or something???, i really apreciate your help please :C

Andyroo

Re: SEND IMAGE BETWEEN 2 RASPBERRY PI

Thu Sep 05, 2019 1:57 pm

Welcome to the forum.

Many ways to do this assuming both Pi boards are contactable from each other. Three examples are

1) You could set up Samba on the destination Pi and mount the share on the source. You can then just use the cp (copy) or mv (move) command. This would also allow any Macs or PCs around to share the data as well (if you want to)
2) You could set up an FTP site and copy the file using an FTP program. Again, this can be shared with PCs and Macs if required.
3) The simplest way though is to use SCP (see here for info) as this is ready built into the Pi operating system (and Macs - not sure about PCs).

The SCP method can be easily converted into a script and run at regular intervals if needed.

wildfire
Posts: 606
Joined: Sat Sep 03, 2016 10:39 am
Location: Dundee, Scotland

Re: SEND IMAGE BETWEEN 2 RASPBERRY PI

Thu Sep 05, 2019 2:20 pm

Andyroo wrote:
Thu Sep 05, 2019 1:57 pm
3)this is ready built into the Pi operating system (and Macs - not sure about PCs).
I can confirm scp is available on the windows 10 OS at least.
E8 85 A2 64 C9 64 81 94 64 81 95 64 89 84 89 96 A3
Still NF Shirls

User avatar
neilgl
Posts: 2111
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: SEND IMAGE BETWEEN 2 RASPBERRY PI

Fri Sep 06, 2019 3:21 pm

And to use scp, without having to type in a password or hardcode it, to copy files from e.g. a pizero to a pi2 (my pi2 is 192.168.1.103):
First login as pi to the pizero and set up rsa keys using ssh-keygen. Get the public key to the pi2 authorized_keys.
Then for example copy a file called "ztest" from directory "transfer" to the pi2 using

Code: Select all

scp -i ~/.ssh/id_rsa transfer/ztest pi@192.168.1.103:/home/pi/transfer

Return to “Beginners”