APM Mavlink over FrSky and then back to Mavlink

Hi guys!
Who wants to transmit APM Mavlink telemetry data to ground station using FrSky only? (e.g. without 3DR radio)

Using two Arduinos I have made this possible. One Arduino ("sending part") is on the plane between APM telemetry UART and FrSky receiver RX. Second arduino ("receiving part") is on ground on the transmitter reading its UART, converting data and sending it to ground station running Mavlink compatible software.

Source code can be found on github, here
https://github.com/CzechUavGuy/APM-Mavlink-to-FrSky

I have even included a demoversion - special firmware for receiving arduino that generates "fake" telemetry data of virtual airplane flying above Prague..

Receiving Arduino receives not only telemetry from APM, but can also read internal FrSky frames that contain RSSI and voltage - if you have a FrSky voltage regulator.

How it works:
Sending part reads data from APM, caches them in global state, and periodically generates proprietary two byte messages and sends them to FrSky UART. Various data are send using different frequency: For example plane attitude (roll, pitch and yaw) is being sent more often than GPS coordinates. See attached image on how the sending part is wired.

Obviously, not all MavLink messages are transferred to ground. Effective bandwidth of FrSky downlink is only about 1200 bps! Currently, only those telemetry information are sent: roll, pitch, yaw, altitude (only 1x, not relative - that could be computed on ground), speed (only vGND), GPS lat, GPS lon. FrSky adds battery voltage and RSSI. More messages can be added, maybe at the cost of lowering frequency of the previous messages.

Two byte protocol works like this: First byte starts with bit 1, second byte starts with bit 0. Bits 2-5 of first byte contain information of data type being sent (ie. only 16 different telemetry types are possible). Rest 10 bits from the first and second byte contain useful data.

Receiving part reads data from FrSky transmitter (I use DIY FrSky module), unpacks it and immediately generates MavLink message that is sent to output UART (USB to computer MissionPlanner or OTG cable to Android ground control station like DroidPlanner/AndroPilot).

On airplane I use Arduino Pro Mini, on ground I prefer Arduino Nano since it already has FTDI converter co it can be connected to PC/Android directly.

Current limitation:
Using FrSky it is only possible to download data from plane to ground control station. Uplink is not possible as far as I know. I am working on a hacking project that will make it possible to encode a few bps on channel 7 and 8 so that even uplink will be possible. Will post when I finish this.

sending_part_connection.jpg

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

    • Zdar Pavle

      What do you mean by skipping ground station hardware? You mean to modify MissionPlanner or DroidPlanner to be compatible with my two-byte protocol?

      If yes, then I don't like this idea because I would have to maintain it forever. When I use ground arduino, I can always get the latest version of ground control software and be compatible with it..

      Maybe it would be possible to program a daemon that would convert two byte protocol to MavLink and communicate with ground station over TCP/IP, but Arduino was faster for me..

      Is it what you meant?

      • Hi,

        I am using Linux for running MissionPlanner. On Linux it is very easy to redirect datastream between different processes. Your protocol conversion code would then run as a program that reads from serial port  /dev/ttyS0 ( or in my case from bluetooth port that i use to read data from frsky) and write to /dev/something . In the apmplanner you simply select /dev/something in the MissionPlanner, so no changes are needet to apmplaner. 

        I'll also check if uplink works or not and i'll drop a note.

        • At first, I also used only MissionPlanner (on Win though), but then I decided it would be more comfortable to use Android-based station. So I would have to implement another translating SW. If you are comfortable with programming on Linux, it should be easy to translate Arduino source code to Linux. Please if you add new features give me echo, so I could implement them as well.

          If you have any progress on uplink, it would be great! I have managed to hack my Turnigy 9X nad instead of one potentiometer I have added DA converter which is controllable by Arduino. Basic uplink can be done this way. Unfortunately it is very slow.

          • Hi,

            I have put this a bit aside, since i was struggling with build dependencies (libraries) that are not added into the project.
            During the weekend i'll continue, but it would be helpful if you would list the libraries needed to be present in order to successfully compile the code.

            • This project is based on https://github.com/vizual54/APM-Mavlink-to-FrSky so you can find the libraries there.

              I will try to upload them to my github as well.

              vizual54/APM-Mavlink-to-FrSky
              APM Mavlink to FrSky telemetry. Contribute to vizual54/APM-Mavlink-to-FrSky development by creating an account on GitHub.
This reply was deleted.

Activity