Send telemetry to PC in real time

Hardware help and support for the FrSky Taranis
Swifterone
Posts: 24
Joined: Wed Aug 13, 2014 4:26 am
Country: -

Send telemetry to PC in real time

Post by Swifterone »

I have replaced the receiver on my DJI Phantom with the X8R and have the LIPO sensor working to send voltage data to my Taranis via telemetry. I have just ordered the GPS module as well.

Is there any way I can get telemetry data from the Taranis receiver in real time to a PC so I can track the Phantom with a moving map? I'm pretty software handy, so if I can get the data via USB or somehow, I can write the software needed to plot the coordinates.

I know I can download the data post-flight and plot it...I already have software I can modify that will do that.

User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Send telemetry to PC in real time

Post by Kilrah »

With openTx 2.0 you can get the telemetry data on the serial port that is accessible in the battery bay of the radio.

Sent via mobile
Swifterone
Posts: 24
Joined: Wed Aug 13, 2014 4:26 am
Country: -

Re: Send telemetry to PC in real time

Post by Swifterone »

That's awesome. Is there a pointer to some implementation notes or someone who has done this?
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Send telemetry to PC in real time

Post by jhsa »

On the 9xr pro we use bluetooth. Maybe you can connect a bluetooth module to it? At the moment I'm able to receive telemetry data on my android phone and eepskye. Maybe when Mike has time for it, this could be improved. But the basis is there already. :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Send telemetry to PC in real time

Post by Kilrah »

Just turn on S. Port Mirror in the hardware settings, then connect to the PC either via wired connection (the FrSky update cable is a good candidate, serial level is RS232) or indeed by connecting a properly configured bluetooth module or radio modem to it.

Swifterone
Posts: 24
Joined: Wed Aug 13, 2014 4:26 am
Country: -

Re: Send telemetry to PC in real time

Post by Swifterone »

So, has anyone actually done this? Is there any step by step guide to getting the telemetry data feed? I found the hardware setting and turned to S-Port Mirror (there was also a setting that said Telemetry), connected a battery to my Phantom, started receiving telemetry, and tried to connect to the USB Port on the Taranis via a Read operation of a USBEndPointReader in the LibUSBDotNet framework in C# on a PC.

I was able to read nothing, nada, even though I can see the Taranis clearly when it connects to the PC through a DeviceNotification. It shows up in Device Manager as a Human Input gaming device.

So, I connected the PC to the internal battery bay serial port using the FRSKY upgrade cable ( http://www.alofthobbies.com/usb-upgraded-cable.html ), and I can see Taranis as COM3. But, this is just upgrading the firmware, no? I cannot actually power the radio when using this cable.

So, are people out there just guessing, am I missing some secret sauce, or has anyone actually done this?
User avatar
dinamich
Posts: 288
Joined: Mon Apr 01, 2013 1:21 pm
Country: Slovenia
Location: Ljubljana

Re: Send telemetry to PC in real time

Post by dinamich »

No, do not use USB port for this. Serial port on Taranis is hidden in battery compartment. That is the right io inerface for your requirements.
projectkk2glider@github
User avatar
dinamich
Posts: 288
Joined: Mon Apr 01, 2013 1:21 pm
Country: Slovenia
Location: Ljubljana

Re: Send telemetry to PC in real time

Post by dinamich »

Also you will need to study opentx source to find out the serial port settings and more importantly the format of telemetry stream.
projectkk2glider@github
Swifterone
Posts: 24
Joined: Wed Aug 13, 2014 4:26 am
Country: -

Re: Send telemetry to PC in real time

Post by Swifterone »

dinamich wrote:No, do not use USB port for this. Serial port on Taranis is hidden in battery compartment. That is the right io inerface for your requirements.
Ok, cool. I have the FRSKY USB serial cable that will connect to this. The only problem is, how does one power the Taranis when using it, as this is also where the battery plugs in? Does one power the Taranis with a LIPO on the other port on the right of the micro USB card? What battery would one use for this? The plug is a 4 pin plug smaller than the 4 pin balance plug on a 3S LIPO I use to power the Phantom. What is this plug for?

So many questions, so much conflicting information!
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Send telemetry to PC in real time

Post by Kilrah »

The power connector doesn't magically transform into a serial port... The usual battery is connected as normal, the serial port is obviously the other, 4-pin plug. You'll have to source a connector and hack a cable, solder on the connector, or whatever pleases you...
User avatar
dinamich
Posts: 288
Joined: Mon Apr 01, 2013 1:21 pm
Country: Slovenia
Location: Ljubljana

Re: Send telemetry to PC in real time

Post by dinamich »

Image

On the left is battery connector, in the middle SD card slot, on the right serial port connector. Pinout for serial port is written on the board next to pins. The baud rate depends on what the serial port is set to (Radios setup, page 6/8, Serial port setting):
* S-Port-Mirror 57600,8,1,N - outputs all SPrort received telemetry
* Telemetry 9600,8,1,N - receives telemetry stream on this port, output none
* debug (only with opentx debug build) 115200,8,1,N - debug output

So you need to choose S-Port-Mirror mode.

Update: Serial port pins from left to right:
* GND ground, connect to pin 5 of PC serial port (ground)
* not needed
* UART_T this is transmit line from Taranis, connect to pin 2 of PC serial port (RX line)
* UART_R this is receive line of Taranis, connect to pin 3 of PC serial port (TX line)
Last edited by dinamich on Thu Aug 14, 2014 4:39 pm, edited 1 time in total.
projectkk2glider@github
strips
Posts: 21
Joined: Fri Feb 28, 2014 6:43 am
Country: -

Re: Send telemetry to PC in real time

Post by strips »

@Swifterone
If you make such a software please share it with the rest of us. Having a telemetry dashboard would be cool.

Also have to look into adding Bluetooth to my Taranis :-)
User avatar
dinamich
Posts: 288
Joined: Mon Apr 01, 2013 1:21 pm
Country: Slovenia
Location: Ljubljana

