dronekit.TimeoutError: wait_ready experienced a timeout after 30 seconds. When trying to connect

Hi all,
My scripts were running/working succefull on dronekit-sitl . When i am trying to connect to UAV(drone ) it gives timeout error while connecting. I am using MavProxy ,python3 and dronekit python.

Using MavProxy i connected to UAV by executing below command :
mavproxy.py --master=/dev/ttyUSB0 --out=127.0.0.1:14551
Output : Connect /dev/ttyUSB0 source_system=255
Log Directory:
Telemetry log: mav.tlog
Waiting for heartbeat from /dev/ttyUSB0
MAV> GPS lock at 577 meters
APM: data link #0 lost
online system 1
RTL> Mode RTL
APM: data link #0 regained
gCOM_EF_C2T MODE4
TE_MAXM_+MC_TPA_RATE_P ?D9\Z qEKF2_MAG_E_NOISE C_Y sQ_SACC |ELAY C M
bMPC_XY_VEL_D_EX*!vUN@PLD_BTOUT IS1IM5 ^PWM_MAIN_TRIM3 jjjjjV U~?RC12_REV ( S RC17_TRIM DRC1_TRIM T g 9ACRO_SWF^@3{TC_B_ENABLEEfence breach
Received 646 parameters
Saved 647 parameters to mav.parm

RTL>
RTL>
RTL> DpCOM_FLTMODE6;!xEKF2_ACC_B_NOISE mEKF2_HGT_MODEOS_Z
OISE RT AELAY Z @EKF2_WIND_NOISE EyIMU_ACCEL_CUTOFF WMAV_PROTO_VERnODEd\IMPC_FLT_TSKVX_LND R g,DIS4PWM_MAIN_TRIM1 5 c_RATE 4RC_MAP_GEAR_SWXoSYS_COMPANIONpE Got MAVLink msg: COMMAND_ACK {command : 520, result : 0}
Got MAVLink msg: COMMAND_ACK {command : 520, result : 0}

For dronekit connection i am giving ‘127.0.0.1:14551’ as connection string but it throwing exception after 30 secnds. Exception
Connecting to vehicle on: udp:127.0.0.1:14551
Traceback (most recent call last):
File “arm.py”, line 34, in
vehicle = connect(connection_string, wait_ready=True)
File “/home/mastermind/.local/lib/python3.5/site-packages/dronekit/init.py”, line 3172, in connect
timeout=timeout)
File “/home/mastermind/.local/lib/python3.5/site-packages/dronekit/init.py”, line 2375, in wait_ready
timeout)
dronekit.TimeoutError: wait_ready experienced a timeout after 30 seconds.

Please help

Check your connections.

Which connection you are talking ? Mavproxy connected to UAV but dronekit not able to connect.
Also in simuated(dronekit-sitl) mode it works fine

1 Like

Are you connecting dronekit to mavproxy? Try it.

Yes. I am connecting to mavproxy

Then there is something wrong with your dronekit script, or you forgot to add --out in the mavproxy

It is not like this. I am forwarding using dronekit to QgroundControl as well as to port 14551. This is not issue related to --out option. Timeout is due to the hearbeat not received to dronekit. Dronekit waiting for multiple types of hearbeats like GPS, Compass etc. While connecting verify GPS count and try to connect to vehicle using dronekit. Else set wait_ready to False and try to connect.

You may try giving your serial more time to get the parameters. You can open site-packages/dronekit/init.py and replace all occurrence of ‘timeout=30’ with ‘timeout=60’ or even 100 and see whether it works or not.

we got exactly same problem situation…

Problem has been solved and all working fine…
Thank you Guys for help

Would be good to know, what solved it in your case.

i have solved it with deleting wait_ready=True