I want to connect my drone via TCP using a 4G dongle mount on the drone, I already have all the setup with Pixhawk4 and Raspberry Pi 4. I already do flight missions via UDP connection, using the 4G Dongle for telemetry short distance missions, just for endurance flight time. I am using Mavproxy to do the UDP and TCP connection.
The steps I do to communicate the drone via TCP to the QGroundcontrol are:
The IP is the RPI on the 4G router connection, I set the TCPin out that IP because I need that to receive en send the telemetry.
Then I create a TCP tunnel on another terminal on the RPI, using ngrok. I use this command:
ngrok tcp 14550
I select the 14550 port because I want to send and receive the information in that port of the drone that I use on the mavproxy command. It looks like this:
Finally, I go to QGround control and do a “common link” and create the TCP connection like this:
And In my terminal of the TCP show me that I made a connection but the QGround control Reject the server and never do the connection access that assigned port.
What I want to do is just Remote telemetry with 4G dongle mount on the drone, and communicate it with QGroundControl to another computer with a different Internet service.
My team and I have a lot of experience in this. There could be a lot of reasons that this is not working (many of which actually reside with the ISP you are using)
May I ask what Internet provider and 4G dongle you are using?
The IP you’re using 3.129.187.220, that’s the resolved IP address for 4.tcp.ngrok.io?
From the same machine that you’re running QGroundControl on, can you telnet to 3.129.187.220 15199? That’s a good sanity check to ensure you’ve got your tunnel working all the way through.
Have you tried specifically telnet 4.tcp.ngrok.io 15199? From another machine. It goes beyond ping - your mavproxy listener should be the one that answers you for that request. If you get data you don’t expect, then that’s useful problem solving data.
I’m seeing the same as you are if I try and set the same setup up. (netcat taking the place of mavproxy, but from a protocol level the same things should be happening). Seems like you’ll have to upgrade to paid to get a TCP connection across ngrok, like you said.
Yes! But there is no other way to achieve that? (free option)
I am a 5th-semester mechatronics student in Mexico and I just want to apply this to a scholar project. But I need to do more research to find something free just for basics autonomous missions. If you know something or find anything that can help me I will appreciate that!
There’s another service called PageKite which offers something similar. It’s going kind of deep here, but if you use PageKite and set up SSH HTTP proxying, you could then use SSH to provide port forwarding for you.
It works perfectly with Zerotier!!! I am actually having long-range telemetry via 4G connection, in a few moments I am going to post my steps to achieve that! Thank you soooo much @ryanjAA
@DrDrone set up a virtual private network between the companion and GCS computer (i.e. install a VPN system like zerotier (opens new window)on both computers). The companion then uses mavlink-router (opens new window)to route traffic between the serial interface (flight controller) and GCS computer on the VPN network.
This method has the benefit that the GCS computer address can be static within the VPN, so the configuration of the mavlink router does not need to change over time. In addition, the communication link is secure because all VPN traffic is encrypted (MAVLink 2 itself does not support encryption).