cyoung / stratux

Aviation weather and traffic receiver based on RTL-SDR.
BSD 3-Clause "New" or "Revised" License
1.06k stars 363 forks source link

Is serial traffic data limited in any way #883

Open egite opened 6 months ago

egite commented 6 months ago
  1. Stratux version:

  2. Stratux config:

    SDR

    • [ ] single
    • [ x] dual

    GPS

    • [ x] yes
    • [ ] no type: GPSYes

    AHRS

    • [x ] yes
    • [ ] no

    power source: ship's power

    usb cable: yes

  3. EFB app and version: Avare (latest) and GRT HXr EFIS with serial link at 115200 baud.

  4. Description of your issue:

Is the serial output limited in any way? On the ground on the EFIS, I see traffic out to more than 100 miles suggesting the serial link is sending all ADS-B data. As soon as I'm in the air, the traffic on the EFIS is limited to what looks like just UAT traffic (this is not related to any altitude/distance filtering on the EFIS). Very infrequently when I'm in the air, I'll get a full picture of traffic again, suggesting ADS-B is being sent during those times. Traffic shown in Avare is complete all the time.

I wrote a python script to capture the GDL90 data from the Stratux in flight from port UDP port 4000. I can process that data offline and create KMZ files for all the traffic and can see that both complete ADS-B and UAT data are available from the Stratux. The GDL90 data saved by the EFIS also confirms that it's not getting the complete picture in the air. So it seems as though the serial link isn't being sent all the data, especially when in the air.

I poked around in the Stratux code and I don't see anything obvious that would limit the data in the serial link to the EFIS whilst in the air.

Am I missing something that would cause the serial link to restrict what data it sends to the EFIS?

Thanks.

egite commented 4 months ago

I was able to solve this issue on advice from someone much smarter than me. Recompiling gen_gdl90 with the change outlined below is the solution. The reason this solves the issue is because Stratux pads all messages to the full 423-byte frame length. This in turn overruns the serial link's bandwidth which in turn restricts the data available to the connected device (in my case, the EFIS). Changing the frame length to only the message size drastically reduces the required bandwidth and thus does not limit the data provided to the connected device through the serial device.

I hope this helps anyone else with this issue.

in main/gen_gdl90.go, change frame := make([]byte, UPLINK_FRAME_DATA_BYTES) to frame := make([]byte, msglen)