Adding MAVLINK support

erskyTx runs on many radios and upgrade boards
ersky9x was a port of er9x for use on the sky9x board.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

I've done another commit, this one should return a RSSI value, when operating in the Tx. I can't test it though as I don't have anything that will send an RSSI value!

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Geofrancis
Posts: 27
Joined: Sat Jul 02, 2016 10:44 am
Country: -

Re: Adding MAVLINK support

Post by Geofrancis »

MikeB wrote:I've done another commit, this one should return a RSSI value, when operating in the Tx. I can't test it though as I don't have anything that will send an RSSI value!

Mike.
if its just apm you are using for testing then just enable the rssi pin and connect it to either ground or 5v to test 0 and 100%

what about using RSSI for rc rssi and SWR for telemetry rssi?
Geofrancis
Posts: 27
Joined: Sat Jul 02, 2016 10:44 am
Country: -

Re: Adding MAVLINK support

Post by Geofrancis »

How did you test the raw output if the adapter?
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

First on a 'scope, then I have an APM board (no GPS etc.) I can connect to the arduino, then the Arduino output directly into the SPort input on a Tx.
I've only learnt enough about the APM board (so far) to get it to send telemetry data for basic testing. I need to look up how I could configure it to handle RSSI.

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

Re: Adding MAVLINK support

Post by Kilrah »

In an APM setup there may be a large number of different RSSIs, that can be reported differently and may or may not be accessible depending on the particular hardware and software combination and configuration.

You'll never get around this without enough details from the requesters about what exactly they are looking for.

Geofrancis
Posts: 27
Joined: Sat Jul 02, 2016 10:44 am
Country: -

Re: Adding MAVLINK support

Post by Geofrancis »

I haven't tested your latest code but people are saying it's not working. http://www.rcgroups.com/forums/showthre ... st35842653
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

The non-polling version is sending hardware ID 0x98, the polling version responded on hardware ID 0xBA. I used the 0x98 value to be the same as that sent by a XJT.
On the Taranis, with openTx, it may be necessary to "Discover Sensors" again if they are on a different hardware ID.
Maybe I need to use 0xBA.

This is a single change in the source file "Aserial.cpp":

