Hey Fellow FG Peeps!
Thank you so much for showing interest in my project! I appreciate the support
Johan G: Thank you for the forum suggestion! I actually have already read through that forum as it was posted by ma15rysi, who was also attempting to render multiple planes in FG for visualization purposes. Unfortunately, much of that forum became talk about how to adjust the rate of received mp packets. Right now I think I need more info on structuring the mp packets.
wkitty42: Right, so UDP is stateless meaning that it does not require a stateful connection in order to send packets on a network (unlike TCP). So, likely not an issue with establishing a connection with FG...
I'm attempting to follow the format for mp protocol defined here:
http://wiki.flightgear.org/Multiplayer_ ... l#Messages . Sorry if "custom mp protocol" was confusing - I meant that I am trying to write a script to generate and send UDP packets that Follow mp protocol with custom positional and orientation values. That way I can read historical data, write it to a UDP packet, and send it on its way to FG.
So far, I feel confident that my script follows mp protocol for the Header and Positional data. I'm having trouble understanding the Properties data, however, which makes up a significant portion of the packet size - and is likely what I'm failing to follow properly. It seems that these are values that correspond to the property tree in some way (I don't fully understand the property tree implementation or how the Proporties portion of mp protocol maps to it). What's especially confusing to me is what values need to be included. The wiki page I linked above states: "A subset of the following properties are transmitted in the order below", referring to the list of properties that may be included in the packet. It also explicitly mentions that if all Properties were included, the packet size would far exceed the max.
So, my hacky solution was to simply append a sample of Property bytes from a mp protocol packet that I recorded with wireshark. If I had to guess, this is where we're running into troubles.
Especially after taking your advice and running FG with --log-level=debug and attempting to send mp protocol packets. A lot of print to comb through but I'll paste what I thought might be relevant below:
- Code: Select all
1.39 [INFO]:network FGMultiplayMgr - have server
1.39 [INFO]:network FGMultiplayMgr::init-txaddress= 127.0.0.1
1.39 [INFO]:network FGMultiplayMgr::init-txport= 5000
1.39 [INFO]:network FGMultiplayMgr::init-rxaddress=
1.39 [INFO]:network FGMultiplayMgr::init-rxport= 5001
1.39 [INFO]:network FGMultiplayMgr::init-callsign= plz
1.39 [INFO]:network Multiplayer mode active
0.23 [INFO]:general option:fdm = null
0.23 [INFO]:general Channel string = socket,in,30,,5505,udp
0.23 [INFO]:general option:native-fdm = socket,in,30,,5505,udp
0.23 [INFO]:general option:disable-sound =
0.23 [INFO]:general option:aircraft = f16-block-20
0.23 [INFO]:general Channel string = socket,in,30,,5506,udp,f16
0.23 [INFO]:general option:generic = socket,in,30,,5506,udp,f16
0.23 [INFO]:general Channel string = out,10,127.0.0.1,5000
0.23 [INFO]:general option:multiplay = out,10,127.0.0.1,5000
0.23 [INFO]:general Channel string = in,10,,5001
0.23 [INFO]:general option:multiplay = in,10,,5001
0.23 [INFO]:general option:callsign = plz
0.23 [DBUG]:general Logging priority is debug
0.23 [INFO]:general option:log-level = debug
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/protocol-version[0]
8.41 [DBUG]:network activating MP property:/surface-positions[0]/left-aileron-pos-norm[0]
8.41 [DBUG]:network activating MP property:/surface-positions[0]/right-aileron-pos-norm[0]
8.41 [DBUG]:network activating MP property:/surface-positions[0]/elevator-pos-norm[0]
8.41 [DBUG]:network activating MP property:/surface-positions[0]/rudder-pos-norm[0]
8.41 [DBUG]:network activating MP property:/surface-positions[0]/flap-pos-norm[0]
8.41 [DBUG]:network activating MP property:/surface-positions[0]/speedbrake-pos-norm[0]
8.41 [DBUG]:network activating MP property:/gear[0]/tailhook[0]/position-norm[0]
8.41 [DBUG]:network activating MP property:/gear[0]/launchbar[0]/state[0]
8.41 [DBUG]:network activating MP property:/canopy[0]/position-norm[0]
8.41 [DBUG]:network activating MP property:/gear[0]/gear[0]/compression-norm[0]
8.41 [DBUG]:network activating MP property:/gear[0]/gear[0]/position-norm[0]
8.41 [DBUG]:network activating MP property:/gear[0]/gear[1]/compression-norm[0]
8.41 [DBUG]:network activating MP property:/gear[0]/gear[1]/position-norm[0]
8.41 [DBUG]:network activating MP property:/gear[0]/gear[2]/compression-norm[0]
8.41 [DBUG]:network activating MP property:/gear[0]/gear[2]/position-norm[0]
8.41 [DBUG]:network activating MP property:/engines[0]/engine[0]/n1[0]
8.41 [DBUG]:network activating MP property:/engines[0]/engine[0]/n2[0]
8.41 [DBUG]:network activating MP property:/rotors[0]/main[0]/blade[0]/position-deg[0]
8.41 [DBUG]:network activating MP property:/rotors[0]/main[0]/blade[1]/position-deg[0]
8.41 [DBUG]:network activating MP property:/rotors[0]/main[0]/blade[2]/position-deg[0]
8.41 [DBUG]:network activating MP property:/rotors[0]/main[0]/blade[3]/position-deg[0]
8.41 [DBUG]:network activating MP property:/rotors[0]/main[0]/blade[3]/flap-deg[0]
8.41 [DBUG]:network activating MP property:/controls[0]/flight[0]/slats[0]
8.41 [DBUG]:network activating MP property:/controls[0]/flight[0]/speedbrake[0]
8.41 [DBUG]:network activating MP property:/controls[0]/flight[0]/spoilers[0]
8.41 [DBUG]:network activating MP property:/controls[0]/gear[0]/gear-down[0]
8.41 [DBUG]:network activating MP property:/controls[0]/lighting[0]/nav-lights[0]
8.41 [DBUG]:network activating MP property:/controls[0]/armament[0]/station[0]/jettison-all[0]
8.41 [DBUG]:network activating MP property:/sim[0]/model[0]/livery[0]/file[0]
8.41 [DBUG]:network activating MP property:/environment[0]/wildfire[0]/data[0]
8.41 [DBUG]:network activating MP property:/environment[0]/contrail[0]
8.41 [DBUG]:network activating MP property:/scenery[0]/events[0]
8.41 [DBUG]:network activating MP property:/instrumentation[0]/transponder[0]/transmitted-id[0]
8.41 [DBUG]:network activating MP property:/instrumentation[0]/transponder[0]/altitude[0]
8.41 [DBUG]:network activating MP property:/instrumentation[0]/transponder[0]/ident[0]
8.41 [DBUG]:network activating MP property:/instrumentation[0]/transponder[0]/inputs[0]/mode[0]
8.41 [DBUG]:network activating MP property:/instrumentation[0]/transponder[0]/ground-bit[0]
8.41 [DBUG]:network activating MP property:/instrumentation[0]/transponder[0]/airspeed-kt[0]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/chat[0]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/string[4]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/string[5]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/string[6]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[0]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[2]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[3]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[4]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[5]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[6]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[7]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[8]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[9]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[10]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[11]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[12]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[13]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[14]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[15]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[16]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[17]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[19]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[20]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[21]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/float[22]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/int[2]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/int[9]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/short[5]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/short[6]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/short[7]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[0]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[1]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[2]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[10]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[11]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[12]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[13]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[14]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[15]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[16]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[17]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[18]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[35]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[36]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[39]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[40]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[41]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[42]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[43]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[44]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[45]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[46]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[47]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[48]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[49]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[50]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[51]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/generic[0]/bool[52]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/mp-clock-mode[0]
8.41 [DBUG]:network activating MP property:/sim[0]/model[0]/fallback-model-index[0]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/comm-transmit-frequency-hz[0]
8.41 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/comm-transmit-power-norm[0]
11.65 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/emesary[0]/bridge[17]
11.65 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/emesary[0]/bridge[18]
11.65 [DBUG]:network activating MP property:/sim[0]/multiplay[0]/emesary[0]/bridge[19]
26.99 [DBUG]:network activating MP property:/engines[0]/engine[0]/rpm[0]
26.99 [DBUG]:network FGMultiplayMgr::ProcessPosMsg - Position message with invalid data (NaN) received from test
26.99 [DBUG]:network FGMultiplayMgr::ProcessPosMsg - Position message with invalid data (NaN) received from test
26.99 [DBUG]:network FGMultiplayMgr::ProcessPosMsg - Position message with invalid data (NaN) received from test
26.99 [DBUG]:network FGMultiplayMgr::ProcessPosMsg - Position message with invalid data (NaN) received from test
The setup looks fine to me. I included the "activating MP property ..." lines on the off chance they have a hint as to which properties I should be sending in my mp protocol packets. It's also worth noting that the ProcessPosMsg errors were regularly spaced out in the logs after their initial appearance captured above.
Thank you for your time! Looking forwards to any additional advice