Re: Send telemetry to PC in real time

Post by dinamich »

Created wiki page for Taranis serial port: https://github.com/opentx/opentx/wiki/T ... erial-port
projectkk2glider@github
Swifterone
Posts: 24
Joined: Wed Aug 13, 2014 4:26 am
Country: -

Re: Send telemetry to PC in real time

Post by Swifterone »

strips wrote:@Swifterone
If you make such a software please share it with the rest of us. Having a telemetry dashboard would be cool.

Also have to look into adding Bluetooth to my Taranis :-)
I have already made moving map software for displaying in-flight UAV position, heading, course, speed and altitude from an Internet-connected cell phone attached to the drone. My plan is to modify this existing software to display such data, along with other FRSKY telemetry info, fed from the X9D's serial port.

You can see the software here: https://www.youtube.com/watch?v=AN1JmhZfkJo

The software is written in C# for WPF on Windows 7 or 8.
Swifterone
Posts: 24
Joined: Wed Aug 13, 2014 4:26 am
Country: -

Re: Send telemetry to PC in real time

Post by Swifterone »

So, I'm grateful for the knowledge of the pin outs and the fact that I need a 4 pin female 2mm pitch connector with wiring harness (no idea where to get one, and Google returns a thousand wholesalers in China when I need one local source for a female connector with wires already attached).

Who was the design genius who put this valuable port inside the inaccessible battery compartment? I will have to drill a hole of some kind to get the serial wires out, presuming I can get the 2mm pitch connector or figure something else out.
strips
Posts: 21
Joined: Fri Feb 28, 2014 6:43 am
Country: -

Re: Send telemetry to PC in real time

Post by strips »

Nice :-)
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Send telemetry to PC in real time

Post by jhsa »

Swifterone wrote: Who was the design genius who put this valuable port inside the inaccessible battery compartment? I will have to drill a hole of some kind to get the serial wires out, presuming I can get the 2mm pitch connector or figure something else out.
Where did you want him to put the connector? Inside the radio? Like mine? Fortunately I'm using a bluetooth module so I don't need wires. The battery compartment is the best place for it. at least you don't have to open the radio to access it :)
These connectors are used everywhere in modern electronics.
I bought these a couple months ago. This is what you want..

http://cgi.ebay.com/ws/eBayISAPI.dll?Vi ... 1441351403

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
Swifterone
Posts: 24
Joined: Wed Aug 13, 2014 4:26 am
Country: -

Re: Send telemetry to PC in real time

Post by Swifterone »

jhsa wrote:
Swifterone wrote: Who was the design genius who put this valuable port inside the inaccessible battery compartment? I will have to drill a hole of some kind to get the serial wires out, presuming I can get the 2mm pitch connector or figure something else out.
Where did you want him to put the connector? Inside the radio? Like mine? Fortunately I'm using a bluetooth module so I don't need wires. The battery compartment is the best place for it. at least you don't have to open the radio to access it :)
These connectors are used everywhere in modern electronics.
I bought these a couple months ago. This is what you want..

http://cgi.ebay.com/ws/eBayISAPI.dll?Vi ... 1441351403

João
Why, I would have wanted FRSKY to put the connector so it was accessible from outside the radio, of course, perhaps right below the USB connector.

Thanks very much for the link to the connectors, that will speed me onto getting a live data stream that I can figure out how to parse and plot. My GPS and Vario sensors came today, and I need to open up the Phantom and install them.
Swifterone
Posts: 24
Joined: Wed Aug 13, 2014 4:26 am
Country: -

Re: Send telemetry to PC in real time

Post by Swifterone »

Ok, so I've gotten my connectors and have hooked the Taranis to a serial port on the PC, using the pinouts in the wiki. The Taranis is set to SPORT Mirror. On the PC serial utility, I have 57600, N, 8, 1. I set my serial port utility to receive and I get nothing, ever. Nada.

I reverse the send/receive lines, just to make sure, and still get nothing. Nada.

