Adding MAVLINK support

ersky9x is a port of er9x for use on the sky9x board.
User avatar
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: Adding MAVLINK support

Post by LTMNO » Thu Mar 10, 2016 2:02 pm

I have updated to this version... on both ends...
Glad to report that Cells are working. Diagram updated to reflect setup.

ersky9xProvR219h.zip
27-Feb-2016 15:52
Add option for Mavlink 'Copter/'Plane

APM_Mavlink_to_FrSky.zip
27-Feb-2016 15:52
Add extra info to Temp1 - 'Copter/'Plane?
Custom 9x with M64/Telemetry Mod

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

Re: Adding MAVLINK support

Post by RCHH » Thu Mar 10, 2016 11:16 pm

From memory, when I ran this on the X8R, I grounded D4 to the ground on the Arduino bottom left, not via the X8R S.Port ground - and all worked as advertised ...
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
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: Adding MAVLINK support

Post by LTMNO » Fri Mar 11, 2016 3:42 am

RCHH wrote:From memory, when I ran this on the X8R, I grounded D4 to the ground on the Arduino bottom left, not via the X8R S.Port ground - and all worked as advertised ...
Its probably better doing it your way as you don't create a GND loop.
But that being said.. I had a servo wire connected to the S.Port and I just removed the (+) pin and shifted over the GND on one end. This way I can have more grabbing the X8R and the Arduino. This will stay on better then just one lead. I never soldered anything to the Arduino.

Image
There is an Telemetry Distribution Board on the Top to split out the Telemetry lines for other devices...

Image
Arduino had pins connected thru the back...

Image
2 Pins grabbing onto the X8R.

Its all working... if I experience no GND loop problems, I will keep it like this. If I remove the GND wire to S.Port then I just loose the Cells.
:D
Custom 9x with M64/Telemetry Mod

deuce
Posts: 8
Joined: Fri Mar 11, 2016 6:15 am
Country: -

Re: Adding MAVLINK support

Post by deuce » Fri Mar 11, 2016 6:42 am

Hello,

I saw someone successfully implemented MAVLINK_to_FrSky mod (RCHH if im not mistake) utilizing D8R-XP receiver and 9XR-PRO. So I thought it might work base on what I have, unfortunately, it didn't. Here's what I have

MINI APM PRO, APM 2.6
D8R-II Plus RX
Ardruino Pro Mini w/ atmega328, 5v, 16m
- (flashed with APM_Mavlink_to_FrSky.zip
13-Feb-2016 20:56)

9XR-PRO
- (flashed with ersky9xProvR219e.zip
11-Feb-2016 18:14
Fix bug in 6-pos calibration
First test for Mavlink
Add Spanish language)

soldered and connected leds as follows...
https://goo.gl/photos/oRo1D6NRUCLfYMKs6
https://goo.gl/photos/4kpcgB1TDZbABu5r8

however, nodata is diplayed in the TX
https://goo.gl/photos/Q1AYvR2Tcc21VfKG7

is this even possible? or it only works with receivers that has SBus port?

Cromwel

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

Re: Adding MAVLINK support

Post by MikeB » Fri Mar 11, 2016 9:27 am

Please flash the 'PRO with the most recent test version of the firmware (ersky9xProvR219i.zip). It is also worth updating the Pro Mini to the code from 27th Feb.
Also, in the Telemetry menu, did you set the "Usr. Proto" to ArduC?

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


deuce
Posts: 8
Joined: Fri Mar 11, 2016 6:15 am
Country: -

Re: Adding MAVLINK support

Post by deuce » Fri Mar 11, 2016 10:17 am

Mike,

At first, I actually tried flashing both from your latest source codes and binaries but didn't got any results.

ersky9xProvR219i.zip
03-Mar-2016 23:26
Add extended MULTI protocol settings

APM_Mavlink_to_FrSky.zip
27-Feb-2016 15:52
Add extra info to Temp1 - 'Copter/'Plane?
(210.9 KiB) Downloaded 36 times

So I just thought the first/older source codes and binaries might work and it doesn't hurt if I try it anyway. Unless if I miss something.

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

Re: Adding MAVLINK support

Post by MikeB » Fri Mar 11, 2016 11:02 am

In the Telemetry menu, did you set the "Usr. Proto" to ArduC (or ArduP)?
Have you configured the baudrate on the APM to 57600?

A couple of tests/checks:
1. Are you seeing a RSSI value (checks telemetry is being received from the receiver).
2. Set up a custom telemetry screen to include "TmOK". Does this show a value of 0, 1 or 2?

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

deuce
Posts: 8
Joined: Fri Mar 11, 2016 6:15 am
Country: -

Re: Adding MAVLINK support

Post by deuce » Fri Mar 11, 2016 11:53 am

MikeB wrote:In the Telemetry menu, did you set the "Usr. Proto" to ArduC (or ArduP)?
Have you configured the baudrate on the APM to 57600?