Code: Select all

		  case TRANSMIT_STOP_BIT:
				if ( TxCount >= 16 )
				{
					if ( TxCount == 16 )
					{
						SwUartTXData = 0x98 ;
change the 98 to BA.

It worked on ersky9x.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
djvdberg
Posts: 4
Joined: Thu Oct 30, 2014 6:37 pm
Country: -

Re: Adding MAVLINK support

Post by djvdberg »

Morning all,

First of all WOW, thanks Mike for the time and effort and everybody for testing this!

Now I'm not a noob when it comes to RC/Hacking, but you have me stumped here, I've read through all the threads and still missing how this is all configured/connected??

Can someone please take the time to run me through this, I can allso maybe do some writeup in terms of a quick start guide with pics etc..

All I want to do is:
-- Have telemetry sent from quad/plane via fsrky rx to Frsky tx
-- On the Tx send Telemetry data to tablet for Tower app via bluetooth

I'm using the 9XR Pro with DJT tx module and D8RII rx, so..

-- What firmware do I flash? Links?
-- What connection do I make on the plane/quad from pixhawk/apm to Frsky Rx? Arduino? Firmware Links?
-- What changes do I make on 9XR to send APM telemetry via bluetooth?
-- Can I use built in Bluetooth, if so how?

So for now I'm not even interested in showing anything on telemetry screen, just want Mavlink data to avoid using 3DR radios.

Thanks in advance guys, I'm hoping somebody can spare some time to assist, next question will be to do exactly the same but with orangelrs radio's with openlrsng, but I'll leave that for a separate question. And then third question will be to actually show stuff on telemetry screen, but let's separate these.

I can help with a quick start guide with all the options/links/pics etc and then maybe post it in the original post for any new guys?

Thanks!
Dion
Geofrancis
Posts: 27
Joined: Sat Jul 02, 2016 10:44 am
Country: -

Re: Adding MAVLINK support

Post by Geofrancis »

Mavlink cannot be used over frsky rc.

You would have to use an UHF system that supports it like Openlrs, dragonlink v3 or tbs crossfire.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

djvdberg wrote:I'm using the 9XR Pro with DJT tx module and D8RII rx, so..

-- What firmware do I flash? Links?
-- What connection do I make on the plane/quad from pixhawk/apm to Frsky Rx? Arduino? Firmware Links?
-- What changes do I make on 9XR to send APM telemetry via bluetooth?
-- Can I use built in Bluetooth, if so how?
Latest test versions of ersky9x are here: viewtopic.php?f=7&t=4676
To use FrSky Rx, you need an Arduino to convert APM Mavlink to FrSky telemetry, source files on Github here: https://github.com/MikeBland/APM_Mavlink_to_FrSky.
With the Arduino, the telemetry arriving at the Tx is in FrSky format, so it is not possible to then send APM telemetry out from the Tx.
As Geofrancis said, you would need a Tx module and Rx that passes the raw APM telemetry to the Tx.
There is a thread about adding a bluetooth module, including the 9XR-PRO, here: viewtopic.php?f=122&t=5641&hilit=instal ... 05+9xr+pro.

Ersky9x does have an option to send out all received telemetry data to such a bluetooth module. It is sent exactly as received.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
djvdberg
Posts: 4
Joined: Thu Oct 30, 2014 6:37 pm
Country: -

Re: Adding MAVLINK support

Post by djvdberg »

Ok thanks guys, see I was under the impression you can "encode" mavlink to frsky, send it, then "decode" it again from frsky to mavlink, and send via bluetooth..?

So how is it done with openlrs module?

Thanks guys, appreciated!

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

Re: Adding MAVLINK support

Post by Kilrah »

OpenLRS is set to transmit data transparently like 3DR radios would.
samys13
Posts: 58
Joined: Mon Feb 29, 2016 5:55 pm
Country: -

Re: Adding MAVLINK support

Post by samys13 »

hi mike i saw last week end that Alt and gAlt on the handset are not in meters but decimeters with mavlink.
my RTL mode is set to stand at 100 meters and there was 1000 on the screen.

Sam
samys13
Posts: 58
Joined: Mon Feb 29, 2016 5:55 pm
Country: -

Re: RE: Re: Adding MAVLINK support

Post by samys13 »

samys13 wrote:It works [emoji2]
ImageImage

Envoyé de mon GT-I8190 en utilisant Tapatalk
Hi mike i don't know why but rssi never change and always stay at 100%
Thanks
Sam

Envoyé de mon GT-I8190 en utilisant Tapatalk
gyrex
Posts: 20
Joined: Sun Oct 23, 2016 11:10 am
Country: -

Re: Adding MAVLINK support

Post by gyrex »

Hi guys,

I'm completely new to the FPV world and I'm about to start my first FPV build and I'm hoping one of you guys could please help me with my question :)

I've bought a Turnigy 9XR Pro and I'll build some Ultimate LRS (ULRS) mini's (https://www.rcgroups.com/forums/showthr ... ?t=2037442) for Tx & Rx. I'll be running a 2.4GHz relay on the ground station for RF separation and so that I can have my kit in a case. I've got a FrSky DJT Tx module for the 9XR Pro and an FrSky D4R-II as the receiver. Here's a diagram of my intended solution.

Image

Is this possible with ersky9x? Can the ersky9x firmware read/interpret Mavlink telemetry natively?

Thanks for your help guys and I'm sorry if this question has been answered previously but it's not entirely clear to me.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

Yes, I now have Mavlink telemetry being processed in ersky9x. You will probably need to use the ULRS to get the telemetry transferred, the D4R-II to DJT telemetry link does not really have the bandwidth to handle the raw Mavlink data.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
gyrex
Posts: 20
Joined: Sun Oct 23, 2016 11:10 am
Country: -

Re: Adding MAVLINK support

Post by gyrex »

MikeB wrote:Yes, I now have Mavlink telemetry being processed in ersky9x. You will probably need to use the ULRS to get the telemetry transferred, the D4R-II to DJT telemetry link does not really have the bandwidth to handle the raw Mavlink data.

Mike.
That's brilliant news Mike! So I don't need an Arduino to convert Mavlink to FrSky? Re bandwidth: I don't mind if the telemetry is delayed by using the FrSky relay - can I still use the solution above if I'm happy to have some latency?

I see there's quite a few variations of the test firmware, which version do I need to run? Thank you so much for all your hard work on this project.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

It's not so much a delay as the link just can't transfer all the data fast enough. If you are using the FrSky telemetry link, then you will need to use an Arduino to convert the data from Mavlink to FrSky.
Use the most recently dated test version unless it is specified as being only for a specific test.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
gyrex
Posts: 20
Joined: Sun Oct 23, 2016 11:10 am
Country: -

Re: Adding MAVLINK support

Post by gyrex »

Thanks Mike. Once again, I apologise if my questions are stupid but I'm still trying to wrap my head around this. Are you saying that FrSky telemetry capable Tx & Rx devices such as the DJT/D4R-II can't carry Mavlink data? So a solution such as this won't work?

Image

And I have to implement a solution such as this with an Arduino mavlink->frsky converter between the ULRS mini & FrSky rx?

Image

I was hoping to keep the solution as clean and as simple as possible for obvious reasons :)
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

I'm unclear why you do need two RF links. My understanding is you can put the ULRS in the Tx and that handles both control and telemetry. You don't show how the controls are sent to the aircraft.
You last diagram will work for the telemetry.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
gyrex
Posts: 20
Joined: Sun Oct 23, 2016 11:10 am
Country: -

Re: Adding MAVLINK support

Post by gyrex »

MikeB wrote:I'm unclear why you do need two RF links. My understanding is you can put the ULRS in the Tx and that handles both control and telemetry. You don't show how the controls are sent to the aircraft.
You last diagram will work for the telemetry.

Mike.
I don't *need* 2 RF links. Having the FrSky 2.4GHz relay means I can:

1. Put all of my FPV equipment into a single postable case and have some portability with the transmitter.
2. Or if I'm doing closer range flying, I can mount the FPV monitor on my monitor stand with the vTx & antenna velcro'd to the back and I can have some decent separation between the UHF gear and my vTx gear.

The FrSky relay just gives me more flexibility with my gear basically :) Does that make sense?

