Adding MAVLINK support

ersky9x is a port of er9x for use on the sky9x board.
User avatar
MikeB
9x Developer
Posts: 13850
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset

Re: Adding MAVLINK support

Post by MikeB » Sun Nov 27, 2016 11:07 pm

Clearly, if you backup your flash and EEPROM first, you can revert to openTx.
Trying ersky9x will, at least, help to narrow down where the problem is. Please flash the latest test version from here: viewtopic.php?f=7&t=4676#p65894 (ersky9xProvR219x3.zip).
On ersky9x, in the Telemetry menu, set the "Usr Proto" to ARDUC (or ARDUP).

Mike.
ersky9x/er9x developer

thartenstein
Posts: 10
Joined: Sun Jul 03, 2016 7:26 am
Country: -

Re: Adding MAVLINK support

Post by thartenstein » Wed Dec 07, 2016 6:25 pm

I've tested the setup for a while... It is a great feature. Unfortunately I'm not able to receive all telemetry.

I'm using 9xr-pro djt with x8r receiver.
Only working sport connection d5 to sport signal, d4 to sport gnd
I'm receiving: no of sat, hoop, flight mode, arm/disarm
What do I need to change to receive all telemetry data.

Thanks !!

User avatar
bob195558
Posts: 1345
Joined: Sun Dec 16, 2012 7:24 pm
Country: United States
Location: New England, Vermont
Contact:

Re: Adding MAVLINK support

Post by bob195558 » Wed Dec 07, 2016 8:32 pm

You need the XJT module (not the DJT) to be able to use S.Port telemetry with the X8R receiver.
Or there is this option: (viewtopic.php?f=84&t=6803).
oops ! that dose not work the right way for you, there maybe another option you can use, I will try to find it.

