Page 11 of 20

Re: Adding MAVLINK support

Posted: Fri Mar 18, 2016 10:00 pm
by MikeB
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.

Re: Adding MAVLINK support

Posted: Sat Mar 19, 2016 6:44 am
by tomismrkolj1
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

Re: Adding MAVLINK support

Posted: Sat Mar 19, 2016 10:57 am
by tomismrkolj1
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

Re: Adding MAVLINK support

Posted: Sat Mar 19, 2016 12:06 pm
by MikeB
Yes, that is correct, Aspd for Airspeed.

Mike.

Re: Adding MAVLINK support

Posted: Sat Mar 19, 2016 10:17 pm
by MikeB
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.

Re: Adding MAVLINK support

Posted: Sun Mar 20, 2016 2:38 am
by stewwy
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 :-)

Re: Adding MAVLINK support

Posted: Sun Mar 20, 2016 7:04 am
by tomismrkolj1
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

Re: Adding MAVLINK support

Posted: Sun Mar 20, 2016 7:33 am
by tomismrkolj1
Correction:

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

tnx.

tomi

Re: Adding MAVLINK support

Posted: Mon Mar 28, 2016 5:34 pm
by tomismrkolj1
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

Re: Adding MAVLINK support

Posted: Mon Mar 28, 2016 6:23 pm
by MikeB
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.

Re: Adding MAVLINK support

Posted: Sun Apr 03, 2016 9:11 am
by timw
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

Re: Adding MAVLINK support

Posted: Sun Apr 03, 2016 10:23 am
by tomismrkolj1
I agree, great work Mike.
Tested Gspd and it works.
Also airspeed works now without need for scalers.

tomi

Re: Adding MAVLINK support

Posted: Sun Apr 03, 2016 12:39 pm
by RCHH
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!!!

Re: Adding MAVLINK support

Posted: Sun Apr 03, 2016 1:18 pm
by MikeB
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.

Re: Adding MAVLINK support

Posted: Sun Apr 03, 2016 2:22 pm
by RCHH
I live in hope! And I shall not place any wager on you 'not' doing it in time! heh heh!!!

Re: Adding MAVLINK support

Posted: Sun Apr 03, 2016 6:44 pm
by tienbc
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?

Re: Adding MAVLINK support

Posted: Sun Apr 03, 2016 8:52 pm
by MikeB
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.

Re: Adding MAVLINK support

Posted: Mon Apr 04, 2016 3:52 am
by tienbc
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:

Re: Adding MAVLINK support

Posted: Thu Apr 07, 2016 5:09 am
by tienbc
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?

Re: Adding MAVLINK support

Posted: Thu Apr 07, 2016 5:49 am
by bob195558
ersky9x_rom.bin only works with eepSkye not eepe.

Bob B.

Re: Adding MAVLINK support

Posted: Thu Apr 07, 2016 5:53 am
by bob195558
You also need to have a 9Xtreme / 9XR-Pro / Sky9x / AR9x or a Taranis radio which is capable of using ersky9x firmware.

Bob B.

Re: Adding MAVLINK support

Posted: Thu Apr 07, 2016 6:33 am
by jhsa
You need to install "er9x for Mega128" on your radio, not ersky9x.
You can download the file at www.er9x.com

João

Re: Adding MAVLINK support

Posted: Fri Apr 08, 2016 2:31 am
by tienbc
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

Re: Adding MAVLINK support

Posted: Fri Apr 08, 2016 9:02 am
by MikeB
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.

Re: Adding MAVLINK support

Posted: Wed Apr 13, 2016 11:12 pm
by Butchcan
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.

Re: Adding MAVLINK support

Posted: Wed Apr 13, 2016 11:31 pm
by MikeB
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.

Re: Adding MAVLINK support

Posted: Wed Apr 13, 2016 11:49 pm
by Butchcan
Thank your for the guide. I will redo everything just to verify connections and post when its up.

Re: Adding MAVLINK support

Posted: Thu Apr 14, 2016 7:17 am
by Butchcan
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.

Re: Adding MAVLINK support

Posted: Sat Apr 16, 2016 11:31 am
by conicio
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.

Re: Adding MAVLINK support

Posted: Sat Apr 16, 2016 2:21 pm
by MikeB
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.