dronekit / dronekit-python

DroneKit-Python library for communicating with Drones via MAVLink.
https://readthedocs.org/projects/dronekit-python/
Apache License 2.0
1.62k stars 1.44k forks source link

WARNING:autopilot:Mission upload timeout #1084

Open iaomari93 opened 3 years ago

iaomari93 commented 3 years ago

I have pixhawk 2.4.8 and I'm trying to upload mission using the upload() function. I'm following the same order in the examples.

running the code on the ArduCopter sim_vehicle.py simulator every thing works fine. but when I try the same code with the pixhawk I got WARNING:autopilot:Mission upload timeout and after few seconds I got /init.py", line 3031, in upload raise TimeoutError dronekit.TimeoutError. the connection with the drone works fine as well as arm and takeoff function. I tried to change the timeout to None but that didn't help.

does anyone had this before? thanks

eminakgun commented 3 years ago

Please try my implementation to fix this issue #1039

wynn4 commented 3 years ago

I also have this problem even after applying the implementation of @eminakgun . I’m running ArduCopter 4.0.3 and connecting via UDP to a companion computer-based mavlink router (similar to mavproxy) which is connected to the Cube autopilot via serial. Similar to @iaomari93 , everything else about the API seems to work fine (connecting, sending guided commands to the vehicle, etc.). It’s just uploading waypoints that’s having troubles. When I execute my app and connect to a simulated vehicle instead of the actual hardware, waypoints upload just fine. My dronekit app is executed in python2.7

brunoolivieri commented 3 years ago

@wynn4 I also have this issue. I am not using dronekit, but using pure pymavlink.

In STIL "everything" works (takeoff, land, GUIDED, parameters, etc.). In a real board/quadcopter only upload mission have problems: https://discuss.ardupilot.org/t/mavlink-mission-upload-timeout-error-in-copter-4-1-0-dev/71296

(I am using a regular RPi)

eminakgun commented 3 years ago

Been a long time when I encountered the timeout problem but it was happening during mission download. And I don't really remember all the things. I dig through the debug sessions and noticed that once download process is started, autopilot does not respond sometimes and the dronekit sits and wait for it to respond without doing nothing. But MAVLink protocol requires the requesting side must re-send the request when timeout expires. After that I implemented the correct behaviour. https://mavlink.io/en/services/mission.html#download_mission

I suggest you to go through the debug sessions and realize what is happening or missing actually. There might be a problem in your physical medium or anything else rather than the software.

Since dronekit is not officially supported/maintained anymore, you have to go and find it, fix it eventually. And please put it back to the github so that others will benefit from it. I don't think dronekit or MAVLink python libraries are that confusing, just give it a time.

Good luck.

PS: I did not have the problem with the ArduCopter but don't remember the exact version. AP software might have problems/bugs, but make sure that you are doing the correct thing outside of the AP, complying with MAVLink. You can try to ask questions to officials on Discord channels, I guess.