Dynamic DNS vs Mav Proxy

Hello Folks,

Previously I managed to run Ardupilot (client mode)->Mav Proxy(server mode, configured as proxy bypass)<-QuickGroundControl (client mode).

It worked, but I faced documentation issues (unclear syntax of IP configuration) and therefore had to use combination of UDP and TCP traffic, other combinations did not work.
My setup still had connection and reconnection issues and overall required efforts to industrialize it.

I want to try now Dynamic DNS.
Anyone tried it? How is the experience?

I believe Ardupilot will work as Client and my GCS as Server, right? Or it should be reverse?

I thought over it.

Will go over @ogulbrandsen approach - chrontab curl on RPi pushing its 3g IP address to web server every minute.

And then I manually pick it from web page, and update into GCS.

I will publish this app to Heroku cloud and make it reusable for everyone, with authentication.

Will keep this thread updated or create a new one when done.

Thanks for sharing, @anton.pryamostanov!
Keep us updated :slightly_smiling_face:

1 Like

I was concerned about the security vs simplicity of usage.
And I did not have time to write a dedicated app.

Now an idea came into my mind - I have an existing app that sends Email over URL link:

https://pigeon-public.herokuapp.com/pigeon/enqueue?source=browser&endpoint=GET_TO_SMTP&recipient=email@gmail.com&subject=Test123&text=Test1234&from=pigeon@i-t.io

  • Replace email@gmail.com with your email (we will not save/share/store/disclose it, it is fully private)

  • Only Gmail addresses are supported

  • You can change also subject, text and from

  • Check spam folder in your Gmail account

  • Navigate through returned URLs to see message status and HTTP logs

  • First time request may take up to 50 seconds, due to free Heroku dyno unidlying startup.

Now what I going to do - is just setup a cron job in RPi to send CURL to this URL, replacing with my email - and dynamically replacing the IP address.

Will update shortly with the shell script here.

Pros: secure, changed IP arrives on email address
Cons: only Gmail is supported; it comes into Spam folder.

This is the Shell script that is going to be scheduled in RPi:
#!/bin/bash

NEW_IP=`hostname -i`

curl --get \
    --data-urlencode "source=RPi Shell Script" \
    --data-urlencode "endpoint=GET_TO_SMTP" \
    --data-urlencode "recipient=anxxx.prxxxov@gmail.com" \
    --data-urlencode "subject=Aluminium Weaver Mk3 IP Address" \
    --data-urlencode "text=$NEW_IP" \
    --data-urlencode "from=Drone_AW3@rtk.ae" \
    https://pigeon-public.herokuapp.com/pigeon/enqueue

Parameters Source, Recipient, Subject, Text, From are changeable.
Parameter Endpoint should not be changed - it tells “Pigeon” that this needs to go as an Email.

Note: hostname -i possibly will need to be changed as per RPi alternative command.
Note 2: I believe this could have been done without 3rd party web server (“Pigeon”), directly sending Email with Python. So if you prefer doing it that way - you can write/use some Python script for this.

This is the script, tested working fine from RPi:

NEW_IP=`sudo ip addr show | grep inet | grep ppp | awk ‘{print $2}’``

curl --get \
    --data-urlencode "source=RPi Shell Script" \
    --data-urlencode "endpoint=GET_TO_SMTP" \
    --data-urlencode "recipient=anxxxx.prxxxxxov@gmail.com" \
    --data-urlencode "subject=Aluminium Weaver Mk3 IP Address" \
    --data-urlencode "text=Hello, my IP is: $NEW_IP" \
    --data-urlencode "from=Drone_AW3@rtk.ae" \
    https://pigeon-public.herokuapp.com/pigeon/enqueue

Sends me emails with drone IP on my Gmail account.

I scheduled it to run every minute.

Here are some updates:

  • I only now understood that my operator does not provide public IP; only internal IP.
    So approach with direct connection for me not feasible.
    It can be helpful for those with public IP though…

So I came back to using Mavproxy and tried to figure out what issues I was having.

So I found 2 things:

  1. Not possible to have more than 1 “-A” option for Ardupilot - this is why my direct Wifi link was not working together with Mavproxy link.
  2. On Internet server, I had to launch Mavproxy as root and with nohup.
    Otherwise it was exiting when after some time after SSH disconnect.

So far setup is working without issues, but I need to monitor more - if Mavproxy crashes or exits on server.

This is the command to start Mavproxy on 3rd party server (Digital Ocean in my case):
sudo nohup ./startmavgateway &

This is the startmavgateway script:

/usr/local/bin/mavproxy.py --master=udp:x.x.x.x:14550 --out=tcpin:x.x.x.x:14551 --daemon --nowait

Arducopter config on Navio2:

/usr/bin/arducopter -A tcp:0.0.0.0:5760 -C udp:x.x.x.x:14550

Note: 0.0.0.0 should not be replaced. x.x.x.x is Mavproxy public IP on 3rd party server.

Navio2/RPi has wifi in AP mode and 3g modem.
It accepts QGroundControl connections directly over Wifi, and automatically connects to Mavproxy over 3g (and then QGroundControl can connect to same Mavproxy via Internet).
Everything is automatically starting.

I will post some details on 3g modem configuration bit later here.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.