• Hello,

        I'm interested by your work : if you can send me the second lua screen it would be great !

        Actually I use the excellent Wolke s-c-l-...branch but I need the mavlink messages too !


    • hmm,

      i am wolke the creator of this lua script and this port of mavlink converter. you use my scripts it is recommendable to use also my teensy code. i make some adaptations here, mostly because voltage and single cell voltage. Important! this code is only compatible with teensy3.1 and can not compiled without adoptions for other boards. and it is important that you also copy all files placed under to your taranis sd card. else soundfiles are missing and also needed model scripts.

      if you not interesting to use single cell monitoring with the teensy simply comment lines 87 & 88 in MavLink_FrSkySPort.ino. in this case the voltage which is displayed in my script come from reported mavlink voltage. generally to get correct voltage and current values, tarans voltage and current source must set to FAS.

      the next step is to setup model scripts "cellinfo" and "offset" correctly. this is important that voltage audio warnings will work correctly and that the Wh and mAh consumption will calculated as it make sense. please read to understand how all this works together.

      cell count:

       the teensy code calculate the cell count comparing some fixed values against the reported mavlink voltage. the teensy decide here that everything is higher than 12750 must be 4s or more. if your sensor is fluctuating so much that mavlink report more than 12,75V for a fully charged  3s battery  maybe you must recalibrate your voltage sensor settings in MissionPlanner or replace your sensor. the teense detect a 3s battery between >8,5 and <12,75 V.



      This MavLink_FrSkySPort repository is discontinued! The development is moved to Clooney82/MavLink_FrSkySPort where we work together on this. Please d…
      • Yeah thanks Wolke, its good

        I tried to make a second lua telemetry screen like Scottfly's that shows the text of the last 5 messages, because I'd been having some problems and incase I miss heard the sounds, if other people were talking etc.

        So I copied your Text ID's out of the teensy code and then used them as indexes in a lua script for a text array.

        Had a lot of problems with 'syntax error' turns out the array was just too big, when I excluded a few messages it worked.

        Does anyone have any tips for lua debugging on the Taranis?  the code worked in the simulation, or at least didn't give an error but took ages to find out the problem when loaded onto the Taranis.

        I'm not sure I am getting all the text messages this way, when I was trying Scotts code I am sure I had a few more setting up messages. But I haven't used it a great deal yet. so could be wrong.

        ScottFly was using the Rpm channel to send messages one 16bit word at a time, so the message was coming through same as got to the teensy.

        Presumably for you its better to do the text comparisons on the teensy though than take up power on the Transmitter.

        I am going to try getting Ivale's lua script working with your code also, at same time as your lua script.

        Previously I've had problems running multiple telem scripts at the same time, could it be that both trying to setup the timer is a problem?

        Taranis doesn't seem to give much in terms of error codes?

        • hi David Jones,

          the STM32F205RE which is imo used in taranis is not a real memory monster. so it is very important on lua scripts that you control the consumption of memory. big lists or arrays with a lot of possible error messages are simple not possible here. also it is important on taranis to minimum the work for the  garbage collector. see .

          imo a save way here is, to collect error messages ids into a simple List which is limited to a maximum size see . and define simple a switch on taranis which allow you to repeat the error messages as audio message. then you only have to store the message id in your list. this save memory and at least you can hear all the messages as often you want.



          lua-users wiki: Optimising Garbage Collection
        • Hi

          On the Teensy code I'm parsing the messages and sending down via telemetry a code for each of the 100+ messages that the Ardupilot generates (I believe all are being parsed, at least as of 3.2 both me and Christian parsed the entire source code of Ardupilot searching for every possible message - Note: I raised this problem to the APM devs, and there is an issue raised to have a code on each message - )

          My lua scripts are not using those error codes as of now, although parsing them, because as you noticed if you try to create a large enough array the script crashes :).

          Some of the options I took on the scripts are purely related to avoid overloading the Taranis. Let's just say that I had the precious help of the OpenTX devs debugging some, and others revealed important issues on the OpenTX. One such example is with the rotating arrows. My first try was a nicely drawn parametric arrow. It revealed itself as too resource hungry for a good utilization of the radio :) Also, do we really need/want to know an exact arrow with minute angle orientation drawn on a low res lcd screen, or a simpler general quadrant orientation? :)

          There are some changes on Lua for the next version of OpenTX that would make it easier to handle these issues.

          On my lua script, you can easily change any of the current boards, as they are all clearly separated and are called independently inside the run(), so anyone of them is easily replaceable /changed.

          local function run(event)


          From a brief look at Wolke's Teensy code I believe the only relevant change is the addition of the voltage divider bridge code to read individual cells.

          I've simplified my current code (not posted) because I've added a FLVSS sensor from FrSky.

          • Hi folks. Another problem here. I've lost my radio and i bought a new one. Now i've a Taranis plus, before i had a Taranis. 

            Now the telemetry doesn't work anymore. I can see the Mode from the Pixhawk, but not on real-time. When i change mode now i can see the changes on the Taranis delayed, a couple of second, a lot more than before. And no other value is read from the Teensy. I've a MinimOSD connected on parallel with the Teensy and i can see weel all the parameters on my tv.

            The firmware on the Taranis is the last one. 2.0.15, on the old one was the 2.0.13. I've try to find the old firmware for the Plus but witouth succes.

            Anybody can imagine wath is happened ?

            Thank you for your kind attention


          • I think you can share the code with you're add of FLVSS sensor because i think they are many pepole with it.

          • I have kind of got this working. Telemetry 2 on pixhawk does not output MAVLINK data. It works fine on telem1.

      • Thanks for all the great work you have done. are the HEX files on github or just the source? I have not looked.

        I have not had much luck compiling myself. :(

This reply was deleted.