How to install and configure OpenVPN?
-
@Djalma-Ribeiro So the
.ovpn
file you used is the certificate that your drone is now using to connect to the VPN. You will also need to connect to the VPN with a different certificate using your ground control station that is running QGC. -
@Djalma-Ribeiro By looking at the
tun0
interface you can see that the IP of your drone on the VPN is now100.96.1.34
When you connect using your ground control station / PC you will also receive an IP there and those are the IPs you will use to communicate via. the VPN server
-
-
@tom Is this not my computer's ip?
-
@Djalma-Ribeiro The fact that the IP is the same on that OpenVPN screenshot makes me think that you're attempting to use the same key file here as you are on your drone. If that's true, it won't work and the devices will keep kicking each other off the network. You need to use a unique key for each device.
The first test before you try to connect to QGC would be to connect both devices to the VPN with their unique keys and then attempt to ping from the drone to your pc or from pc to drone. That way you can ensure the two can communicate with each other before you try getting PX4 / QGC involved.
Once you have the pinging working, you can set the IP of the ground station on your drone in
/etc/modalai/qgc-ip.cfg
(file name may be slightly different) -
Now I understand a little more! By the way, thank you very much for your help.
I have both the pc and the drone online on OpenVPN:
But neither can find the other by ping.
Is there anything else I'm forgetting?
-
@Djalma-Ribeiro Are you using a windows machine? All of our devices use Ubuntu 18.04 so I don't have much experience with it.
However on Windows, I know that some of our customers have had to disable all their firewalls in order to allow the traffic to come through.
-
@tom I managed to make the ping work by putting the drone in host and the pc in network.
Do I have to use UDP or TCP to connect to the QGC?
-
@Djalma-Ribeiro By default it'll use UDP. See this page for the next steps: https://docs.modalai.com/Qualcomm-Flight-RB5-user-guide-px4/
You will have to modify the
rb5-net-check
service and change the lineExecStart=/usr/bin/rb5-net-check wlan0 192.168
toExecStart=/usr/bin/rb5-net-check tun0 100.96
in order to tell the drone to wait for the VPN network interface to come up before sending out PX4 packets.Then you will have to modify the previously mentioned
/etc/modalai/qgc-ip.cfg
and adding the IP of your PC on the VPN in order to tell PX4 where to send packets.You can also look at :
/etc/modalai/full-m0052.config
in order to see the PX4 startup config -
@tom I didn't find the file /etc/modalai/qgc-ip.cfg
-
@Djalma-Ribeiro Okay you may have a slightly older version of the SDK. Go ahead and download the latest SDK from: https://developer.modalai.com/asset/4
and then follow the instructions here to install:
https://docs.modalai.com/Qualcomm-Flight-RB5-sdk-installation/This way we know you're using the latest SDK. This qgc-ip file was added in a later release
-
root@qrb5165-rb5:/home/rb5-flight-sdk-1.1.3# ./update-sdk.sh bash: ./update-sdk.sh: Permission denied
-
@Djalma-Ribeiro Looks like the permissions got lost somewhere along the way, you can use
chmod +x update-sdk.sh
to make it executable, then try again -
@tom you are the best! thanks
-
Well, I managed to update, redid the settings and he is connected to the internet. But I still can't connect the QGC.
I didn't understand one thing. Why the drone and the pc are online in the "Connectors" of "Networks" but both can't find each other by ping?
You can only ping if one of them is a Host Connector and the other is a Networks Connector.
I believe it is not Firewall because I have already disabled it.
Any idea?
-
@Djalma-Ribeiro I have no experience with having an OpenVPN online account and hosting through there so I can't provide any info on any of those settings. We host our own VPN servers using Google Cloud. That doesn't mean you can't do what you're doing, I just have no experience in that area.
You might get better answers to those questions on the OpenVPN forum (https://forums.openvpn.net/)
It's possible you have to configure the server's firewall as well to allow traffic on the ports that PX4 uses but that's just a guess
-
@tom Is there an easier way to connect the QGC to the drone? Even if on each connection I need to manually inform the ips.
I need to make the drone connect via LTE/5G urgently.
-
@Djalma-Ribeiro We usually recommend just connecting over WiFi before jumping into cellular + VPN. Have you done that yet to familiarize yourself with the process of connecting to QGC?
-
@tom wifi yes
-
@Djalma-Ribeiro As long as you have your VPN set up correctly it should be the exact same idea. The only change is that you will have to specify the IP of your ground station in the qgc-ip file. I can't help too much with the OpenVPN side of things other than what is in our docs.