Bob B.
RADIOS: ErSky9x on Taranis, ErSky9x on Sky9x, ErSky9x on 9Xtreme,
Er9x-FrSky on 9x-Radio with Smartieparts upgrade Programmer Board and 9x-TelemetrEZ Board.
Some help info here: (http://openrcforums.com/forum/viewtopic.php?f=95&t=7182).
Bob B.

komos
Posts: 6
Joined: Tue Dec 13, 2016 1:51 pm
Country: -

Re: Adding MAVLINK support

Post by komos » Tue Dec 13, 2016 1:57 pm

Is it possible to translate warning messages (Like "Bad AHRS" - Incossistent Compasses") from pixhawk - Adrucopter to our transmitter and show them on screen? Maybe even add some voice ? I saw this feature on a Taranis with C&T module and was wondering if it is possible to port it to ersky9x

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

Re: Adding MAVLINK support

Post by MikeB » Tue Dec 13, 2016 2:24 pm

It may well be possible, I'll need to investigate.
Is this for native Mavlink or the version translated by an Arduino and sent to the Tx using FrSky telemetry protocol?

Mike.
ersky9x/er9x developer


komos
Posts: 6
Joined: Tue Dec 13, 2016 1:51 pm
Country: -

Re: Adding MAVLINK support

Post by komos » Tue Dec 13, 2016 3:56 pm

I guess native mavlink. My setup is with a TTL to RS232 convertor and a XJT-X8R. Like this.
pmshop wrote:Awesome!
I could have saved $38USD by building my own RS232 to TTL Converter for FrSky Telemetry from a Pixhawk:
http://www.ebay.com/itm/142076966567?_t ... EBIDX%3AIT
with a 1n4007 diode:
TTL.jpg
Diode band is at the top - away from the board.
Sorry im a newcome to 9x and maybe i didn't get your question.

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

Re: Adding MAVLINK support

Post by MikeB » Tue Dec 13, 2016 4:47 pm

If you have a XJT and X8R handling the telemetry, then it has to be FrSky SPort telemetry, so not native Mavlink.
I'll need to investigate what is done with the messages to which you refer.
Note that I don't fly using Mavlink or a flight controller so this may take time.
From your last post, I'm guessing you are using a Pixhawk.

Mike.
ersky9x/er9x developer

komos
Posts: 6
Joined: Tue Dec 13, 2016 1:51 pm
Country: -

Re: Adding MAVLINK support

Post by komos » Tue Dec 13, 2016 5:29 pm

Yes its a Pixhawk with apm copter loaded.

I dont want ETA's , i know that i am asking from an open source community and the nature of it.
A Big THANK YOU for the interest and the concern

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

Re: Adding MAVLINK support

Post by MikeB » Tue Dec 13, 2016 6:16 pm

So how have you got the Pixhawk configured for sending telemetry?

Mike.
ersky9x/er9x developer

komos
Posts: 6
Joined: Tue Dec 13, 2016 1:51 pm
Country: -

Re: Adding MAVLINK support

Post by komos » Tue Dec 13, 2016 6:23 pm

Using C&T manual http://www.craftandtheoryllc.com/downlo ... Manual.pdf
i set my SERIAL4_PROTOCOL on mission planner to 10.


Serial 4 is conected to rs232>TTL , and converter is conected on X8R smartport

Data came through.

zipray
Posts: 20
Joined: Sun Sep 04, 2016 9:05 am
Country: -

Re: Adding MAVLINK support

Post by zipray » Thu Dec 29, 2016 11:32 am

hi mike.When I connect the XSR S.port to pin 5 on my Pro Mini, the telemetry works, but the RSSI oscillates between 90 and 40, with about a 5 second cycle. When I disconnect it, it stays rock solid at arount 90.How to ban mavlink rssi parameter?Only use rssi frsky receiver.

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

Re: Adding MAVLINK support

Post by MikeB » Thu Dec 29, 2016 3:45 pm

What voltage level do you have on IO6 on the Pro Mini?

Mike.
ersky9x/er9x developer

zipray
Posts: 20
Joined: Sun Sep 04, 2016 9:05 am
Country: -

Re: Adding MAVLINK support

Post by zipray » Fri Dec 30, 2016 1:27 pm

MikeB wrote:What voltage level do you have on IO6 on the Pro Mini?

Mike.
I connect 5v voltage on the VCC pin of pro mini,No matter whether io6 grounding,the rssii signal is always jumping.

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

Re: Adding MAVLINK support

Post by MikeB » Fri Dec 30, 2016 7:42 pm

Please configure a switch to enable telemetry logging, then, from the main display go UP LONG, then RIGHT until you get to the DEBUG menu. Go down and tick the "Raw Logging box".
Now, with all the telemetry connected and operating, turn logging on for 20 to 30 seconds, then turn it off.
Locate the logfile on the SD card, put it in a .zip file and post it for me to look at.

Mike.
ersky9x/er9x developer

zipray
Posts: 20
Joined: Sun Sep 04, 2016 9:05 am
Country: -

Re: Adding MAVLINK support

Post by zipray » Wed Jan 04, 2017 4:17 pm

MikeB wrote:Please configure a switch to enable telemetry logging, then, from the main display go UP LONG, then RIGHT until you get to the DEBUG menu. Go down and tick the "Raw Logging box".
Now, with all the telemetry connected and operating, turn logging on for 20 to 30 seconds, then turn it off.
Locate the logfile on the SD card, put it in a .zip file and post it for me to look at.

Mike.

zipray
Posts: 20
Joined: Sun Sep 04, 2016 9:05 am
Country: -

Re: Adding MAVLINK support

Post by zipray » Wed Jan 04, 2017 4:21 pm

Mike.thaks you.
Attachments
MODEL06-2017-01-05.zip
(2.3 KiB) Downloaded 7 times

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

Re: Adding MAVLINK support

Post by MikeB » Wed Jan 04, 2017 6:53 pm

The data in the log file doesn't look correct. Please specify what hardware and firmware you are using, e.g. what transmitter, what Tx module, what receiver, what flight controller, any other hardware (pro mini) what firmware and firmware revisions.
I just created a (raw) log file and things look somewhat different (I'm using an external XJT module).

Mike.
ersky9x/er9x developer

zipray
Posts: 20
Joined: Sun Sep 04, 2016 9:05 am
Country: -

Re: Adding MAVLINK support

Post by zipray » Wed Jan 04, 2017 8:13 pm

transmitter:9xr pro(ersky9xProvR221a4 firmware)
Tx module:Multiprotocol TX Module(1.6 firmware)
receiver:frsky xsr
flight controller:sparky(dRonin GCS firmware 16.9)
arduino pro mini 5v 16mhz(APM_Mavlink_to_FrSky)

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

Re: Adding MAVLINK support

Post by MikeB » Wed Jan 04, 2017 11:27 pm

There may be a problem with the Multiprotocol module. In your logfile, there are some places where no actual telemetry data is sent to the radio for a significant time.
In the protocol menu, what value do you have for the "Freq" under FrskyX?

Mike.
ersky9x/er9x developer

zipray
Posts: 20
Joined: Sun Sep 04, 2016 9:05 am
Country: -

Re: Adding MAVLINK support

Post by zipray » Fri Jan 06, 2017 8:28 am

MikeB wrote:There may be a problem with the Multiprotocol module. In your logfile, there are some places where no actual telemetry data is sent to the radio for a significant time.
In the protocol menu, what value do you have for the "Freq" under FrskyX?

Mike.
thanks mike.
Attachments
frsky16-2017-01-06.zip
(959 Bytes) Downloaded 6 times

zipray
Posts: 20
Joined: Sun Sep 04, 2016 9:05 am
Country: -

Re: Adding MAVLINK support

Post by zipray » Fri Jan 06, 2017 8:47 am

In the protocol menu, i am -50 value for the "Freq" under FrskyX option.Also, I found that the problem is not in the Multiprotocol module.Because I use flight control output s.prot directly to XSR receiver, everything is ok.Abnormal log files is due to I click the menu button in the debug interface,I think the "loging" check box of debug interface is selected to be able to log.but I found that only need to configure a switch to enable telemetry logging.
Last edited by zipray on Fri Jan 06, 2017 9:05 am, edited 1 time in total.

zipray
Posts: 20
Joined: Sun Sep 04, 2016 9:05 am
Country: -

Re: Adding MAVLINK support

Post by zipray » Fri Jan 06, 2017 9:04 am

This is the "RAW log”
Attachments
frsky16-2017-01-06raw.zip
(4.46 KiB) Downloaded 7 times

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

Re: Adding MAVLINK support

Post by MikeB » Fri Jan 06, 2017 12:11 pm

That logfile looks correct.
I can see some packets from the FC specifying a RSSI value of 0. Since the RSSI value is averaged, these effectively reduce the displayed value.
There is another oddity in the logfile, the physical address of the packets (other that the built in FrSky ones of 0x98) are being received without the top 3 check bits set correctly. Since, at present, I'm not checking these, the telemetry data is being processed.
I'm not sure where these 3 bits are being "lost".
While these 3 bits are incorrect, I could detect the RSSI value coming from the FC and ignore it, but if they are corrected then I won't be able to distinguish between this value and the 'real' one.

Edit: With the firmware (ersky9x) as it is, the 3 check bits are discarded, so I can't distinguish between the packets anyway (the same applies to openTx!).

Edit2: Is there any way of stopping the FC sending the RSSI data (ask on their forum)?

Mike.
ersky9x/er9x developer

zipray
Posts: 20
Joined: Sun Sep 04, 2016 9:05 am
Country: -

Re: Adding MAVLINK support

Post by zipray » Fri Jan 06, 2017 1:15 pm

Thanks mike, how can i prohibit send rssi values in the "APM_Mavlink_to_FrSky"code?If i enable "s.prot", then the receiver has been sent the rssi.

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

Re: Adding MAVLINK support

Post by MikeB » Fri Jan 06, 2017 2:16 pm

The only time the Pro Mini sends a RSSI value is if IO6 is connected to ground. If this is done, then it operates differently anyway, it is mounted in the Tx and provides direct SPort data to the radio. This is for use with other Tx modules and receivers where the raw mavlink data arrives at the transmitter.
Currently, if the voltage on IO6 is at VCC (please measure it), then the Pro Mini should not be sending any RSSI data.

You could try changing the code in frsky.cpp from:

Code: Select all

			case 20 :
				value = ctelemetry.getVspd() * 100.0f ;
				id = VARIO_FIRST_ID ;
			break ;
			case 21 :
				if ( SportInTx )
				{
					value = ctelemetry.getRssi() ;
					id = RSSI_ID ;
				}
				else
				{
					id = 0xFFFF ;
				}
			break ;
		}
		if ( id != 0xFFFF )
		{
			sportNext.value = value ;
			sportNext.id = id ;
			sportNext.valid = 1 ;
		}
		
		if ( ++sportIndex > 21 )
to:

Code: Select all

			case 20 :
				value = ctelemetry.getVspd() * 100.0f ;
				id = VARIO_FIRST_ID ;
			break ;
		}
		if ( id != 0xFFFF )
		{
			sportNext.value = value ;
			sportNext.id = id ;
			sportNext.valid = 1 ;
		}
		
		if ( ++sportIndex > 20 )
(So delete "case 21" and change the 21 on the last line shown to 20).

Mike.
ersky9x/er9x developer

zipray
Posts: 20
Joined: Sun Sep 04, 2016 9:05 am
Country: -

Re: Adding MAVLINK support

Post by zipray » Sat Jan 07, 2017 10:33 am

MikeB wrote:The only time the Pro Mini sends a RSSI value is if IO6 is connected to ground. If this is done, then it operates differently anyway, it is mounted in the Tx and provides direct SPort data to the radio. This is for use with other Tx modules and receivers where the raw mavlink data arrives at the transmitter.
Currently, if the voltage on IO6 is at VCC (please measure it), then the Pro Mini should not be sending any RSSI data.

You could try changing the code in frsky.cpp from:

Code: Select all

			case 20 :
				value = ctelemetry.getVspd() * 100.0f ;
				id = VARIO_FIRST_ID ;
			break ;
			case 21 :
				if ( SportInTx )
				{
					value = ctelemetry.getRssi() ;
					id = RSSI_ID ;
				}
				else
				{
					id = 0xFFFF ;
				}
			break ;
		}
		if ( id != 0xFFFF )
		{
			sportNext.value = value ;
			sportNext.id = id ;
			sportNext.valid = 1 ;
		}
		
		if ( ++sportIndex > 21 )
