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...
Replies
I will be testing some code tweaks as soon as the weather lets me outside. I want to make sure that the fix doesn't break the existing GPS functionality :-) It may be a wee while until I get back to you but watch this space :-)
Hi I have that same glitch.
I assume that there is an incorrect sound file being played ?
How can I help to solve this issue?
Tim
Tim,
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:
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?
Hi Paul,
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.
Kev
Hi
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
Tim
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...
Kev
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.
next:
status_severity = t2%0x10
so status_severity = 2 calculated thus:(706 in hex = 2C2 mod 0x10 = 2)
next:
t2 = (t2-status_severity)/0x10
so t2 = 2C(hex) = 44(dec) calculated thus:(0x2C2 - 0x2)/0x10
next:
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:
playFile("/SOUNDS/en/TELEM/MSG"..apm_status_message.textnr..".wav"
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!
WoW, thanks for all that work!
My SD Card file /SOUNDS/en/TELEM/MSG44.wav does say "failed"
I wonder why mine is different...
If I look at the project folder found here:
Clooney GitHub
I see two sound folders, SOUNDS and SOUNDS_AC3.3
I'm using SOUNDS and MSG44.wav = "Failed"
Although SOUNDS_AC3.3 MSG44.wav = "Reached Command"
Now my question is - should I actually be using the AC3.3 even though I'm still running v3.2.1 (I'm assuming here AC3.3 is related to APM:Copter v3.3)?
Thanks Again
Kev
That's a good question Kev! I switched to 3.3 (actually 3.4 dev on my quad and 3.5 on my plane) so am using the new sound files. If you're on 3.2.1 (I'm guessing the reason for this is you have an older 8 bit APM board?) then you are quite rightly using the older (non 3.3) sound files, but it looks like this one particular wav file may be incorrectly defined in the older sound file set. I would suggest therefore to simply replace the msg44.wav you have with the 3.3 version - so you will then get the right message shouted out. Alternatively, you can replace it with your own generated sound file if you prefer saying something more suitable, like "waypoint reached", or whatever you want. The voices in these files are just regular voices on a mac.
Can I please ask in that case that you raise an issue on the Cloney82 github page detailing these findings. Hopefully Jochen (Clooney82) will pick up on this. Cheers, Paul