A couple of tests/checks:
1. Are you seeing a RSSI value (checks telemetry is being received from the receiver).
2. Set up a custom telemetry screen to include "TmOK". Does this show a value of 0, 1 or 2?

Mike.
Mike,

Re-flashed 9XR-PRO and Adruino with your latest source-code and binaries. Unfortunately, I still got the same results.

UsrProto is set to 'ArduC'
APM baudrate has been set to '57600'
RSSI has a value of '0'
TmOK has a value of '0'

Cromwel

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

Re: Adding MAVLINK support

Post by MikeB » Fri Mar 11, 2016 12:02 pm

Ignore MavLink for a moment, you are not receiving any telemetry from the receiver at all.
What Tx module do you have in the 9XR-PRO? From this we can check your settings and telemetry connectivity on the Tx.

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

deuce
Posts: 8
Joined: Fri Mar 11, 2016 6:15 am
Country: -

Re: Adding MAVLINK support

Post by deuce » Fri Mar 11, 2016 12:11 pm

Mike,

Could it be that my tx module is not capable? Anyway, im using FrSky DJT w/ Telemetry tx module.

Cromwel

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

Re: Adding MAVLINK support

Post by MikeB » Fri Mar 11, 2016 12:26 pm

The DJT will work fine.
How are you connecting the telemetry from the DJT to the 9XR-PRO?
There are two ways this is usually done.
1. Connect from the connections on the back of the module to the Futaba trainer socket, then set "FrSky Com Port" to 2 in the telemetry menu.
2. Modify the DJT to send telemetry on the bottom pin (pin 5) of the module connector, then set "FrSky Com Port" to 1 in the telemetry menu.

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

deuce
Posts: 8
Joined: Fri Mar 11, 2016 6:15 am
Country: -

Re: Adding MAVLINK support

Post by deuce » Fri Mar 11, 2016 12:38 pm

Mike,

I think that's what I don't have. Im much geared on modifying the DJT module since it takes time before it gets to me if opt to purchase the cable. Can you please point me to any resource/link to do the necessary modification in the DJT module?

Cromwel

Edit: nvrmnd. just saw it in the 9XR-PRO manual. I'll keep you posted. Thanks!

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

Re: Adding MAVLINK support

Post by MikeB » Fri Mar 11, 2016 2:03 pm

I assume you are reading "9XR Pro Introduction to the Hardware.pdf".
To get telemetry on the 'PRO you may just add the connection from the Tx pin to the bottom pin of the module connector (with the resistor in it). You don't need the Rx connection of the schottky diode to get started. The schottky doide is only needed if you are likely to put the DJT into a FrSky Taranis Tx.
The Rx connection is only needed if you need to set the internal alarms in the DJT.

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

deuce
Posts: 8
Joined: Fri Mar 11, 2016 6:15 am
Country: -

Re: Adding MAVLINK support

Post by deuce » Fri Mar 11, 2016 2:37 pm

Mike,

Yes, so I just need 4700 Ohm resistor from the TX pin to the bottom pin of the module connector, noted. Hm... I have couple of 4000 Ohm resistor lying around. Would that be enough? Or it must be 4700 Ohms?

Cromwel

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

Re: Adding MAVLINK support

Post by MikeB » Fri Mar 11, 2016 3:01 pm

4000 ohms will be OK.

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

deuce
Posts: 8
Joined: Fri Mar 11, 2016 6:15 am
Country: -

Re: Adding MAVLINK support

Post by deuce » Fri Mar 11, 2016 3:44 pm

Mike,

My bad what I have is 500 ohm NOT 4000 ohm. I guess I'll have to wait till Monday before I can grab a few.

Cromwel

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

Re: Adding MAVLINK support

Post by MikeB » Fri Mar 11, 2016 5:02 pm

If you don't want to wait, it is safe to use TWO 500 ohm resistors in series for testing, and replace them with a 4K7 when you have one.

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

weldmonkey
Posts: 3
Joined: Wed Mar 02, 2016 7:07 am
Country: -

Re: Adding MAVLINK support

Post by weldmonkey » Sun Mar 13, 2016 4:15 am

So does this only work on a Arduino Mini/Pro?

I thought someone had this working on Teensy, but I cant get it to load on my Teensy 3.2.

I have been playing around with this on a Teensy:
http://www.rcgroups.com/forums/showthread.php?t=2538011

Didnt show much on OpenTX (On a 9xr Pro), I am guessing because its geared more for the Taranis. I do get some Telemetry on the your latest ersky9x build:

RSSI
Voltage
Heading
Alt

I think thats about it, but I havent armed outside to see if Armed status message changes or if it shows GPS data.
Im pretty good with the lighting code, but thats simple. I am far from a programmer.

I look forward to this all working.

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

Re: Adding MAVLINK support

