Thread Tools
Jan 18, 2018, 04:08 PM
Registered User
Thread OP
Download

An Ardupilot frsky telemetry LUA script for the Horus X10/ X12 and Taranis X9D/E/QX7


Hi,
it all started as a way to learn lua and the new frsky passthrough protocol and day after day the project grew into a full blown telemetry script.

It requires aHorus X10, X12 or a Taranis X9D+,X9E or QX7 radio, OpenTX 2.2 and arducopter 3.5.x.

- full implementation of the frsky passthrough protocol
- per model configuration menu
- dual battery support
- vocal alerts
- vocal fence
- min/max values
- frsky sensors passthru

the code is available on github https://github.com/yaapu/FrskyTelemetryScript

Edit:18/05/2019

Taranis X9D/QX7 and X-Lite version 1.8.0

Edit: 4/06/2019

Horus version 1.8.0 rc2

horus_1.8.0_rc2.zip
Last edited by yaapu; Jun 13, 2019 at 10:46 AM.
Sign up now
to remove ads between posts
Jan 18, 2018, 04:09 PM
Registered User
Thread OP
release notes

Horus version
Taranis versions
Last edited by yaapu; May 18, 2019 at 11:54 AM.
Mar 13, 2018, 09:36 AM
Registered User
Thanks for this awesome script yaapu! I'm a very happy X7/Pixracer user :-)
Mar 13, 2018, 01:14 PM
Registered User
Thread OP
thank you for trying it out!

there's also a blog on ArduPilot Discourse
Last edited by yaapu; Mar 13, 2018 at 01:22 PM.
Apr 14, 2018, 03:22 PM
Registered User
mmormota's Avatar
I just installed the script, it is working very well. Impressed how fast the horizon follows the angles. Thank you for the great work!

I have a Radiolink Mini Pix, XSR receiver and X7S carbon radio. I tested it on only on the desk yet.

I had to rename the script from .luac to .lua. Enabling luac on the radio is not working.

The radio beeps slowly, not sure what is its meaning?
A screen with the GPS coordinates could be helpful.
I have only one battery, is it possible to disable the other two?
Apr 18, 2018, 06:26 AM
Registered User
Thread OP
Quote:
Originally Posted by mmormota
I just installed the script, it is working very well. Impressed how fast the horizon follows the angles. Thank you for the great work!

I have a Radiolink Mini Pix, XSR receiver and X7S carbon radio. I tested it on only on the desk yet.

I had to rename the script from .luac to .lua. Enabling luac on the radio is not working.

The radio beeps slowly, not sure what is its meaning?
A screen with the GPS coordinates could be helpful.
I have only one battery, is it possible to disable the other two?
Hi, thanks for trying it out :-)

the script beeps every time a new mavlink message arrives, you can see the incoming messages by short pressing [PLUS]/[MINUS]
You can disable the beeps from the configuration menu, to enter config long press [MENU]

To add GPS coordinates:
- make sure you run sensor discovery, GPS should appear in sensor list
- add a second telemetry screen with NUMS and select GPS as the value to show.
- while the script is running short press [PAGE] to view second telemetry screen, press [PAGE] again to get back to the telemetry script

Second battery support is enabled only if the script detects it, otherwise will only monitor 1 battery, do you have an issue with battery monitoring?
Last edited by yaapu; Apr 18, 2018 at 06:32 AM.
Apr 18, 2018, 06:41 PM
Registered User
mmormota's Avatar
Thank you very much, everything is working now as intended.
Apr 19, 2018, 12:27 AM
Registered User
Thread OP
Quote:
Originally Posted by mmormota
Thank you very much, everything is working now as intended.
you're welcome.

cheers
May 20, 2018, 06:25 AM
Done Posting, Gone Flying
JNJO's Avatar
Awesome work, yaapu.
Thanks for sharing.
May 20, 2018, 08:37 AM
RC fanatic
yaapu, Very impressed with your script. Thinking of putting it on my 680 hexacopter to replace my original script (yours lua screen is way more intuitive I think). I have 2 batteries on my hexa paralleled up running through 1 x Mauch sensor (instead of regula APM power brick), so Arducopter sees a single battery which I'm happy with. For monitoring cells however I have 2 x FLVSS sensors. In order to use both with your script, I appreciate the first sensor should use the name Cels on the OpenTx telemetry sensors page (the default name) , but what should I name the second sensor (I have it using ID15) for it to be used by your script? Am I correct in thinking Cel2 ?

Thanks, Paul

p.s. I noted when I tested your script on my text quad (which has FLVSS also) that the minimum cell value was sometimes a little off compared with the FLVSS LED display values - maybe just 0,01v difference but I would have thought it should mirror it precisely?
May 20, 2018, 10:22 AM
RC fanatic
I thought I'd just go ahead and connect an inverter to Serial4 on my hexa (in place of the previous teensy) and it works fine. I can see aggregated battery view for the 2 FLVSS sensors. I'm not sure how I get to separate battery views as your notes (on github) seem to have a conflict. You say:

A short press of [ENTER] on Taranis or [ENCODER on Horus ]cycles between all the sources

then later on:

A short press of [ENTER] on the Taranis or [ENCODER] on the Horus switches from single aggregate view to individual dual battery view.

