Spektrum Telemetry Viewer for Android

I’m announcing two new projects! TLMReaderLib, a library for decoding Spektrum TLM files, and TelemetryReaderForAndroid, an Android application for viewing Spektrum telemetry.

Here’s the story behind the projects:

I’ve always been interested in telemetry for my RC airplanes. Last year I got my dad a Taranis 9XD transmitter, receivers, and a variometer. The Taranis does telemetry right out of the box. All you have to do is make sure the receiver is telemetry capable (which all of Taranis should be now) and then just add the sensors. After placing the vario in his glider and getting some thermal action to 800+ft I was hooked.

A variometer senses the changes in altitude. When ascending a tone is emitted that is high pitch. The faster the ascent the higher pitch. When descending the opposite happens, a low pitch town that gets lower as you descend faster. Most, if not all, varios return the current altitude as well.

They get very high!

They get very high!

When talking to someone about RC sailplanes a common question that comes up is, “how high does it get?” With telemetry you can accurately tell to within a meter to a tenth of a meter your altitude. The picture above shows my second highest flight. I didn’t take a picture of it at the time but I beat this by another 10 or so feet not too long after. Using an advanced radio such as the Taranis you can even log various data points over the course of the flight so that you can review them later.

Flying a sailplane with telemetry is almost a must. You can certainly fly without it, but having the receiver pack voltage and signal strength reported back to you can prevent losing a costly airplane. I knew from the beginning that I was going to put some sort of telemetry in my Gracia Maxi. At the time I only had a Spektrum DX 18. This transmitter is excellent. I have not complaints about it. Well, no complaints against the transmitter, but Spektrum on the other hand…

Spektrum equipment costs some serious cash. Setting up my dad with his Taranis with a case and receiver plus a second 6 channel receiver and the vario cost less than $350. My DX18 alone cost $800. The receiver in the Gracia, which I bought second hand, still cost about $100. To have put in Spektrum telemetry it would be another $100 or more. I ended up opting for LemonRX telemetry which is compatible with Spektrum.

Decoding Spektrum Telemetry

The reason I mentioned what telemetry I’m using in my Gracia and why I went with LemonRX is because it is the beginning of my quest to be able to review telemetry data while at the field.

Spektrum telemetry is proprietary and closed source. This is unlike the Taranis platform which is built in an open source manner. In order to use non-Spektrum approved sensors someone had to reverse engineer what the Spektrum TM1000 looks for and sends back to the transmitter. A great thread on RCGroups has gone through and documented what the TM1000 does and how the sensors work. Thus, with this knowledge LemonRX was able to build a telemetry unit and sensors that will work with Spektrum transmitters.

Now using non-Spektrum hardware in my plane is not necessarily an issue. I don’t mind paying for quality equipment, but I also want to be able to use the data it generates. Regardless of Spektrum or LemonRX hardware the data is sent to the Spektrum transmitter which can store it to a SD card. Once it is on the SD card I think it can only be read by the Spektrum STI iDevice app. To me this makes no sense! Why log it if there is no viewer that is available to everyone!

Another RCGroups thread tackled the task of decoding the format of the file which the transmitter creates. The wonderful users of the form, lead by KimDK, were able to write a small VBA script to take the TLM file and output it to a CSV, comma separated value, file. Once in this format it is easy to open it in Excel or similar spreadsheet application to make graphs. Ok, a way to view the data! But, what about if you’re at a contest and want to review your flight data? We’re in a mobile age! You shouldn’t need to have a laptop available or be required to run software on the file to get to something you can then begin to look over.

A Library to Decode TLM Files

This is where the real story starts. I’ve gotten so frustrated with having this data locked up that I looked around to see if there was anyone working on something to view telemetry. It turns out there are two applications, paid app supports Windows and Mac OSX and a free application that only runs in Windows. I contacted the developer of the free one to see if he could pass along a library or something to decode the TLM files so that I could work on an Android application. After receiving no response I decided to tackle this issue in an open source manner so that the community could benefit from the work of all those in the two previously mentioned threads.

I created a repository on GitHub.com, TLMReaderLib. The project contains the source for a Java library which can be used to decode the byte data in a TLM file. I also included in the project a condensed version of the documentation that was created in those threads. This way if someone wanted to create a library for another language they would be able to see exactly how the data is mapped.

Another large plus of having a project setup in the way that I have done on GitHub.com is that test cases can be written and run against data. This would be allow us to see how any changes that Spektrum may make to the TLM format affect the library output for a variety of sensors. The ability to catch errors with a new format will be greatly enhanced.

The Future Android Application

At this point my library is able to decode most sensor data. From what I’m seeing in my debug output it looks as if everything is correct. My next step is to create an Android application to view the data. I’ve started another project on GitHub.com, TelemetryReaderForAndroid, to be the viewer for the telemetry data. My current goal for the view application is to be a basic viewer for the output of the decoded data. From there I will be adding in graphing support and more analysis.

Help Out!

I’m going at this by myself at this point. I’ve licensed both codebases as GPL V2. Fork the code on GitHub, make some changes or add some features, and then submit a pull request! Do you have more information on how the telemetry is decoded, especially GPS? Help me update the docs! This project wouldn’t be possible without the community!

About Mike

I'm a software engineer. Look into the about page for more information about me.
Tagged , , , . Bookmark the permalink.

Leave a Reply