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: 16560
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB » Fri Mar 18, 2016 10:00 pm

Please try a test. In the file "Mavlink.cpp" there is a function:
const float Mavlink::getAirspeed()
{
return airspeed ;
}

Try changing this to:
const float Mavlink::getAirspeed()
{
return 5 ;
// return airspeed ;
}

This will, hopefully, test whether the problem is with the ersky9x code, of the receiving of the airspeed from the APM.

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


tomismrkolj1
Posts: 58
Joined: Sun Jan 24, 2016 10:32 am
Country: -

Re: Adding MAVLINK support

Post by tomismrkolj1 » Sat Mar 19, 2016 6:44 am

Hi,

I tried return 5 test, and Aspd is still 0.

Will solder my new mini pro 32k after breakfast and test with it.

tomi

tomismrkolj1
Posts: 58
Joined: Sun Jan 24, 2016 10:32 am
Country: -

Re: Adding MAVLINK support

Post by tomismrkolj1 » Sat Mar 19, 2016 10:57 am

Tried with mini pro 32k and return 5 test.
Aspd shows 0.

Mike: is it Aspd after TmOK value in custom telemetry menu, that should show airspeed?

tomi

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

Re: Adding MAVLINK support

Post by MikeB » Sat Mar 19, 2016 12:06 pm

Yes, that is correct, Aspd for Airspeed.

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

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

Re: Adding MAVLINK support

Post by MikeB » Sat Mar 19, 2016 10:17 pm

I've posted a test version of ersky9x for the 9XR-PRO, together with a small change to mavlink.cpp for the pro mini.
I tested ersky9x by forcing the value of 500 to be sent (SPort), and this was displayed correctly as the Aspd value.
I'm now sending the received airspeed value times 10.

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


stewwy
Posts: 36
Joined: Fri Oct 02, 2015 11:44 pm
Country: United Kingdom

Re: Adding MAVLINK support

Post by stewwy » Sun Mar 20, 2016 2:38 am

just a quick note to say I have it working well with

Gold px4lite
9x with 9xtreeme
328 aurduino promini
flashed to last but 1 test firmwares for 9xtreem and arduino
arduino works on telem1 or 2 with minimosd ( and mini minimosd) in parallel
flew it today when I maidened a new build :-)

tomismrkolj1
Posts: 58
Joined: Sun Jan 24, 2016 10:32 am
Country: -

Re: Adding MAVLINK support

Post by tomismrkolj1 » Sun Mar 20, 2016 7:04 am

Hi,

tried with newest version
first I had to remove "f" from airspeed * 10f, otherwise arduino sketch did not compile.
Now 9xr pro shows Aspd of 40 to 50 fluctuating which seems cool, however it is not 10th multiple of 0.8 to 1.8 m/s as meassured by APM.

tomi

tomismrkolj1
Posts: 58
Joined: Sun Jan 24, 2016 10:32 am
Country: -

Re: Adding MAVLINK support

Post by tomismrkolj1 » Sun Mar 20, 2016 7:33 am

Correction:

i tried again an it seems that Aspd is indeed 10th multiple of APM airspeed. So it works Mike.

tnx.

tomi

tomismrkolj1
Posts: 58
Joined: Sun Jan 24, 2016 10:32 am
Country: -

Re: Adding MAVLINK support

Post by tomismrkolj1 » Mon Mar 28, 2016 5:34 pm

Hi,

yesterday I had more time to test airspeed sensor. It works very nice. I used esky9xr scaler to get the reading right (just defined 1 decimal in the scaler, no multiplier or divisor).
Then I wanted to compare gps speed and airspeed, but somehow I don't get reading of Gspd. It stays at 0. Gps has lock, it shows 7+ satelittes and it shows coordiantes. Is Gspd acutally working?

tomi

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

Re: Adding MAVLINK support

Post by MikeB » Mon Mar 28, 2016 6:23 pm

The code is present, so it should be working, although I may have some scaling incorrect.

I've just posted a possible fix for the Arduino code.

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

User avatar
timw
Posts: 3
Joined: Thu Nov 19, 2015 4:17 am
Country: Australia

Re: Adding MAVLINK support

Post by timw » Sun Apr 03, 2016 9:11 am

Great work Mike and others. I've got this working with d4r-ii rx, djt tx, pro mini and pixhawk lite. No batt data yet as I'm not using a power module :D
Cheers,
Tim

tomismrkolj1
Posts: 58
Joined: Sun Jan 24, 2016 10:32 am
Country: -

Re: Adding MAVLINK support

