Companion Computer: Flight mode locked once in Auto

Hi all,
have a raspberry pi running a windows exe via mono. We set the flight mode to Guided arm the motors, if the motors successfully Arm we command a takeoff. We then switch into flight mode Auto and command a Mission Start. My mission has waypoints, followed immediately with Loiter at the waypoint location, then a landing, takeoff to loiter then next waypoint repeat.

Now this all works nicely if we have a telemetry radio and a Windoze laptop, flight modes change as requested to change. Same code. However in Linux it gets locked into Auto and we can’t change it till the copter Disarms. This is within code, and or flight mode change from the RC TX. Both are locked out and we get a cannot change flight mode change error.

The way I have the Raspberry Pi connected to the Pixhawk is via serial connection, and we set up a Mavlink connection via a terminal connection (automated in the /etc/rc.local file) and within this connection via serial connect we set MavLink to broadcast out on a UDP connection to the pi, all the flight instructions go over the UDP connection. Obviously we can’t share the serial connection with the windows exe due to the terminal having the connection, hence the UDP connection. Side note: Mono doesn’t do well with UDP to be honest. We get part way through getting parameters and get crashes periodically from what I suspect is a floating point error that mono finds hard to deal with. (currently re-writing for python so looking forward to moving past Mono).

So if anyone sees something odd here I’d really appreciate a reply.

Happy flying,
Edan