manjunath
Posts: 3
Joined: Thu Mar 26, 2020 8:44 am

Command and Response UART communication between two Raspberry pi

Thu Mar 26, 2020 12:41 pm

I m trying to communicate between two Raspberry pi using UART (serial communication). One Raspberry pi should send a command and the other Raspberry pi should send data based on command received. Is there a library that we can use for this purpose?

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

Re: Command and Response UART communication between two Raspberry pi

Thu Mar 26, 2020 12:56 pm

manjunath wrote:
Thu Mar 26, 2020 12:41 pm
I m trying to communicate between two Raspberry pi using UART (serial communication). One Raspberry pi should send a command and the other Raspberry pi should send data based on command received. Is there a library that we can use for this purpose?

Looks like a 'delete and repost' operation. Which is unfortunate given that a Moderator advised people to respond to your now deleted original post.

pyserial seems to be what you need: https://pyserial.readthedocs.io/en/latest/pyserial.html



I will play no further part in this discussion.

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

Re: Command and Response UART communication between two Raspberry pi

Thu Mar 26, 2020 1:02 pm

manjunath wrote:
Thu Mar 26, 2020 12:41 pm
I m trying to communicate between two Raspberry pi using UART (serial communication). One Raspberry pi should send a command and the other Raspberry pi should send data based on command received. Is there a library that we can use for this purpose?

Unfortunate side effect of multi-posting, wrong posts get deleted and causes confusion, after 8+ years do not understand why posters feel they get a better / quicker response by doing so....


Posting links again as nothing better to do today:

https://www.raspberrypi.org/documentati ... on/uart.md

https://pinout.xyz/pinout/uart
Retired disgracefully.....
......to an uncomplicated life !

Rather than negativity think outside the box !

manjunath
Posts: 3
Joined: Thu Mar 26, 2020 8:44 am

Re: Command and Response UART communication between two Raspberry pi

Fri Mar 27, 2020 4:12 am

sorry for the repost of this question. beacause the old post was locked. sorry sir. i understand pyserial is helpful. But the thing is that i wanted to know any other library package is available for this which i can directly use?

scotty101
Posts: 3868
Joined: Fri Jun 08, 2012 6:03 pm

Re: Command and Response UART communication between two Raspberry pi

Fri Mar 27, 2020 9:26 am

manjunath wrote:
Fri Mar 27, 2020 4:12 am
sorry for the repost of this question. beacause the old post was locked. sorry sir. i understand pyserial is helpful. But the thing is that i wanted to know any other library package is available for this which i can directly use?
Pyserial is what you are looking for....
It allows you to send and recieve serial data.
What more are you looking for?
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

Return to “Python”