Hi all,

I just bought an FrSky Taranis for my quad copter and needed to get the Mavlink data up on the Taranis LCD telemetry display. So here is my solution using a Teensy3.1 as a converter between MavLink and the S.Port on FrSky X8R.

See attached file below...

Views: 307004

Attachments:

Reply to This

Replies to This Discussion

I give up, Rolf.

The LED goes on when the copter is "Armed". Then the Led will remain on permanently.

Even when then disarmed
Constant voltage is 15V, no Low Batt.

Peter

Yes, because you check the message.severity and this is only sent once when the failsafe is triggered and the led is not reset until power off. You can reset the led when getting the disarmed mode.

You mean like this?

if (ap_base_mode == 0){          
          digitalWrite( 15 , LOW); }

Does not work.

But I do not have a failsafe, I armed the copter and the Led goes on.

Peter

I have tested the function more thoroughly now and found out that the statustext message must be checked  for  the acctual text return. All message seems to return 0x01 as severity ( see below)

 

Startup of APM

1 : Calibrating barometer

1 : barometer calibration complete

1 : GROUND START

1 : Initialising APM...

1 : Initialising APM...

ARMING of APM

1 : GROUND START

1 : Initialising APM...

1 : Calibrating barometer

1 : barometer calibration complete

Battery Failure

1 : Low Battery!

Exactly, almost no matter what you do, it is 0x01.
Do you have an idea how I query the status text message?

Peter

I will try to see what can be done...

There is another way to check the failsafe and that is to use the system_status from Hearthbeat message,

System status will be 5 when any failsafe is triggered and as far as i can see, it will only resets after resetting the APM. So using this will turn on the LED on an failsafe and you have to reset or power on/off then APM to restore.

Hi Mike,

Just a note I tried porting this to a ATMega168 (one of the original Ardupilot boards!). I can confirm that the SoftSerial does do inverted signalling. I was able to successfully able to get the ATMega talking to the FrSky X8R with a few minor mods to Rolfs code and I was able to get telemetry data on my Taranis (from hardcoded values written in code). However I could not enable the Mavlink code to work successfully. I believe I was getting overflow problems with the limited memory on the 168. I didn't get around to looking into GCS_MAVLink.h file to see if I could 'trim' it down.

I assume you're using the ATMega328? Did you have any overflow issues?

Let me know how you go! 

OK Rolf.

That it will only resets after resetting the APM is okay.

Important is,that not every failsafe, but only Low Batt is evaluated.

Peter

Try this....

In the beginning of the file:

String stringRet;

 

 and then:

case MAVLINK_MSG_ID_STATUSTEXT:       
            mavlink_msg_statustext_decode(&msg,&statustext);
            stringRet = statustext.text;
            stringRet.trim();
            if (stringRet == "Low Battery!"){
                     digitalWrite( 15, HIGH);
                      }
            break;  

you still have to reset the APM after failsafe..

Hello Rolf - I love this project !

I have a problem that i do not get any values for HDG which is pretty important for me, i always get 0°

Could this be a bug when using an external MAG?

No idea why i dont get Hdg

Best regards, Alessandro

The code is Reading the MavLink communication from the flightcontroller so if your compass is working Ok you should have a reading.

Do you get an reading from the compass when connected to the Mission Planner software??

It was the Firmware ! To everybody with old Firmware: My 09-2013 Firmware did not work with Hdg but after the update to the 02-02-2014 Firmware it works :)

Sorry for the trouble but maybe this post helps others with older Firmwares too.
Best regards from Germany

Reply to Discussion

RSS

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service