to:

Code: Select all

			case 20 :
				value = ctelemetry.getVspd() * 100.0f ;
				id = VARIO_FIRST_ID ;
			break ;
		}
		if ( id != 0xFFFF )
		{
			sportNext.value = value ;
			sportNext.id = id ;
			sportNext.valid = 1 ;
		}
		
		if ( ++sportIndex > 20 )
(So delete "case 21" and change the 21 on the last line shown to 20).

Mike.
ok,thanks mike,Problem has been solved, I used the edit 2 ,that is set rssi from a free channel in the FC.Before that,the FC rssi is set to no source.
May only be a software bug.Your analysis is accurate, even more amazing is that you can understand my English.

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

Re: Adding MAVLINK support

Post by samys13 » Sat Jan 07, 2017 11:39 am

Hi mike i would like to know if there is any way to convert frsky telemtry to mavlink with a second arduino?
Mavlink ==> mavlink to frsky arduino in the plane ==> back to mavlink with second arduino in the handset.
If i use direct mavlink protocole (handset and orangerx tx/rx) i have a bad rssi value and limited range.
with this setup i could have a very good frsky rssi between TX and RX (orangerx), a very good range, have the telemetry on the handset and also connect to mission planner.
thanks mike

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

Re: Adding MAVLINK support

Post by MikeB » Sat Jan 07, 2017 12:32 pm

In theory it is possible, but, to my knowledge, there is no firmware currently written to do such a task.

Mike.
ersky9x/er9x developer

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

Re: Adding MAVLINK support

Post by samys13 » Sat Jan 07, 2017 12:51 pm

ok thanks mike. i tried this one but doesn't work: https://github.com/CzechUavGuy/APM-Mavlink-to-FrSky

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

Re: Adding MAVLINK support

Post by MikeB » Sat Jan 07, 2017 3:02 pm

He looks to be using 'D' (hub) telemetry and sending his own, private protocol, not FrSky at all, just using the serial on the 'D' receiver to transfer data.

Mike.
ersky9x/er9x developer

Post Reply

Return to “ersky9x”

Who is online

Users browsing this forum: No registered users and 2 guests