Post by tomismrkolj1 » Sun Apr 03, 2016 10:23 am

I agree, great work Mike.
Tested Gspd and it works.
Also airspeed works now without need for scalers.

tomi

User avatar
RCHH
Posts: 465
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH » Sun Apr 03, 2016 12:39 pm

It sure does work well. Very well indeed. I am praying this ErSky9X stuff will be ported to work on the upcoming X12S Horus .... nudge nudge Mike the Genius man ... heh heh!!!
The simpleton asked "Hows about ErSky9X for Horus???". And the Genius from Dorset replied "Why not indeed? I shall get right onto it!" And then there was light on Horus! And it was good!

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

Re: Adding MAVLINK support

Post by MikeB » Sun Apr 03, 2016 1:18 pm

I hope to be able to do that port, but there is quite a lot of work involved as things on the Horus hardware are different.
I have a prototype Horus PCB and display, and some code actually running, but rather a long way to go yet.
Too many other things need doing as well!

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

User avatar
RCHH
Posts: 465
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH » Sun Apr 03, 2016 2:22 pm

I live in hope! And I shall not place any wager on you 'not' doing it in time! heh heh!!!
The simpleton asked "Hows about ErSky9X for Horus???". And the Genius from Dorset replied "Why not indeed? I shall get right onto it!" And then there was light on Horus! And it was good!

tienbc
Posts: 4
Joined: Sun Apr 03, 2016 6:32 pm
Country: -

Re: Adding MAVLINK support

Post by tienbc » Sun Apr 03, 2016 6:44 pm

Hi MikeB, great work
I have fs th9x without eysky9x board, I only have djt module and d4r ii rx, if I do frsky telem mod, install your hex file on radio and arduino, it will work without ersky9x board?

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

Re: Adding MAVLINK support

Post by MikeB » Sun Apr 03, 2016 8:52 pm

It will depend on whether you have the original M64 processor, or a M128 (or M2561) processor. There isn't enough flash memory on the M64 to add this, but it is available on the M128 (or M2561).
More recent 9X Txs do have the M128 (the M2561 is only there if you change it yourself!).

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

tienbc
Posts: 4
Joined: Sun Apr 03, 2016 6:32 pm
Country: -

Re: Adding MAVLINK support

Post by tienbc » Mon Apr 04, 2016 3:52 am

MikeB wrote:It will depend on whether you have the original M64 processor, or a M128 (or M2561) processor. There isn't enough flash memory on the M64 to add this, but it is available on the M128 (or M2561).
More recent 9X Txs do have the M128 (the M2561 is only there if you change it yourself!).

Mike.
Thank you MikeB, I have one m128 and one m64, I will try it today :mrgreen:

tienbc
Posts: 4
Joined: Sun Apr 03, 2016 6:32 pm
Country: -

Re: Adding MAVLINK support

Post by tienbc » Thu Apr 07, 2016 5:09 am

MikeB wrote:It will depend on whether you have the original M64 processor, or a M128 (or M2561) processor. There isn't enough flash memory on the M64 to add this, but it is available on the M128 (or M2561).
More recent 9X Txs do have the M128 (the M2561 is only there if you change it yourself!).

Mike.
Hi Mike, can you help me
When I flashed ersky9x_rom.bin by eepe, screen is blank when power on, tx dont work, flash back er9x with eepe it work again
I need to use eepskye to flash?

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

Re: Adding MAVLINK support

Post by bob195558 » Thu Apr 07, 2016 5:49 am

ersky9x_rom.bin only works with eepSkye not eepe.

Bob B.
Er9x on 9x radio, with Smartieparts Programmer and TelemetrEZ Board.
ErSky9x on Taranis, Sky9x, 9Xtreme radios.

