I did some work on this this morning, and yes it is clear that mavlink routing needs to be tidied up.
Purely looking at the translator from mavlink to frsky passthru, there are a few special situations where I need to request information from the FC, for example mission waypoints, and optionally battery capacity. In those circumstances, with only one mavlink connection, I got away with simple fudging of sysid and compid. Mavlink routing was a non-issue.
Then we add WiFi and BT I/O, and as long as we simply pass across the packets one-to-one, routing should remain intact, as long as we are data agnostic. We don’t change anything in the packets and they simply go point to point.
Now we go a step further, and implement multiple clients, and multiple GCSs, and routing is definitely required, and in between the normal traffic now, I still might request data from the FC as described above with fudged sysid and compid.
I have used this documentation now as the basis for tracking source and target identities, and generally tightened up on my own internal requests for data from the FC (or the GCS).
Further, up to now, I have used a mock heartbeat to the FC to trigger data flow when no GCS is present. This is still in place, but stops when at least one GCS comes on line and triggers telemetry flow.
Nevertheless, I’m still seeing “Already Got param” from time to time. I compared the Mission Planner TLog (extracts) with my own debug log, and they match exactly. MP requests all the parameters, appears the get them all correctly, but still asks for certain parameters to be resent. These parameters are requested twice each, and two replacements arrive. Why twice I don’t know, but the MP logs and my logs show the same thing.
I have stashed some of the debug logs here. It might expire in a few days.
0x16 is a spreadsheet extracted from the TLog containing all the downloaded parameters.
0x14 is a spreadsheet extracted from the TLog containing all the parameter resend requests for mission planner.
mav2pt_debug_log.txt is self explanatory.
These logs are from tests using TCP, with a single STA connection through the lan to Mission Planner on a PC. When using UDP the results are the same.
EDIT:
I have used ESP8266 extensively, and for best results always used the HW flow control. Without it the serial link can drop a lot of packets.
I should do some tests with RTS/CTS cabled and implemented.