No-Ip name resolving issues

If i run ps -ax i get for mavproxy

566 Ss /bin/sh -c sudo sh /home/pi/mavproxy.sh
568 S sudo sh /home/pi/mavproxy.sh
587 S sh /home/pi/mavproxy.sh
591 S sudo mavproxy.py – master=udp:127.0.0.1:14550 --out=udp:myname.ddns.net:14550 --notdr --daemon
600 Sl /usr/bin/python usr/local/bin/mavproxy.py – master=udp:127.0.0.1:14550 --out=udp:myname.ddns.net:14550 --notdr --daemon

Hope it helps to see if i am running multiple instances of mavproxy

comment out your mavproxy line in crontabs
sudo crontab -e
use a “#” to comment out the mavproxy.sh line before @reboot

then do a reboot and check with “ps aux” if mavproxy is still running or not
ps aux | grep mavproxy

Not running after # on crontab and reboot.

If i take away the # in crontab than it connects but extremely slow.

removing #from crontab i get:

pi 711 0.0 0.2 4276 1916 tty1 S+ 10:13 0:00 grep --color=auto mavproxy

so i guess this is the grep, so no the mavproxy instance running, so no, if i remove from crontab it doesn’t start.

yeah, you’re right;
rpi2 or rpi3? anything else cpu intensive stuff running?
check your cpu load;
sudo apt-get install sysstat
iostat
to identify processes with high cpu load:
sudo top

Tested with top:

15% Ardupilot
1-2% mavproxy

remaining services add up probably to another 5%.

Total load probably below 30%

Corrado

that’s kinda low for mavproxy; i’ve got a rpi3 and it uses about 20%;
check if that behaviour persists on wifi connection;

Ok, i’ll try and let you know

Corrado

Same on wifi.

What i don’t understand is how people have it working just putting the ddns name in the arducopter start line and mine doesn’t

I tried to see if it resolve the name and it does.

Corrado

This is really starting to become my obsession, it looks like i can’t find a way to start arducopter with ddns domain name instead of IP address.

It works only on numerical IP address but everytime i disconnect and reconnect my LTE router it chages so i have to edit rc.local each time.

Please any help or hint will be greatly appreciated.

Corrado

Ok, solved.

What i did is creating a arducopter.sh script that contains the following

ip=dig +short mypc.ddns.net
sudo ArduCopter -A udp:ip$:14550

than starte the script from rc.local

It finally works :slight_smile:

Had to install dnsutils to have the dig command avail.

regards,

Corrado

yeah that works;
be aware you will not be able to reconnect if your ip changes during flight!

I set a RTL if connection lost, never happened in around 200 flights so far.

Corrado

Hello Panky, i guess you would be interested in my findings since you helped me so much.

Today for the first time i had my ip changed in flight, nothing happened, as expected the system went into RTL but after 2-3 seconds connection came back and everything ok, including Mission Planner and Gstreamer, they came back to life.

I think it is because i am using a router onboard the Quad, so basicly the Raspberry never lost the connection that is phisically on ethernet to the router.

Hope you find it interesting.

There is a thing i would like to make better than it is now and i tried but my skills are still lacking a bit so i ask.

Now in rc.local i have a sleep of 60 seconds to allow the router to go online before i start Arducopter.

I would like to put a while loop in rc.local that somehow check for internet connection and exits the loop and starts Arducopter once the connection is up. Have any idea of how to implement it?

regards,

Corrado

nice to hear everything goes so well with your solution and thanks for the follow up!
you can try to put scripts into /etc/network/if-up folder - your router might intialize as soon as he’s online…

I tought of that folder /etc/network/if-up but it only checks if the eth0 is up and connected to the router, not if the router is connected to internet so it fails.

Corrado

#!/bin/sh

-q quiet

-c nb of pings to perform

ping -q -c1 google.com > /dev/null

if [ $? -eq 0 ]
then

else

fi

start ArduCopter after “then”
restart this script after “else”
put a sleep command of a few seconds before restarting your script!

So basicly, lets say this script is called “check internet” i run this new script from rc.local and keep looping it untill internet is up and start the arducopter.sh?

Can i launch 2 scripts after “then”? (arducopter and gstreamer?

Corrado

should work, put it in the next line;

Ok, thanks, will report back as usual :slight_smile:

Corrado

1 Like

Hello, when running my new starter.sh script i get the following message:

starter.sh: 5: starter.sh: [0: not found
starter.sh: 16: starter.sh: starter.sh: not found

Corrado