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...
I was testing Auto Mission yesterday and noticed that I kept hearing "Failed" called. Took me by surprise the first time but actually the mission was OK. It only happens in Auto Mode.
Watching the MavLink messages in Mission Planner it could be calling Failed each time a waypoint message was displayed, but sometimes also called when no message had appeared. I can say that the mission was a simple figure of 8, the "Failed" was called at the same places around the mission.
Has anyone detected this before? Any advice?
I don't want to investigate further if its a known issue.
Not tested this in Auto missions yet, but a couple of questions if you will:
What Arducopter version are you running? What OpenTx version?
If you are using the latest revisions (I.e. OpenTx 2.1.7 and Arducopter 3.3), then be sure you are using the 2.1 version of this code with the coptr217 lua script, plus make sure you have all the 3.3 voice files installed. This includes additional voice files provided by OpenTx, as they changed since OpenTx 2.0.
Thanks for replying Paul.
I'll grab some version numbers when I get home later, I'm not exactly using the latest but I am running 2.1.x, probably 2.1.6 but I'll check for sure. Once I've captured the version numbers I'll update everything, I know I'm still on APM Copter 3.2.1 so 3.3 would not go a miss and I'm getting update messages on companion.
OK, this is what I have when I found the issue, I'm going to update to the latest version of everything now including the APM:Copter version.
Taranis BootLoader 2.1.5
Taranis Firmware 2.1.5 EU Version (I think because I don't know how to check but this is what I have stored in my downloads folder).
Clooney LUA Script (there is no version in the file), but its the 2.1 version for sure I'm juts not sure when I downloaded it.
Pixhawk runing APM Copter v3.2.1
MavLink_FrSkySPort_1.3 on the teensy
I have been checking the code and it appears that the status messages are derived from the value sent to the T2 telemetry sensor (by the Teensy). The LUA script has a line:
status_severity = t2%0x10
This means take the value of t2, divide it by 10(hex), and then what remains (the modulus) is assigned to status_severity. In essence this gives us the binary digits from T2 which represent the status message number. This wav file representing this number is then played. so msgxx.wav (where xx is the number)
Now to determine which wav file we need for reaching a waypoint, we need to know what the value of T2 is upon reaching a waypoint. From this we can determine the wav file number, and see if one is present with this number - I suspect not, as I just went through all 125 wav files and can not hear one which narrates the words 'waypoint reached' or even anything close to this.
So when you are next flying a mission, can you please select the sensor definition page and keep an eye on the t2 value when you hear the "failed" message shouted out?
Thanks for checking the code, if no one answers before I will try to get some more details on Saturday looking at the T2 value.
I have reloaded and reset lua, teensy and sound files every thing I could think of ,and
now seems to work correctly by announcing "command reached" or something similar
on reaching way points in auto mode.??
It may have been a message from mission planer (tower) that confused me??
I will check it out this weekend
I did the same but still have the issue.
T2 =1413, so this should be 1413 / 16 = 88.31
MSG88 is "Breach Command Number", so now I'm not sure...
1413 MOD 16 = 5
MOD gives the remainder of 1413 / 16.
In your calculation 1413/16 = 88 with a remainder or .31.
88 * 16 = 1408 and 1413 - 1408 = 5
1413 = 0x585 (hex)
The code goes like this:
apmarmed = t2%0x02 = 1 (so this will take 0x585, divide it by 2 and get the remainder I.e. modulo 2, which equates to: 1 - so this basically gets the least significant bit in the 16bit binary and if its 1 then its armed, if its 0 then it isn't armed)
next we have this:
t2 = (t2-apmarmed)/0x02
so t2 = 706 calculated thus: (1413-1) =1412 /2 = 706
so the armed number is deducted from t2, and the remainder halved - this has the effect of chopping off the least significant bit of the binary leaving the remaining bits.
status_severity = t2%0x10
so status_severity = 2 calculated thus:(706 in hex = 2C2 mod 0x10 = 2)
t2 = (t2-status_severity)/0x10
so t2 = 2C(hex) = 44(dec) calculated thus:(0x2C2 - 0x2)/0x10
status_textnr = t2%0x400
so status_textnr = 44 calculated thus:(0x2C mod 0x400 = 0x2C = 44(dec)
We have a bunch of evaluations and eventually the variable assignment is made:
apm_status_message.textnr = status_textnr
so apm_status_message.textnr = 44
Then we eventually get to:
so it will try to play a file called /SOUNDS/en/TELEM/MSG44.wav (from the SD card)
This file reads out the words "Reached Command", which I think this is what Tim is getting.
Kevin, I would suggest checking your wav files, to see if MSG44.wav does indeed play this.
A great resource I just used to figure out what's happening in reality in this code is this calculator: http://calc.penjee.com/
The above code is basically taking the 16bit binary number assigned to T2 and dissecting it to pull out the bits it needs to get the status message number. Going through this has caused me to use areas of grey matter that I haven't needed to use since college in the early 90's!