Adding MAVLINK support
- MikeB
- 9x Developer
- Posts: 17995
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Adding MAVLINK support
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.
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!
The difficult we do immediately,
The impossible takes a little longer!
-
- Posts: 58
- Joined: Sun Jan 24, 2016 10:32 am
- Country: -
Re: Adding MAVLINK support
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
I tried return 5 test, and Aspd is still 0.
Will solder my new mini pro 32k after breakfast and test with it.
tomi
-
- Posts: 58
- Joined: Sun Jan 24, 2016 10:32 am
- Country: -
Re: Adding MAVLINK support
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
Aspd shows 0.
Mike: is it Aspd after TmOK value in custom telemetry menu, that should show airspeed?
tomi
- MikeB
- 9x Developer
- Posts: 17995
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Adding MAVLINK support
Yes, that is correct, Aspd for Airspeed.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- MikeB
- 9x Developer
- Posts: 17995
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Adding MAVLINK support
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.
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!
The difficult we do immediately,
The impossible takes a little longer!
Re: Adding MAVLINK support
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
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
-
- Posts: 58
- Joined: Sun Jan 24, 2016 10:32 am
- Country: -
Re: Adding MAVLINK support
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
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
-
- Posts: 58
- Joined: Sun Jan 24, 2016 10:32 am
- Country: -
Re: Adding MAVLINK support
Correction:
i tried again an it seems that Aspd is indeed 10th multiple of APM airspeed. So it works Mike.
tnx.
tomi
i tried again an it seems that Aspd is indeed 10th multiple of APM airspeed. So it works Mike.
tnx.
tomi
-
- Posts: 58
- Joined: Sun Jan 24, 2016 10:32 am
- Country: -
Re: Adding MAVLINK support
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
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
- MikeB
- 9x Developer
- Posts: 17995
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Adding MAVLINK support
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.
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!
The difficult we do immediately,
The impossible takes a little longer!
Re: Adding MAVLINK support
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
Cheers,
Tim
Tim
-
- Posts: 58
- Joined: Sun Jan 24, 2016 10:32 am
- Country: -
Re: Adding MAVLINK support
I agree, great work Mike.
Tested Gspd and it works.
Also airspeed works now without need for scalers.
tomi
Tested Gspd and it works.
Also airspeed works now without need for scalers.
tomi
Re: Adding MAVLINK support
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!
- MikeB
- 9x Developer
- Posts: 17995
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Adding MAVLINK support
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.
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!
The difficult we do immediately,
The impossible takes a little longer!
Re: Adding MAVLINK support
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!
Re: Adding MAVLINK support
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?
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?
- MikeB
- 9x Developer
- Posts: 17995
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Adding MAVLINK support
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.
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!
The difficult we do immediately,
The impossible takes a little longer!
Re: Adding MAVLINK support
Thank you MikeB, I have one m128 and one m64, I will try it todayMikeB 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.
Re: Adding MAVLINK support
Hi Mike, can you help meMikeB 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.
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?
- bob195558
- Posts: 2377
- Joined: Sun Dec 16, 2012 7:24 pm
- Country: United States
- Location: New England, Vermont
- Contact:
Re: Adding MAVLINK support
ersky9x_rom.bin only works with eepSkye not eepe.
Bob B.
Bob B.
Er9x on 9x radio, with Smartieparts Programmer and TelemetrEZ Board.
ErSky9x on Taranis, Sky9x, 9Xtreme radios.
3D-Printing: (https://openrcforums.com/forum/viewforum.php?f=129).
ErSky9x on Taranis, Sky9x, 9Xtreme radios.
3D-Printing: (https://openrcforums.com/forum/viewforum.php?f=129).
- bob195558
- Posts: 2377
- Joined: Sun Dec 16, 2012 7:24 pm
- Country: United States
- Location: New England, Vermont
- Contact:
Re: Adding MAVLINK support
You also need to have a 9Xtreme / 9XR-Pro / Sky9x / AR9x or a Taranis radio which is capable of using ersky9x firmware.
Bob B.
Bob B.
Er9x on 9x radio, with Smartieparts Programmer and TelemetrEZ Board.
ErSky9x on Taranis, Sky9x, 9Xtreme radios.
3D-Printing: (https://openrcforums.com/forum/viewforum.php?f=129).
ErSky9x on Taranis, Sky9x, 9Xtreme radios.
3D-Printing: (https://openrcforums.com/forum/viewforum.php?f=129).
Re: Adding MAVLINK support
You need to install "er9x for Mega128" on your radio, not ersky9x.
You can download the file at www.er9x.com
João
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
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
Re: Adding MAVLINK support
I want to use mavlink, I omly have 9x boardjhsa 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
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
- MikeB
- 9x Developer
- Posts: 17995
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Adding MAVLINK support
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.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Adding MAVLINK support
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.
- MikeB
- 9x Developer
- Posts: 17995
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Adding MAVLINK support
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.
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!
The difficult we do immediately,
The impossible takes a little longer!
Re: Adding MAVLINK support
Thank your for the guide. I will redo everything just to verify connections and post when its up.
Re: Adding MAVLINK support
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
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.
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
S-500 - HKMicro APM - FS6R - FS T6
- MikeB
- 9x Developer
- Posts: 17995
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Adding MAVLINK support
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.
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!
The difficult we do immediately,
The impossible takes a little longer!