Page 9 of 20

Re: Adding MAVLINK support

Posted: Mon Feb 29, 2016 7:36 pm
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.

Re: Adding MAVLINK support

Posted: Mon Feb 29, 2016 8:09 pm
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

Re: Adding MAVLINK support

Posted: Mon Feb 29, 2016 9:10 pm
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

Re: Adding MAVLINK support

Posted: Tue Mar 01, 2016 1:36 pm
by conicio
Ok. I'll wait for the mini pro from china.
Thanks a lot

Re: Adding MAVLINK support

Posted: Tue Mar 01, 2016 2:44 pm
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.

Re: Adding MAVLINK support

Posted: Wed Mar 02, 2016 7:09 am
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.

Re: Adding MAVLINK support

Posted: Wed Mar 02, 2016 8:33 am
by RCHH
Ah yes - I was not thinking 'Pro'!

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 1:03 pm
by tomismrkolj1
Hi,

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

tnx.

tomi

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 6:57 pm
by MikeB
I've made a note for this. From APM, is the airspeed from the GPS?

Mike.

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 7:17 pm
by RCHH
Can be, but there are dedicated airspeed sensor in analogue and digital flavours Mike - see HERE

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 7:46 pm
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.

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 8:02 pm
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.

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 8:32 pm
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.

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 8:47 pm
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

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 8:52 pm
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!

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 9:35 pm
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

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 9:44 pm
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'.

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 9:46 pm
by LTMNO
Hey now.


Sent from my iPhone using Tapatalk

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 9:47 pm
by LTMNO
I am good with turning things on and off.
Sonar, photo optic, lidar . Etc.


Sent from my iPhone using Tapatalk

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 9:48 pm
by LTMNO
Agree with João


Sent from my iPhone using Tapatalk

Re: Adding MAVLINK support

Posted: Sun Mar 06, 2016 11:50 pm
by MikeB
I've noted the config.h idea.

Mike.

Re: Adding MAVLINK support

Posted: Mon Mar 07, 2016 12:42 pm
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

Re: Adding MAVLINK support

Posted: Wed Mar 09, 2016 5:01 pm
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/

Re: Adding MAVLINK support

Posted: Wed Mar 09, 2016 5:44 pm
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.

Re: Adding MAVLINK support

Posted: Wed Mar 09, 2016 8:44 pm
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.

Re: Adding MAVLINK support

Posted: Wed Mar 09, 2016 11:05 pm
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.

Re: Adding MAVLINK support

Posted: Wed Mar 09, 2016 11:10 pm
by conicio
Question: Does the arduino mini pro translate between mavlink to frsky AND frsky to mavlink? or just mavlink to frsky?

Re: Adding MAVLINK support

Posted: Wed Mar 09, 2016 11:16 pm
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.

Re: Adding MAVLINK support

Posted: Thu Mar 10, 2016 1:08 am
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.

Re: Adding MAVLINK support

Posted: Thu Mar 10, 2016 1:59 pm
by LTMNO
Update picture...
Image