Small tracker filter utility

Trackers like U360GTS cannot work with Mavlink2 correctly and do have a problem with unfiltered high bandwidth Mavlink streams.

I wrote a small filter utility GitHub - fingadar/trackermavfilter: small Mavlink filter, inputs Mavlink(2), outputs few messages for i.e. trackers as mavlink1 . It takes a Mavlink2 stream from UDP or STDIN (for OpenHD i.e.) and outputs only the tracker relevant Mavlink messages as Mavlink1 to an UART. It outputs only Mavlink messages MAVLINK_MSG_ID_GLOBAL_POSITION_INT, MAVLINK_MSG_ID_GPS_RAW_INT, MAVLINK_MSG_ID_ATTITUDE to an uart to reduce data traffic.

A possibility to include it in OpenHD would be
cat /var/run/openhd/telemetryfifo6 | /home/pi/trackermavfilter/trackermavlinkfilter -d /dev/ttyUSB0 -b 115200 -n

(or the use of the corresponding params from the openhd-settings-?.txt config)

I would be happy if someone could get some benefit from it. If you have any questions, feel free to ask :slight_smile:

Stefan

2 Likes

Example installation in Open.HD:

  1. Copy the binary to /usr/local/bin/
  2. Add a parameter to openhd-settings-?.txt: TELEMETRY_OUTPUT_SERIALPORT_GROUND_COMMAND=/usr/local/bin/trackermavlinkfilter
  3. Change /usr/local/share/wifibroadcast-scripts/osd_rx_functions.sh:
 if [ "${ENABLE_SERIAL_TELEMETRY_OUTPUT}" == "Y" ]; then
     if [ "${TELEMETRY_OUTPUT_SERIALPORT_GROUND_COMMAND}" != "" ]; then
         echo "Sending telemetry stream to ${TELEMETRY_OUTPUT_SERIALPORT_GROUND_COMMAND} -d ${TELEMETRY_OUTPUT_SERIALPORT_GROUND} -b ${TELEMETRY_OUTPUT_SERIALPORT_GROUND_BAUDRATE} -n"

         nice cat /var/run/openhd/telemetryfifo6 | ${TELEMETRY_OUTPUT_SERIALPORT_GROUND_COMMAND} -d ${TELEMETRY_OUTPUT_SERIALPORT_GROUND} -b ${TELEMETRY_OUTPUT_SERIALPORT_GROUND_BAUDRATE} -n &
     else
         echo "Sending telemetry stream to ${TELEMETRY_OUTPUT_SERIALPORT_GROUND}"
 
         nice stty -F ${TELEMETRY_OUTPUT_SERIALPORT_GROUND} ${TELEMETRY_OUTPUT_SERIALPORT_GROUND_STTY_OPTIONS} ${TELEMETRY_OUTPUT_SERIALPORT_GROUND_BAUDRATE}
 
         nice cat /var/run/openhd/telemetryfifo6 > ${TELEMETRY_OUTPUT_SERIALPORT_GROUND} &
     fi
 fi
1 Like

During some tests, it seems to be necessary to add something to /usr/local/share/wifibroadcast-scripts/osd_rx_functions.sh :
Under the line
ps -ef | nice grep "cat /var/run/openhd/telemetryfifo3" | nice grep -v grep | awk '{print $2}' | xargs kill -9
add
ps -ef | nice grep "/usr/local/bin/trackermavlinkfilter" | nice grep -v grep | awk '{print $2}' | xargs kill -9

This avoids repeated starts of the filter in case of RX restarts.

Hey!
Nice one!
I’m using ghettostation tracker and it seems to have also some problems reading and keeping up with incoming data.
Do you think, I could benefit from this code too?
Norbert

… using mavlink1 at 57600 baud rate.

Give it a try :slight_smile:
In my case, I’m using U360GTS on a Bluepill, and there it’s definitivy the case, that there seems to be a overrun with higher Mavlink message traffic.

You are talking to a total noob here :grin:
Should I mount the image and modify the stuff before writing it to SD card, or I have to modify the above on sd card?
Really total noob, when it comes to software, sorry…
If you are willing, please add a description, how to do all this on a windows computer.
Reading trough the github readme,
e.g.:
1 ) “Copy the binary to /usr/local/bin/”…
what is the " binary" and how to copy it there :slight_smile:

Oh, yes of course…
The easiest way would be to ask @stephen to add this to the next 2.01 release, as it is totally neutral to all other functions and needs just one more parameter in the config. For him this would be a 2 minute job :slight_smile:
Otherwise, I’d have to write a short installation howto.

Oookay, I’ll beg him to help… :grin:

If it’s helping I’ll consider it a bugfix and look at it today :slight_smile:

2 Likes