Mission Planner freezes when connecting to 2 SITL instances

Hello.

I’m running 2 SITL Instance(Rover and Quadplane) and it worked quite well before.

when I start mission planner, It sometimes freezes about 10 seconds during connecting to both SITL.

If you need any additional information, I’m willing to provide anything.

The Terminal message when freezes(always stuck at this point) :

INFO MissionPlanner.MAVLinkInterface - SubscribeToPacketType GENERATOR_STATUS System.Func`2[MAVLink+MAVLinkMessage,System.Boolean] False 0 0
Adapter DESKTOP-5GS7MFV - ?꾩そ found device:  [3c:7b:99:13:0d:4e]
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [3c:7b:99:13:0d:4e]
Adapter DESKTOP-5GS7MFV - ?꾩そ found device:  [00:19:01:7b:b1:c4]
INFO MissionPlanner.MAVLinkInterface - ID sys 99 comp 1 ver3 type FIXED_WING name ARDUPILOTMEGA
INFO MissionPlanner.MAVLinkInterface - set giveComport  current True new False
INFO MissionPlanner.MAVLinkInterface - 924 Start connect loop
INFO MissionPlanner.MAVLinkInterface - set giveComport ProgressReporterDialogue Background thread current False new True
bps 4278 loss 0 left 252 mem 65.2802734375 mav2 True sign False mav1 0 mav2 118 signed 0
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [13:f9:b8:4d:af:03]
Adapter DESKTOP-5GS7MFV - ?꾩そ found device:  [32:97:32:6c:db:60]
HUD 3 hz drawtime 7 gl True
bps 995 loss 0 left 126 mem 65.75390625 mav2 False sign False mav1 0 mav2 28 signed 0
INFO MissionPlanner.Utilities.Speech - TTS: say Mode changed to Manual
INFO MissionPlanner.MAVLinkInterface - ID sys 17 comp 1 ver3 type SURFACE_BOAT name ARDUPILOTMEGA
INFO MissionPlanner.MAVLinkInterface - set giveComport  current True new False
INFO MissionPlanner.MAVLinkInterface - 140 Start connect loop
Adapter DESKTOP-5GS7MFV - ?꾩そ found device:  [d3:d4:ba:69:86:9e]
INFO MissionPlanner.MAVLinkInterface - set giveComport ProgressReporterDialogue Background thread current False new True
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [6b:96:cc:81:43:88]
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [6b:96:cc:81:43:88]
Adapter DESKTOP-5GS7MFV - ?꾩そ found device:  [1e:e9:84:5b:c1:bc]
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [1e:e9:84:5b:c1:bc]
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [12:6d:dc:01:5e:4e]
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [13:3d:d6:e1:ec:cd]
INFO MissionPlanner.MAVLinkInterface - doCommand cmd REQUEST_MESSAGE 259 0 0 0 0 0 0
INFO MissionPlanner.MAVLinkInterface - set giveComport  current True new True
ERROR MissionPlanner.MAVLinkInterface -    at MissionPlanner.MAVLinkInterface.set_giveComport(Boolean value)
   at MissionPlanner.MAVLinkInterface.<doCommandAsync>d__208.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at MissionPlanner.MAVLinkInterface.doCommandAsync(Byte sysid, Byte compid, MAV_CMD actionid, Single p1, Single p2, Single p3, Single p4, Single p5, Single p6, Single p7, Boolean requireack, Action uicallback)
   at MissionPlanner.ArduPilot.Mavlink.CameraProtocol.<RequestCameraInformationAsync>d__51.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at MissionPlanner.ArduPilot.Mavlink.CameraProtocol.RequestCameraInformationAsync()
   at MissionPlanner.MAVLinkInterface.<>c__DisplayClass144_0.<<OnMAVDetected>b__0>d.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining, Task& currentTask)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1.TrySetResult(TResult result)
   at System.Threading.Tasks.Task.DelayPromise.Complete()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

INFO MissionPlanner.MAVLinkInterface - doCommand cmd REQUEST_MESSAGE 280 0 0 0 0 0 0
INFO MissionPlanner.MAVLinkInterface - set giveComport  current True new False
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [0a:3d:9e:1b:73:5c]
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [1c:95:8d:cd:68:66]
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [0a:3d:9e:1b:73:5c]
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [1c:95:8d:cd:68:66]
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [34:43:d8:95:9b:47]
Adapter DESKTOP-5GS7MFV - ?꾩そ updated device:  [34:43:d8:95:9b:47]
bps 1186 loss 0 left 30887 mem 77.3662109375 mav2 True sign False mav1 0 mav2 33 signed 0
Adapter DESKTOP-5GS7MFV - ?꾩そ stopped scanning.

I have removed all mission planner plugins I wrote, but the result was same.

I’m currently suspecting this line :

INFO MissionPlanner.MAVLinkInterface - set giveComport  current True new True

Try disabling Bluetooth and see if that speeds it up.

1 Like

Thank you for your support.

I disabled bluetooth on windows 11 laptop, but the issue still remains.

Below is the terminal output when freezes occurs. :

INFO MissionPlanner.MAVLinkInterface - set giveComport ProgressReporterDialogue Background thread current False new True
INFO MissionPlanner.MAVLinkInterface - set giveComport ProgressReporterDialogue Background thread current False new True
bps 0 loss 0 left 0 mem 68.0322265625 mav2 False sign False mav1 0 mav2 0 signed 0
INFO MissionPlanner.MAVLinkInterface - SubscribeToPacketType DISTANCE_SENSOR System.Func`2[MAVLink+MAVLinkMessage,System.Boolean] False 17 1
INFO MissionPlanner.MAVLinkInterface - SubscribeToPacketType OBSTACLE_DISTANCE System.Func`2[MAVLink+MAVLinkMessage,System.Boolean] False 17 1
INFO MissionPlanner.Utilities.Proximity - created for 17 - 1
INFO MissionPlanner.Utilities.Speech - TTS: say Mode changed to Guided
INFO MissionPlanner.MAVLinkInterface - ID sys 17 comp 1 ver3 type SURFACE_BOAT name ARDUPILOTMEGA
INFO MissionPlanner.MAVLinkInterface - set giveComport  current True new False
INFO MissionPlanner.MAVLinkInterface - 43 Start connect loop
HUD 2 hz drawtime 16 gl True
bps 2847 loss 0 left 658 mem 69.11328125 mav2 True sign False mav1 0 mav2 76 signed 0
INFO MissionPlanner.MAVLinkInterface - set giveComport ProgressReporterDialogue Background thread current False new True
INFO MissionPlanner.MAVLinkInterface - mav 1-1 seqno 208 exp 207 pkts lost 1
INFO MissionPlanner.MAVLinkInterface - SubscribeToPacketType GENERATOR_STATUS System.Func`2[MAVLink+MAVLinkMessage,System.Boolean] False 0 0
INFO MissionPlanner.MAVLinkInterface - ID sys 1 comp 1 ver3 type FIXED_WING name ARDUPILOTMEGA
INFO MissionPlanner.MAVLinkInterface - set giveComport  current True new False
INFO MissionPlanner.MAVLinkInterface - 958 Start connect loop
INFO MissionPlanner.MAVLinkInterface - set giveComport ProgressReporterDialogue Background thread current False new True
INFO MissionPlanner.MAVLinkInterface - doCommand cmd REQUEST_MESSAGE 259 0 0 0 0 0 0
INFO MissionPlanner.MAVLinkInterface - set giveComport  current True new True
ERROR MissionPlanner.MAVLinkInterface -    at MissionPlanner.MAVLinkInterface.set_giveComport(Boolean value)
   at MissionPlanner.MAVLinkInterface.<doCommandAsync>d__208.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at MissionPlanner.MAVLinkInterface.doCommandAsync(Byte sysid, Byte compid, MAV_CMD actionid, Single p1, Single p2, Single p3, Single p4, Single p5, Single p6, Single p7, Boolean requireack, Action uicallback)
   at MissionPlanner.ArduPilot.Mavlink.CameraProtocol.<RequestCameraInformationAsync>d__51.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at MissionPlanner.ArduPilot.Mavlink.CameraProtocol.RequestCameraInformationAsync()
   at MissionPlanner.MAVLinkInterface.<>c__DisplayClass144_0.<<OnMAVDetected>b__0>d.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining, Task& currentTask)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1.TrySetResult(TResult result)
   at System.Threading.Tasks.Task.DelayPromise.Complete()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

