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

Re: Adding MAVLINK support

Post by MikeB »

Someone else tried with a nano and it didn't work for them either. I think the problem is the Rx on the nano has a 1K resistor to the Tx of the USB to serial chip on the nano. This loads the Tx signal from the APM.

I'm about to get myself a nano so I can investigate this problem further.

The code is written specifically for the AVR processor, so doesn't run "as is" on a Teensy.

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 »

Nano does not work. Tested. Many times...
Mike has written an explanation for this several pages back in this thread.
My suggestion is to save time (I did not...) and buy cheap mini pro, which works well. Both 16k and 32k minis work but I suggest 32k in case the code gets bigger.

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

Re: Adding MAVLINK support

Post by RCHH »

"Do I have to connect the SPort from the XJT to the Futaba trainer Jack?" Yes. You do indeed. There is a specific cable to do it. HERE
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!
conicio
Posts: 11
Joined: Tue Feb 23, 2016 5:03 pm
Country: -

Re: Adding MAVLINK support

Post by conicio »

Ok. I'll wait for the mini pro from china.
Thanks a lot
F-450 Clon - APM 2.5 - X8R - XJT - 9XR Pro
S-500 - HKMicro APM - FS6R - FS T6
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

RCHH wrote:"Do I have to connect the SPort from the XJT to the Futaba trainer Jack?" Yes. You do indeed. There is a specific cable to do it. HERE
The 9XR-PRO supports the XJT via the internal connection on pin 5 (bottom pin) of the module connector. You should NOT need to use the external connection.

Mike.
erskyTx/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 »

I think that cable is only need for the frsky DHT module on the 9xr Pro. The XJT does not. i may be wrong.
User avatar
RCHH
Posts: 467
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH »

Ah yes - I was not thinking 'Pro'!
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!
tomismrkolj1
Posts: 58
Joined: Sun Jan 24, 2016 10:32 am
Country: -

Re: Adding MAVLINK support

Post by tomismrkolj1 »

Hi,

Mike would it be possible to add airspeed reading from apm to ersky9x(r)?

tnx.

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

Re: Adding MAVLINK support

Post by MikeB »

I've made a note for this. From APM, is the airspeed from the GPS?

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
RCHH
Posts: 467
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH »

Can be, but there are dedicated airspeed sensor in analogue and digital flavours Mike - see HERE
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: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

OK, I'll look into finding that in the MavLink data and sending it down via the Arduino, then add an Airspeed entry in the telemetry.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
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 »

Mike, re:airspeed and other sensors..
I am shortly getting my sensor going as well....
Is the debug is setup to spit out all sensors.. or are you turning them on one by one?
I think it be useful to have things for Sonar, Lidar, Camera Angles, etc...
All is available thru the APM... so I will try to lock them down soon in the coming weeks and send the info your way.
via ersky9x(Arduino) and APM, this will truly be the best solution out there for the $$$.

I would love to help you build out some of the UI, if there is any examples to look at to see what is done, i would be happy to hack my way thru it.
Custom 9x with M64/Telemetry Mod
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

The biggest problem will be the throughput of the SPort/hub data. SPort can handle around 80 items per second, and we probably need some things sent more often than once per second. Hub is somewhat less, maybe up to 50 items per second, and some things, like altitude, need 2 hub items to send completely.

In both cases (SPort and Hub), I already send some items more often than others. We probably need to define carefully what is sent at what rate.

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 »

Airspeed is measured by APM airspeed sensor (optional hardware). GPS speed is actually a groundspeed. Airspeed and groundspeed are not the same if there is wind.

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

Re: Adding MAVLINK support

Post by RCHH »

I think the way forward is to have some 'justification', for want of a better word, as to why a particular telemetry item readout is needed? I understand that only 'so much' can be accomplished in both display space and coding, so perhaps only the most-wanted/essential should be included?

