altanhaligur
Posts: 31
Joined: Mon Jul 08, 2019 6:54 am

Communication between Pis

Mon Jul 15, 2019 2:23 pm

Hello, im making ROV that uses one RPi at underwater and one RPi on above water controller box. I want to take camera display and sensor values from ROV to the controller box and take controller values from controller box to the ROV. How can i make communication between 2 Pis?

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

Re: Communication between Pis

Mon Jul 15, 2019 3:04 pm

altanhaligur wrote:
Mon Jul 15, 2019 2:23 pm
Hello, im making ROV that uses one RPi at underwater and one RPi on above water controller box. I want to take camera display and sensor values from ROV to the controller box and take controller values from controller box to the ROV. How can i make communication between 2 Pis?


With a long, flexible, waterproof cable and lots of sealant where it enters the submersible?


(Because, due to non-RPi-specific physics, aren't most common consumer forms of 'wireless' communication in the electromagnetic spectrum heavily attenuated by water?)

altanhaligur
Posts: 31
Joined: Mon Jul 08, 2019 6:54 am

Re: Communication between Pis

Mon Jul 15, 2019 4:50 pm

Yeah i dont want to do wireless communication. I want to make communication with tether, but i cant decide which communication protocol is
appropriate.

fruitoftheloom
Posts: 20143
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Communication between Pis

Mon Jul 15, 2019 5:18 pm

altanhaligur wrote:
Mon Jul 15, 2019 4:50 pm
Yeah i dont want to do wireless communication. I want to make communication with tether, but i cant decide which communication protocol is
appropriate.

Why not use WaterProof CAT6 Ethernet Cable (300ft ??)

That would give you a choice of software to allow remote access.
adieu

Asus CS10 Chromebit / HP Envy 4500 Wireless Printer / Raspberry Pi Model 2B v1.1 / RealVNC Software...

altanhaligur
Posts: 31
Joined: Mon Jul 08, 2019 6:54 am

Re: Communication between Pis

Tue Jul 16, 2019 9:47 am

Yes it makes sense. But how i am going to do this? Which communication protocol shoul i use? (Maybe TCP?)

fruitoftheloom
Posts: 20143
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Communication between Pis

Tue Jul 16, 2019 9:51 am

altanhaligur wrote:
Tue Jul 16, 2019 9:47 am
Yes it makes sense. But how i am going to do this? Which communication protocol shoul i use? (Maybe TCP?)

https://www.raspberrypi.org/documentati ... te-access/
adieu

Asus CS10 Chromebit / HP Envy 4500 Wireless Printer / Raspberry Pi Model 2B v1.1 / RealVNC Software...

Andyroo
Posts: 3772
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Communication between Pis

Tue Jul 16, 2019 9:53 am

Python has a sockets module https://realpython.com/python-sockets/ that is suitable.

Give each Pi a static address, connect via Ethernet and off you go.

If the programming is too complex for you, look at MQTT with one board being the broker and the other reading instructions etc from it.
Need Pi spray - these things are breeding in my house...

altanhaligur
Posts: 31
Joined: Mon Jul 08, 2019 6:54 am

Re: Communication between Pis

Tue Jul 16, 2019 10:36 am

My goal is sending video stream and sensor values from ROV to the Controller Box and sending control values from the Controller Box to the ROV. Should i use TCP or serial communication or I2C or etc..

jahboater
Posts: 4595
Joined: Wed Feb 04, 2015 6:38 pm

Re: Communication between Pis

Tue Jul 16, 2019 10:43 am

altanhaligur wrote:
Tue Jul 16, 2019 9:47 am
But how i am going to do this? Which communication protocol should i use? (Maybe TCP?)
TCP would be fine.

I presume you are happy using sockets from your favorite programming language.
That fact that you had to ask which protocol to use, might indicate otherwise.

altanhaligur
Posts: 31
Joined: Mon Jul 08, 2019 6:54 am

Re: Communication between Pis

Tue Jul 16, 2019 11:07 am

I must connect 2 Pis with ethernet cable, one is server one is client, and using TCP. Am i right?

Andyroo
Posts: 3772
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Communication between Pis

Tue Jul 16, 2019 11:10 am

The video stream will be what it is - normally P2P can be TCP but more often the stream is UDP as it’s designed fir more than one client.

I would think carefully about your skills before building a ROV - maybe try a remote land based robot first?

And no, you could use serial and SLIP or a floating antenna and WiFi / Bluetooth

Edit: as this is bidirectional (video one way, commands the other) it is more Peer to Peer than C/S as each Pi is a client of the other.
Need Pi spray - these things are breeding in my house...

altanhaligur
Posts: 31
Joined: Mon Jul 08, 2019 6:54 am

Re: Communication between Pis

Tue Jul 16, 2019 1:16 pm

I want to make ROV to learn all process. Its like a project.

I cant understand how to communicate/transfer datas from one RPi to another one with TCP.

User avatar
rpiMike
Posts: 832
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Communication between Pis

Tue Jul 16, 2019 2:38 pm

I used websockets to continuously send joystick data from one client Pi to another server Pi on a tracked robot over wifi.

https://websockets.readthedocs.io/en/stable/

altanhaligur
Posts: 31
Joined: Mon Jul 08, 2019 6:54 am

Re: Communication between Pis

Tue Jul 16, 2019 4:05 pm

rpiMike wrote:
Tue Jul 16, 2019 2:38 pm
I used websockets to continuously send joystick data from one client Pi to another server Pi on a tracked robot over wifi.

https://websockets.readthedocs.io/en/stable/
Can you mail me your code please? altanhaligur@gmail.com

Return to “Advanced users”