INFO MissionPlanner.MAVLinkInterface - doCommand cmd REQUEST_MESSAGE 280 0 0 0 0 0 0
INFO MissionPlanner.MAVLinkInterface - set giveComport  current True new False
bps 2797 loss 1 left 0 mem 67.5966796875 mav2 True sign False mav1 0 mav2 75 signed 0
bps 2171 loss 0 left 0 mem 67.947265625 mav2 True sign False mav1 0 mav2 60 signed 0
INFO MissionPlanner.MAVLinkInterface - ID sys 17 comp 1 ver3 type SURFACE_BOAT name ARDUPILOTMEGA
INFO MissionPlanner.MAVLinkInterface - set giveComport  current True new False
INFO MissionPlanner.MAVLinkInterface - ID sys 17 comp 1 ver3 type SURFACE_BOAT name ARDUPILOTMEGA
INFO MissionPlanner.MAVLinkInterface - HB Selection 17-1 seen 2
INFO MissionPlanner.MAVLinkInterface - set giveComport ProgressReporterDialogue Background thread current False new True
HUD 6 hz drawtime 5 gl True

Full Dump File :

MissionPlannerFreezingFullDump.txt (185.9 KB)

I will provide anything you need.

I have been running SITL with the configuration below, it has worked without severe issues for about two years :