So you're saying that the 1st diagram won't work but the 2'nd should? In any case, I'll try both of them out and see what happens. I don't know nearly as much about telemetry or anything FPV as you obviously do, but I thought that if the 9XR Pro can read Mavlink telemetry data then either solution should work? Unless the FrSky D series gear can't transmit Mavlink data?

Mike, do you accept beer donations for your work on the firmware? Also, do you know if OpenTx can read Mavlink data too or is it only ersky9x?
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

The second diagram should work fine.
I understood openTx does support Mavlink data directly.
Note that the FrSky 'D' telemetry does not pass the serial data completely transparantly. It packs the serial data into FrSky packets and needs to be 'unpacked' in the Tx.
The serial port on the 'D' Rx runs at 9600 baud, but the telemetry link cannot handle 1000 bytes per second, only much less (probably not even 500).

I don't fly FPV, nor do I actually use Mavlink.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
gyrex
Posts: 20
Joined: Sun Oct 23, 2016 11:10 am
Country: -

Re: Adding MAVLINK support

Post by gyrex »

MikeB wrote:The second diagram should work fine.
I understood openTx does support Mavlink data directly.
Note that the FrSky 'D' telemetry does not pass the serial data completely transparantly. It packs the serial data into FrSky packets and needs to be 'unpacked' in the Tx.
The serial port on the 'D' Rx runs at 9600 baud, but the telemetry link cannot handle 1000 bytes per second, only much less (probably not even 500).

I don't fly FPV, nor do I actually use Mavlink.

Mike.
Gotcha - now I understand why the first solution wouldn't work. Thanks for explaining this to me :) Does the same packing and unpacking process of the serial data occur on the FrSky X series gear as well?

9600 baud.. geez, takes me back to circa 1994 days with my trusty old dialup modem. Admittedly, my 9600 baud modem was an enormous technological leap from my 2400 baud modem :) I can understand how there's not enough bandwidth to push any decent amount of telemetry data through that pipe.

I'll try and find a Mavlink to FrSky arduino conversion project for my D series gear.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
gyrex
Posts: 20
Joined: Sun Oct 23, 2016 11:10 am
Country: -

Re: Adding MAVLINK support

Post by gyrex »

MikeB wrote:Mine is here: https://github.com/MikeBland/APM_Mavlink_to_FrSky.

Mike.
Wow Mike, the amount of work you've done for the community is outstanding! Thank you so much mate.

Does this work for DJT/D4R-II gear? If it does, this is exactly what I'm after! Is there a thread or webpage with info on the project?

BTW, you might want to fix the typo on the project heading so people can find it with a google search. "Arduino Pro Mini convert MAVLINK data to FrSkt protocol"
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

There should be some info earlier in this thread.
It supports both hub 'D' and SPort 'X' telemetry protocols.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
GhostSharp
Posts: 12
Joined: Thu Apr 09, 2015 8:18 am
Country: -

Re: Adding MAVLINK support

Post by GhostSharp »

Hi Mike,

I just flash the nano board... I was looking for into code the pin that i must solder in nano board for connect to sport.... I dont sure.... Is Pin D5 -> Signal Port?

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

Re: Adding MAVLINK support

Post by MikeB »

Yes, port D bit 5. It is I/O 5 on the Pro Mini.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
gyrex
Posts: 20
Joined: Sun Oct 23, 2016 11:10 am
Country: -

Re: Adding MAVLINK support

Post by gyrex »

Mike, what serial baud rate will the arduino be able to sync with on the Mavlink input side? Apparently ULRS transmits at 115200 baud.

Sent from my LG-H815 using Tapatalk
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

It is set to 57600.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Post Reply

Return to “erskyTx (was ersky9x)”