As it stands, for me personally, accurate airspeed (as against GPS provided 'groundspeed!)would be a great addition, but I am not seeing the need for Sonar, Lidar, Camera angles etc. to be displayed? Please educate me on that one, as it may of course, be something I am completely missing out on!
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
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Adding MAVLINK support

Post by jhsa »

I have been following this thread with interest even if I don't use the equipment. So, taking the risk of saying something stupid, couldn't the fields sent be defined by the user in a config.h file from the arduino sketch? A bit like the openXsensor project does?
Like this only the relevant fields for that model would be sent?
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
User avatar
RCHH
Posts: 467
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH »

That indeed makes sense, but I am just wondering how much coding Mike would have to do to cover all options. But you have certainly not said 'something stupid'.
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 »

Hey now.


Sent from my iPhone using Tapatalk
Custom 9x with M64/Telemetry Mod
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 »

I am good with turning things on and off.
Sonar, photo optic, lidar . Etc.


Sent from my iPhone using Tapatalk
Custom 9x with M64/Telemetry Mod
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 »

Agree with João


Sent from my iPhone using Tapatalk
Custom 9x with M64/Telemetry Mod
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

I've noted the config.h idea.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
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 »

Just a quick response to justification. As one would want to know the speed related to gps. One would want to know the distance in height related to gps/baro as sonar and lidar are accurate for APM flight modes as well as the ability to adjust the height via pot and see the height/distance setting registered and taking effect.


Sent from my iPhone using Tapatalk
Custom 9x with M64/Telemetry Mod
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 »

MikeB wrote:OK, I'll look into finding that in the MavLink data and sending it down via the Arduino, then add an Airspeed entry in the telemetry.

Mike.
If you are having problems getting this... you first have to enable the AirSpeed Sensor in the APM/Mission Planner.
Once that is enabled, the Telemetry Data will have the value ready for transmission. Kinda like an subscription process.

Interestingly, I came across these links and information if you are interested.

Re:Telemetry and FrSky (noticed this was shared already) :lol:
http://plane.ardupilot.com/wiki/common-frsky-telemetry/

Rangefinders
http://plane.ardupilot.com/wiki/common- ... ndingpage/

Optic-Flow
http://plane.ardupilot.com/wiki/common- ... -adns3080/
Last edited by LTMNO on Wed Mar 09, 2016 6:22 pm, edited 1 time in total.
Custom 9x with M64/Telemetry Mod
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

Thanks. I think I have the airspeed sorted. It needed a change to both the Arduino code, to send the value over telemetry, and a change to ersky9x to handle an "Aspd" telemetry value. At the moment, the value will be in m/s, as sent by the APM.
I've still to post these updates. I've been busy with some changes to the way the trainer profiles are handled.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
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 »

PinOut Diagram
Image

I keep getting confused on this as I disconnect and connect each time after cleaning out my workstation.
I have created a diagram for those whom wish to reference.
Please sanity check it so that it can be used going forward. Perhaps post on first Page or something.
Happy to make changes as needed.

Just to note, D4/Ground does not put out Cells for me.
I have updated to Feb18th Release of APM_Mavlink_to_FrSky.ino
Note, its not really a problem as I don't see me using it as all I really want is the full voltage reading of the Battery for alarm warming...

Thanks.
Custom 9x with M64/Telemetry Mod
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

Under the X8R you have "Connected via SBUS", do you mean "Connected via SPort"?
I thought I tested the SPort sending individual cell voltages. Note, I posted versions of the Arduino code on the 14th, 19th and 27th Feb, so I'm not sure which one is the Feb18th you refer to (although the one on the 19th was at 00:25 so might appear as the 18th for some).

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
conicio
Posts: 11
Joined: Tue Feb 23, 2016 5:03 pm
Country: -

Re: Adding MAVLINK support

Post by conicio »

Question: Does the arduino mini pro translate between mavlink to frsky AND frsky to mavlink? or just mavlink to frsky?
F-450 Clon - APM 2.5 - X8R - XJT - 9XR Pro
S-500 - HKMicro APM - FS6R - FS T6
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

At present, it just receives the serial data from the APM and converts it to send it over the FrSky telemetry. It does send some requests to the APM in order to get the APM to send the required telemetry data.

The FrSky hub protocol has no way to send data from the Tx to the Rx.
The SPort protocol does support sending data from the Tx to the Rx, but this does need a Tx that supports sending data on the SPort.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
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 »

MikeB wrote:Under the X8R you have "Connected via SBUS", do you mean "Connected via SPort"?
I thought I tested the SPort sending individual cell voltages. Note, I posted versions of the Arduino code on the 14th, 19th and 27th Feb, so I'm not sure which one is the Feb18th you refer to (although the one on the 19th was at 00:25 so might appear as the 18th for some).

Mike.
The SBUS is how the RX connects to the APM...
that just means that Ground is already available along with 5V.
I am using the S.Port for the Arduino.
I will double check the latest code... but Cells never worked on D4 for me.

I will report back in the AM.

I will update the Diagram to reflect connection to the APM.
Custom 9x with M64/Telemetry Mod
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 »

Update picture...
Image
Custom 9x with M64/Telemetry Mod

Post Reply

Return to “erskyTx (was ersky9x)”