Two Ubuntu WSL1 environments, Ardupilot firmware built followed official ardupilot guide.

The Two instance is UDP.

sim_vehicle.py -j4 -v Plane -f quadplane -A “–serial0=udpclient:127.0.0.1:14550” --no-mavproxy --custom-location=“2.48647,-159.45417,0,0”

sim_vehicle.py -j4 -v Rover -A “–serial0=udpclient:127.0.0.1:14551” --no-mavproxy --custom-location=“2.48647,-159.45417,0,0”

Sorry, the issue also occurred with only a single SITL instance(Rover)

I have attached the dump error log :

INFO MissionPlanner.Controls.HUD - OnResize start
INFO MissionPlanner.Controls.HUD - OnResize doing
HUD resize 426 305
INFO MissionPlanner.Controls.HUD - OnResize start
INFO MissionPlanner.Controls.HUD - OnResize doing
HUD resize 426 319
HUD 5 hz drawtime 3 gl True
INFO MissionPlanner.MAVLinkInterface - doCommand cmd REQUEST_MESSAGE 259 0 0 0 0 0 0
INFO MissionPlanner.MAVLinkInterface - set giveComport  current True new True
ERROR MissionPlanner.MAVLinkInterface -    at MissionPlanner.MAVLinkInterface.set_giveComport(Boolean value)
   at MissionPlanner.MAVLinkInterface.<doCommandAsync>d__208.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at MissionPlanner.MAVLinkInterface.doCommandAsync(Byte sysid, Byte compid, MAV_CMD actionid, Single p1, Single p2, Single p3, Single p4, Single p5, Single p6, Single p7, Boolean requireack, Action uicallback)
   at MissionPlanner.ArduPilot.Mavlink.CameraProtocol.<RequestCameraInformationAsync>d__51.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at MissionPlanner.ArduPilot.Mavlink.CameraProtocol.RequestCameraInformationAsync()
   at MissionPlanner.MAVLinkInterface.<>c__DisplayClass144_0.<<OnMAVDetected>b__0>d.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining, Task& currentTask)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1.TrySetResult(TResult result)
   at System.Threading.Tasks.Task.DelayPromise.Complete()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Does anyone experienced similar symptom?

Found the root cause :

Anti-Virus vaccine was significantly delaying the loading/compilation of several dll files.

Whenever Mission Planner starts, the antivirus scans more than 22 DLL files, which causes noticeable delays.

I don’t know why this result in thread exception/giveComport error, but while DLL loading is blocked or delayed, the thread exception consistently occurs.

After disabling antivirus, the thread exception no longer appears.