I am using two command prompt from windows and one ubuntu terminal version 18.04 with wsl2.
On Windows I installed python 3.7.1 64 bits, and with prompt I used pip install dronekit, then used python -m install --upgrade pip, then pip install dronekit-sitl, then pip install wheel,pip install mavproxy.
Then I went to ubuntu terminal and used pip install dronekit dronekit-sitl mavproxy. After that, I used python, and then import dronekit and then exit().Then did the same import command on prompt from windows.
Now with two windows prompts , the first I used dronekit-sitl copter --home=53.280707,-9.031534,0,180.The other mavproxy.py --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --out 127.0.0.1:14550 --out 127.0.0.1:14551 --out 127.0.0.1:14552.And then went to mission planner on windows, selected udp, put the right ports, and it connected.
So far so good.
What I cant do is send the script from ubuntu. Ubuntu terminal I navigate to /mnt/c/Users/gusta/OneDrive/Desktop, where my python script is saved, and try to use the command sudo python drone.py --connect udp:127.0.0.1:14550 to connect,i tried 14550,14551 and 14552, and it does not connect.
What happens is this:
WARNING:dronekit:Link timeout, no heartbeat in last 5 seconds
ERROR:dronekit.mavlink:Exception in MAVLink input loop
Traceback (most recent call last):
File “/home/grs26/.local/lib/python2.7/site-packages/dronekit/mavlink.py”, line 211, in mavlink_thread_in
fn(self)
File “/home/grs26/.local/lib/python2.7/site-packages/dronekit/init.py”, line 1371, in listener
self._heartbeat_error)
APIException: No heartbeat in 30 seconds, aborting.
Traceback (most recent call last):
File “drone.py”, line 38, in
vehicle = connect(connection_string, wait_ready=True)
File “/home/grs26/.local/lib/python2.7/site-packages/dronekit/init.py”, line 3166, in connect
vehicle.initialize(rate=rate, heartbeat_timeout=heartbeat_timeout)
File “/home/grs26/.local/lib/python2.7/site-packages/dronekit/init.py”, line 2275, in initialize
raise APIException(‘Timeout in initializing connection.’)
dronekit.APIException: Timeout in initializing connection.