Any ideas? Has anyone ever done this before? At the very least, I had hoped for periodic dumps of binary data that I would have to then map to structures in the Taranis source. But, nothing.
User avatar
dinamich
Posts: 288
Joined: Mon Apr 01, 2013 1:21 pm
Country: Slovenia
Location: Ljubljana

Re: Send telemetry to PC in real time

Post by dinamich »

It works for me. Did you forgot to turn off hardware or software handshake? It sends some sport data even when receiver is not turned on (like rssi an swr). Try to open serial port in a generic serial terminal program. Do you use win or linux?
projectkk2glider@github
Swifterone
Posts: 24
Joined: Wed Aug 13, 2014 4:26 am
Country: -

Re: Send telemetry to PC in real time

Post by Swifterone »

dinamich wrote:It works for me. Did you forgot to turn off hardware or software handshake? It sends some sport data even when receiver is not turned on (like rssi an swr). Try to open serial port in a generic serial terminal program. Do you use win or linux?
I used both generic serial programs and my own code, under Windows 8, using a USB to Serial interface port (COM5) of known capability. Since you have been successful, could you share your exact setup with me?

Also, other threads seem to say that the connecter inside the battery port is an actual Smart Port, and not an RS-232 serial port. Do I need some special FRSKY serial cable or other adapter?

Thanks!
User avatar
MikeB
9x Developer
Posts: 18010
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Send telemetry to PC in real time

Post by MikeB »

It is a 'normal' serial port. The logic is inverted (like RS232), but the output is driven by a transistor to ground and a pull up resistor (2K2 to 3.3V).

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Send telemetry to PC in real time

Post by Kilrah »

Swifterone wrote: Also, other threads seem to say that the connecter inside the battery port is an actual Smart Port, and not an RS-232 serial port.
The actual smart port is in the module compartment.
User avatar
dinamich
Posts: 288
Joined: Mon Apr 01, 2013 1:21 pm
Country: Slovenia
Location: Ljubljana

Re: Send telemetry to PC in real time

Post by dinamich »

This is the cable and USB to serial adapter that I use. Wired as described on wiki page. Baud rate 57600 bps.
Attachments
DSC_9037.JPG
projectkk2glider@github
User avatar
dinamich
Posts: 288
Joined: Mon Apr 01, 2013 1:21 pm
Country: Slovenia
Location: Ljubljana

Re: Send telemetry to PC in real time

Post by dinamich »

If you look at my cable and measure voltage between green (positive probe) and gray (negative probe) wire with Taranis disconnected from other devices including USB to serial adapter you should get:
* in S-port mirror mode about 0V
* in Telemetry mode about 3.1V

One reason why it is not working for you is that your USB to serial adapter might not be as tolerant as mine. Taranis can't produce negative voltage in TX line, the best it can do is zero volts. Maybe this is not enough for your serial adapter. If you can try another one.
projectkk2glider@github
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Send telemetry to PC in real time

Post by Kilrah »

The FrSky USB adapters of course work perfectly.
Swifterone
Posts: 24
Joined: Wed Aug 13, 2014 4:26 am
Country: -

Re: Send telemetry to PC in real time

Post by Swifterone »

dinamich wrote:This is the cable and USB to serial adapter that I use. Wired as described on wiki page. Baud rate 57600 bps.
Ok, so I made up a little RS-232 connector similar to what you've done here, and now I can get data from the Taranis, both with a serial utility and my own C# software.

Now, I have to parse the stream. This note and the code linked therein will prove invaluable, I'm sure. https://code.google.com/p/telemetry-con ... rtProtocol

Thanks for your help, everybody. I'll let you know when I have some software results.
Swifterone
Posts: 24
Joined: Wed Aug 13, 2014 4:26 am
Country: -

Re: Send telemetry to PC in real time

Post by Swifterone »

Ok, so after a week of work, it looks like I can successfully decode the serial telemetry stream from the Taranis. Because I have a limited number of sensors, I can only test a few things like BaroAltitude, RSSI, SWR, etc. But, I think the other data items will decode just fine.

If my TaranisTelemetry class is passed a reference to a ViewModel object supporting INotifyPropertyChanged, that view model will automatically be updated from the decoded stream, and thus, any Winforms, WPF, or Windows Store UI components will automatically reflect the update in whatever user interface it is bound to.

I will be putting up a GitHub repository with the Visual Studio project shortly. I would hope that I could get some good code reviews from the OpenTx software team, since I only have a limited experience with the codebase you all know so intimately, and this Taranis is my first RC transmitter ever (I only have a DJI Phantom).

Thoughts?
SeaFrog
Posts: 12
Joined: Mon Sep 01, 2014 10:31 am
Country: -

Re: Send telemetry to PC in real time

Post by SeaFrog »

Good job, thanks.
As you are using a Phantom, you might have a look at this device.
It seems that by adding no more than 3,5 gr one can get the full Naza and GPS bus data.
Yet not available this week, but probably next week.
Last edited by SeaFrog on Wed Sep 03, 2014 6:38 pm, edited 2 times in total.
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Send telemetry to PC in real time

Post by Kilrah »

That's a cool thing!

Post Reply

Return to “FrSky Taranis radio”