Today the remote control of the drone is done via wifi with my laptop trou ssh.
By the way the software is designed (even if not yet completly developed) to receive commands from any type of devices (smartphone, tablet and so on). See this post for tips.
So it is fundamental that the drone keep a stable and constant connection with the remote control.
In order to verify a constant connection I created a new class that I called netscan that use the ping command to verify the connection with a given ip address.
This object can work in a parallel thread that can monitor the connection on a fixed time interval.
In the code example you can find the netscan.py and the netscan_test.py
In netscan_test.py you can see how to createand initialize the netscan object and start the parallel thread.
I put an important effort on the performance of the system in order to verify that it is not time consuming.The time to perform a task ( in this exemple a basic calculation) does not change if I start or not the netscan.For the moment I tested it only on my laptop and the results are great.
As soon as the communication is lost the netscan react on this.
This new object will be added to my code in the next coming beta3_test.py