I want to use Raspberry pi as a vehicle controller and control it through QGroundControl.
This project will help us to use raspberry pi directly as the vehicle controller.
Currently i am using the UDP ports on the raspberry pi to connect it with QGroundControl.
Issues I am facing
I successfuly used the UDP ports of the raspberry pi to connect it with my laptop and successfully connected. But when i try to connect the raspberry pi with QGroundControl it does not respond or connect with the Pi.
I have also tried it many times by using different port numbers.
I am making my Raspberry Pi as the server and the QGround as the host.
I had also written a python code for the Raspberry pi to connect it as a server. Here I am giving my code and i am also giving it as an attachment
Anyone can suggest me a way how to connect it, through UDP or through any other method.
Anything you can suggest me, please fell free to reply.
host = ‘’
port = 4560
storedValue = “Hi, how are you”
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error as msg:
print(“Socket bind comlete.”)
s.listen(1) # Allows one connection at a time.
conn, address = s.accept()
print("Connected to: " + address + “:” + str(address))
reply = storedValue
reply = dataMessage
A big loop that sends/receives data until told not to.
Receive the data
data = conn.recv(1024) # receive the data
data = data.decode(‘utf-8’)
Split the data such that you separate the command
from the rest of the data.
dataMessage = data.split(’ ', 1)
command = dataMessage
if command == ‘GET’:
reply = GET()
elif command == ‘REPEAT’:
reply = REPEAT(dataMessage)
elif command == ‘EXIT’:
print(“Our client has left us :(”)
elif command == ‘KILL’:
print(“Our server is shutting down.”)
reply = ‘Unknown Command’
Send the reply back to the client
print(“Data has been sent!”)
s = setupServer()
conn = setupConnection()