In reality the short press of ENTER does the first of these two actions, to cycle between battery sources. So not sure which key to do the latter - can you please advise as I have tried all the keys but don't get the dial view.

Cheers, Paul
Last edited by athertop; May 20, 2018 at 10:37 AM.
May 20, 2018, 11:02 AM
Registered User
Thread OP
Quote:
Originally Posted by athertop
I thought I'd just go ahead and connect an inverter to Serial4 on my hexa (in place of the previous teensy) and it works fine. I can see aggregated battery view for the 2 FLVSS sensors. I'm not sure how I get to separate battery views as your notes (on github) seem to have a conflict. You say:

A short press of [ENTER] on Taranis or [ENCODER on Horus ]cycles between all the sources

then later on:

A short press of [ENTER] on the Taranis or [ENCODER] on the Horus switches from single aggregate view to individual dual battery view.

In reality the short press of ENTER does the first of these two actions, to cycle between battery sources. So not sure which key to do the latter - can you please advise as I have tried all the keys but don't get the dial view.

Cheers, Paul
Hi Paul,
a short press of [ENTER] does both, if 2 batteries are detected the first press switches to dual view, subsequent presses cycle between sources, if you press exit the selected source becomes the current one.
In your case the second battery is not detected for some reason.

I look for the second FLVSS as "Cel2", is has to be of type table to be detected by the script, ID should not matter as long as is different from default.
I must admit that I tested dual FLVSS sensors only in companion, but I have a second FLVSS on the way and I'll be able to test it better.

Code:
------------
  -- FLVSS 2
  ------------
  cellResult = getValue("Cel2")
  if type(cellResult) == "table" then
    cell2min = 4.35
    cell2sum = 0
    for i = 1, #cell do cell[i] = 0 end
    -- cellcount is global and shared
    cellcount = #cellResult
    for i, v in pairs(cellResult) do
      cell2sum = cell2sum + v
      if cell2min > v then
        cell2min = v
      end
    end
    -- if connected after scritp started
    if batt2sources.vs == false then
      battsource = "na"
    end
    if battsource == "na" then
      battsource = "vs"
    end
    batt2sources.vs = true
  else
    batt2sources.vs = false
    cell2min = 0
    cell2sum = 0
  end

L
May 20, 2018, 11:38 AM
RC fanatic
Quote:
Originally Posted by yaapu
Hi Paul,
a short press of [ENTER] does both, if 2 batteries are detected the first press switches to dual view, subsequent presses cycle between sources, if you press exit the selected source becomes the current one.
In your case the second battery is not detected for some reason.

I look for the second FLVSS as "Cel2", is has to be of type table to be detected by the script, ID should not matter as long as is different from default.
I must admit that I tested dual FLVSS sensors only in companion, but I have a second FLVSS on the way and I'll be able to test it better.

Code:
------------
  -- FLVSS 2
  ------------
  cellResult = getValue("Cel2")
  if type(cellResult) == "table" then
    cell2min = 4.35
    cell2sum = 0
    for i = 1, #cell do cell[i] = 0 end
    -- cellcount is global and shared
    cellcount = #cellResult
    for i, v in pairs(cellResult) do
      cell2sum = cell2sum + v
      if cell2min > v then
        cell2min = v
      end
    end
    -- if connected after scritp started
    if batt2sources.vs == false then
      battsource = "na"
    end
    if battsource == "na" then
      battsource = "vs"
    end
    batt2sources.vs = true
  else
    batt2sources.vs = false
    cell2min = 0
    cell2sum = 0
  end

L
I get B1+B2 displayed immediately on the script starting, (I have the second FLVSS as Cel2 as the script requires), so it is definitely detecting 2 sensors. But I can't get any amount of presses to bring the separate battery displays on either side of the screen (separate B2 on the left and B1 on the right). Is it perhaps because I only have one power brick detected by Ardupilot?

Cheers, Paul
May 20, 2018, 01:22 PM
Registered User
Thread OP
Quote:
Originally Posted by athertop
I get B1+B2 displayed immediately on the script starting, (I have the second FLVSS as Cel2 as the script requires), so it is definitely detecting 2 sensors. But I can't get any amount of presses to bring the separate battery displays on either side of the screen (separate B2 on the left and B1 on the right). Is it perhaps because I only have one power brick detected by Ardupilot?

Cheers, Paul
Paul my fault I found the bug, dual battery detection is working but when processing the enter key event I only check for FC second battery, easy fix

Thanks for digging this out
May 20, 2018, 03:36 PM
Registered User
Thread OP
Quote:
Originally Posted by yaapu
Paul my fault I found the bug, dual battery detection is working but when processing the enter key event I only check for FC second battery, easy fix

Thanks for digging this out
Paul please try this version and let me know :-)


Quick Reply
Message:

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion F3K programs for OpenTX transmitters jfrickmann Hand Launch 1871 Feb 25, 2021 08:42 PM
New Product Upgrade Taranis Loudspeaker for Frsky Q X7 / X9D / X9D Plus and X9DP SE sevet Radios 1 Sep 19, 2017 09:13 AM
Discussion FrSky Taranis X9D Plus and Q X7 Buddy Box Trainer cremachine Radios 4 Jul 23, 2017 07:45 PM
Yippee! BUDDY CODE for FrSky TARANIS X9D (Mode 2) cacomistle HobbyKing 5 Mar 29, 2014 01:57 AM