3D Printing upgrades with (CR10 3D Printer): (http://openrcforums.com/forum/viewforum.php?f=85).

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

Re: Adding MAVLINK support

Post by bob195558 » Thu Apr 07, 2016 5:53 am

You also need to have a 9Xtreme / 9XR-Pro / Sky9x / AR9x or a Taranis radio which is capable of using ersky9x firmware.

Bob B.
Er9x on 9x radio, with Smartieparts Programmer and TelemetrEZ Board.
ErSky9x on Taranis, Sky9x, 9Xtreme radios.

3D Printing upgrades with (CR10 3D Printer): (http://openrcforums.com/forum/viewforum.php?f=85).

User avatar
jhsa
Posts: 18916
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Adding MAVLINK support

Post by jhsa » Thu Apr 07, 2016 6:33 am

You need to install "er9x for Mega128" on your radio, not ersky9x.
You can download the file at www.er9x.com

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

tienbc
Posts: 4
Joined: Sun Apr 03, 2016 6:32 pm
Country: -

Re: Adding MAVLINK support

Post by tienbc » Fri Apr 08, 2016 2:31 am

jhsa wrote:You need to install "er9x for Mega128" on your radio, not ersky9x.
You can download the file at http://www.er9x.com

João
I want to use mavlink, I omly have 9x board :(
er9x m128 download from er9x.com when install, thr sw and ail sw don't work and no option Frsky mod done
I use er9x r818 frsky and have no problem

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

Re: Adding MAVLINK support

Post by MikeB » Fri Apr 08, 2016 9:02 am

The "FrSky Mod Done" option is in the hardware menu. For safety, this is disabled normally. Just hold the LEFT trim switch to the LEFT while powering on, until the splash screen appears. You will then find the hardware menu is available.

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

Butchcan
Posts: 4
Joined: Wed Apr 13, 2016 11:02 pm
Country: -

Re: Adding MAVLINK support

Post by Butchcan » Wed Apr 13, 2016 11:12 pm

I am sorry if this noob question annoys you but I have done the ton of research and have followed everything thats needed to be followed. I am using an XJT module on a 9xrpro and a D4R-2 rx. Also using a pro mini. My question is do I still need to internally modify the xjt module with the 4.7kohm resistor and wire from tx to bottom pin or not? Also from D5 on the pro mini I connected it to the telem rx on the d4r-2 but some diagrams show another wire connected to the rx telem ground from D4. If there is a link to a setup using xjt module and d4r-2 I would appreciate pointing me in the right direction. Thank you all for your efforts.

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

Re: Adding MAVLINK support

Post by MikeB » Wed Apr 13, 2016 11:31 pm

The 9XR-PRO is fully compatible with the XJT module, neither the XJT nor the 9XR-PRO require any modification.
D5 is the correct pin for the serial connection.
D2, D3 and D4 are used for configuration:
D2 - unconnected = hub protocol (D series receivers).
D2 - grounded = SPort protocol (X series receivers).
D3 - unconnected = include Vfas value in telemetry data.
D3 - grounded = Do NOT include Vfas value in telemetry data.
D4 - unconnected = Do NOT include cell values in telemetry data
D4 - grounded = include cell values in telemetry data (these are just calculated by dividing the battery voltage by the number of cells).

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

Butchcan
Posts: 4
Joined: Wed Apr 13, 2016 11:02 pm
Country: -

Re: Adding MAVLINK support

Post by Butchcan » Wed Apr 13, 2016 11:49 pm

Thank your for the guide. I will redo everything just to verify connections and post when its up.

Butchcan
Posts: 4
Joined: Wed Apr 13, 2016 11:02 pm
Country: -

Re: Adding MAVLINK support

Post by Butchcan » Thu Apr 14, 2016 7:17 am

Its working. My setup is a 9xrpro XJT module and D4R-2 rx. Protocol changed to PXX and then voila! Thanks again to the amazing people who contributed to this development, especially to Mikeb. Just so another person might hit a brick wall with theirs. No need to mod anything on the 9xrpro or the XJT module (see Mikeb previous post). 1 wire from D5 to the rx telemetry port of the D4R-2. And the usual APM to Pro Mini reverse TX/RX.

conicio
Posts: 11
Joined: Tue Feb 23, 2016 5:03 pm
Country: -

Re: Adding MAVLINK support

Post by conicio » Sat Apr 16, 2016 11:31 am

Hi Mike.
All is working OK but I get a 4 cells reading instead of 3 resulting in a warning sound as the voltage is lower than the expected (12.4/4= 3.1 instead of 12.4/3=4.13)
How can I change the number of cells it'll read to 3?
Also, what means Imp or Met. What should be selected?
Thanks in advance.
F-450 Clon - APM 2.5 - X8R - XJT - 9XR Pro
S-500 - HKMicro APM - FS6R - FS T6

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

Re: Adding MAVLINK support

Post by MikeB » Sat Apr 16, 2016 2:21 pm

What battery voltage is reported?
The number of cells is calculated from this value.
Integer part of (battery voltage / 4.3) + 1.
So 12.4/4.3 = 2.88. Integer part of 2.88 = 2. 2+1 = 3. So at 12.4V, the number of cells should be 3.

Imp is for Imperial measurements (feet, degrees F), Met is for Metric measurements (metres, degrees C).

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


Post Reply

Return to “erskyTx (was ersky9x)”