Post by MikeB » Sun Mar 13, 2016 9:22 am

I have only written code for the Arduino Pro/mini. I don't have a Teensy so I can't do anything with code on that.
The Arduino code is specific to the AVR processor.

I have tried to handle the data from the Teensy, but not having one means I can't test it.
You may be able to find what values are available by using the debug display, see this post:
viewtopic.php?f=7&t=8396&start=60#p110944.

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

weldmonkey
Posts: 3
Joined: Wed Mar 02, 2016 7:07 am
Country: -

Re: Adding MAVLINK support

Post by weldmonkey » Mon Mar 14, 2016 12:34 pm

Thanks Mike, I will keep toying with it. If I come up with anything I will share it. If I get a few extra bucks Ill send you one.

Thanks for all you do sir

deuce
Posts: 8
Joined: Fri Mar 11, 2016 6:15 am
Country: -

Re: Adding MAVLINK support

Post by deuce » Mon Mar 14, 2016 4:16 pm

Mike,

After soldering a 4700 resistor as per your instruction, looks like the latest source code and binaries works like a charm.

https://goo.gl/photos/M95xq1rn4xao1ZuS6
https://goo.gl/photos/Upez42UoCQsfsTGv5
https://goo.gl/photos/7Y8RoakLWymAvfWD8

Thanks!

Cromwel

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

Re: Adding MAVLINK support

Post by MikeB » Wed Mar 16, 2016 5:34 pm

I've posted new test versions of ersky9x, and the Arduino code. These should support airspeed, although I'm not sure whether the units will display correctly.

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

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

Re: Adding MAVLINK support

Post by tomismrkolj1 » Wed Mar 16, 2016 9:38 pm

Tnx for new verison Mike.
I will try it over the weekned if the weather gets better.
There is so much wind lately...

tomi

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

Re: Adding MAVLINK support

Post by conicio » Wed Mar 16, 2016 10:11 pm

Thank you very much for your excellent work and kind support Mike. Uploaded to the Mini Pro.
May I use the same config with a pixhawk? And, if possible, how do I have to connect?
Thanks a lot

edit: After flashing r219j I'm unable to USB connect to my mac. Even if I set the SD off the eeprom doesn't mount as a disk
re-edit: even if i get out the SD card it won't connect
F-450 Clon - APM 2.5 - X8R - XJT - 9XR Pro
S-500 - HKMicro APM - FS6R - FS T6

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

Re: Adding MAVLINK support

Post by tomismrkolj1 » Fri Mar 18, 2016 3:58 pm

Hi,

i tried new firmware version on mini pro 16k and 9xrpro. Airspeed does not work. Value Aspd stays at 0 all the time, eventhough apm shows normal airspeed fluctuation (1.3 to 1.8 m/s) through Mission Planner. Other telemetry displays normally on 9xr pro display, so mini pro does work.

tomi

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

Re: Adding MAVLINK support

Post by MikeB » Fri Mar 18, 2016 4:43 pm

conicio wrote:Thank you very much for your excellent work and kind support Mike. Uploaded to the Mini Pro.
May I use the same config with a pixhawk? And, if possible, how do I have to connect?
Thanks a lot

edit: After flashing r219j I'm unable to USB connect to my mac. Even if I set the SD off the eeprom doesn't mount as a disk
re-edit: even if i get out the SD card it won't connect
I don't know anything about the pixhawk. If it sends normal MavLink data then it is likely to work.

Did you update the bootloader when you flashed r219j? If not, then nothing should have changed regarding the bootloader connection over USB.

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

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

Re: Adding MAVLINK support

Post by MikeB » Fri Mar 18, 2016 4:44 pm

tomismrkolj1 wrote:i tried new firmware version on mini pro 16k and 9xrpro. Airspeed does not work. Value Aspd stays at 0 all the time, eventhough apm shows normal airspeed fluctuation (1.3 to 1.8 m/s) through Mission Planner. Other telemetry displays normally on 9xr pro display, so mini pro does work.
Are you using hub or SPort?

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

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

Re: Adding MAVLINK support

Post by tomismrkolj1 » Fri Mar 18, 2016 6:30 pm

I am using SPort of x8r.

tomi

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

Re: Adding MAVLINK support

Post by MikeB » Fri Mar 18, 2016 6:39 pm

The Arduino code is now on Github:
https://github.com/MikeBland/APM_Mavlink_to_FrSky.

I may have a divide by 100 that is not needed in the SPort code. It could well be that 1.8m/s is being sent as 1, the divided by 100, so you see 0.
The code on Github has this /100 removed, but I haven't built/tested this yet.

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

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

Re: Adding MAVLINK support

Post by tomismrkolj1 » Fri Mar 18, 2016 7:45 pm

Hi,

tested the new code from github. Aspd still 0 on S.port x8r, mini pro 16, 9xr pro.

tomi

Post Reply

Return to “ersky9x”