Home        Store        Docs        Blog

QGroundControl and Raspberry Pi through SSH


(Dean Karlo Bardeloza) #1

Good day to you all.

We are currently working on a project to build our own ROV and we are using a Pixhawk as flight controller and the Ardusub simplerov firmware (we have four thrusters in the setup). All is fine and well when the Pixhawk is directly connected to the host computer (laptop) through USB. However, we would like to also integrate a Raspberry Pi 3 as a companion computer to be able to integrate autonomous functions. The Pi is already setup and flashed with the latest Ardusub-Raspbian image (updated 2017-01-12), but we have no idea how to connect QGroundControl from the laptop to the Pi, and then to the Pixhawk.

We are using putty to access the Pi through SSH in the laptop and is connected via Ethernet cable. The Pixhawk is then connected via USB to the Pi through the ACM0 tty port. The static ip’s of the laptop and the Pi are 192.168.2.1 and 192.168.2.2 respectively as per the instructions in the Ardusub site. How can QGC detect the vehicle when the Pixhawk is connected to the Pi? Also, is it necessary to have a Fathom-X interface for all of this to work? Thank you very much.


Getting started with MAVproxy
(Jacob) #2

If you are using the ArduSub-Raspbian image, and your network is configured correctly, then you should be good to go. Please start with the troubleshooting section here, and let us know if you have any trouble with those instructions, or have any feedback to make them better.

How are you powering the Raspberry Pi? You should be using a 5V supply rated to deliver at least 2 amps. I’ll add this bit to the troubleshooting section.

No, an Ethernet cable is fine.

QGC always listens on a udp port for a MAVLink connection. On the Raspberry Pi with the ArduSub image, a program called mavproxy bridges the usb connection to the udp port on the surface computer. This program is launched at boot, and will encounter an error if the pixhawk is not already connected with usb before the boot.


(Dean Karlo Bardeloza) #3

Jacob, thank you for the quick response.

I tried to follow the troubleshooting steps. I checked the USB cable connecting the Pixhawk to the Pi, and it works fine because I used it to connect the Pixhawk to the laptop directly and QGC was able to immediately detect the Pixhawk. I also allowed access for QGC in my firewall settings and pinged the Pi from the laptop’s command line. I was able to ping properly with low latency and no loss of packets. However, QGC still can’t detect the Pixhawk when it is connected via the Pi.

Since we are still testing the setup, the Pi is powered by plugging directly to the wall with its own plug and adapter.

I don’t think I have any encountered any errors. When I access the Pi through SSH, it just boots, prompts me to login, and then just waits for commands. At this point, QGC still can’t detect the Pixhawk. Is there a way to check if the mavproxy program successfully launched?


(Jacob) #4

The Pi has already booted up before you log in with SSH, it boots when you apply power, so the Pixhawk must be connected to the Pi before you plug the Pi into power.

After you log into the pi, you can type sudo screen -r mavproxy to see if mavproxy is running. Paste the output of that command here.

-Jacob


(Dean Karlo Bardeloza) #5

I entered the command and this is the output:

I assume everything is working properly? However QGC still can’t recognize the Pixhawk.


(Jacob) #6

What operating system are you using on your surface computer? Can you paste the output of ifconfig run on both the surface computer and the pi here?


(Dean Karlo Bardeloza) #7

I am running Windows 10 on my laptop (surface computer). For the Pi, ifconfig outputs this:

As for the laptop, ifconfig isn’t recognized by the command line, so I ran ipconfig instead.


(Jacob) #8

Have you configured your firewall to allow QGC access to the network?


(Dean Karlo Bardeloza) #9

Yes. I have set up the firewall to allow “qgroundcontrol.exe” and “Open source ground control app provided by QGroundControl dev team” access.


(Jacob) #10

Is the box for ‘UDP’ checked in this section of the Application settings?


(Dean Karlo Bardeloza) #11

I checked and yes, it is checked.

I also noticed that I am using a slightly older version of QGC. Can that be the cause of the problem? Also the box for Pixhawk in that section in my case is checked.


(Jacob) #12

The ‘Pixhawk’ box is for a direct USB connection, we are concerned with a UDP connection. Uninstall, then install the latest stable version. Then reboot both the surface computer and the ROV. Let me know if anything changes.

Are you using the same Windows 10 computer to access the Pi command line? Are you using PuTTY?


(Dean Karlo Bardeloza) #13

Okay, thanks for the link! I will download and install the latest version, and I’ll try to test it with the surface computer and the ROV first thing in the morning tomorrow (it’s about almost midnight here in the Philippines). Thank you for your quick responses thus far. Will let you know ASAP if there is anything that changes.

Yes, the Windows 10 laptop that I use as the surface computer is the same computer I use to access the Pi, and also yes, I use PuTTY.


(Dean Karlo Bardeloza) #14

Jacob,

Just checked it again today with QGC v3.1.2 and it finally worked! QGC was able to detect the Pixhawk while connected to the RPi and also the QGC also has video feed via the RPi camera.

Thank you very much for your help! It is very appreciated.

Dean Karlo


(Jacob) #15

Great! I’m glad to hear it. I’ve updated the troubleshooting section with the points we went over.

-Jacob


(Dean Karlo Bardeloza) #16

Thanks again! Glad I can also contribute to Ardusub and this community.


(John Griffiths) #17

has anybody tried putting QGC onto the new raspberry pi zero and using that as your topside computer?


(Tyler) #18

The troubleshooting page doesn’t seem to exist anymore, was it moved somewhere?


(Patrick José Pereira) #19

Link updated, you can check again now :slight_smile:


(Tyler) #20

Thanks Patrick!