Servers by jDrones

Arduino MAVlink SITL

My Arduino can control real Pixhawk with MAVlink.
However, if I try to control a simulated device, it doesn’t work.

I was unable to simulate through other means, so I use the simulation in Mission Planner.
If I am correct this parameter should link my serial port (Arduino connected to COM6) with SERIAL1 of the Ardupilot.
--uartC=uart:/dev/ttyS5

The console window of ArduPlane.exe (the simulation instance) indicates the serial was successfully connected.
Opened /dev/ttyS5

Baudrate of SERIAL1 is set to 57600 (which is the rate set in Arduino) and protocol is set to MAVlink2.

However, the Arduino doesn’t receive heartbeats (or any other messages).

https://ardupilot.org/dev/docs/using-sitl-for-ardupilot-testing.html#using-real-serial-devices
This link indicates something about setting half-duplex and WSL, however I am not sure how this applies to my problem or how to solve this. So maybe this is the problem?

I don’t know, how to troubleshoot this issue.

OK, I found out the communication starts working when I first open the Arduino serial monitor or Putty (and then close it) and only after that I start the simulation in Mission planner.

From this, I conclude that either there is a bug in the Arduino code or the serial port in Windows is somehow initialized differently based on the method. To be continued…

Servers by jDrones