Frsky D4R-II 8 channels receiver with telemetry part 2: Lua

I wish to make a lua script for my Jumper T18, with D port data from pixhawk.(pixhawk 1M with D4R reciever).

There are old lua script for D port data on taranis radio, I also found a flysky lua script on T16. May be with conbination of these 2 I can get a lua script of Dport on T18

 Documentation of openTX inav script is quite complicated, I found the one for tanaris, which only support D receiver and S receiver, is more easier to study:

https://github.com/iNavFlight/LuaPilot_Taranis_Telemetry

from here : 

https://github.com/iNavFlight/LuaPilot_Taranis_Telemetry/blob/master/SCRIPTS/TELEMETRY/LuaPil.lua

you can see the data collected, others are based on calculation:

Tmp1 is for flight mode, Tmp2 is for GPS fix info, seems to be the same as S.port.

--data.battsumid = getTelemetryId("VFAS")
data.vfasid = getTelemetryId("VFAS")
data.celsid = getTelemetryId("Cels")
data.altid = getTelemetryId("Alt")
--data.gpsaltid = getTelemetryId("GAlt")
data.spdid = getTelemetryId("GSpd")
data.gpsid = getTelemetryId("GPS")
data.currentid = getTelemetryId("Curr")
data.flightmodeId = getTelemetryId("Tmp1")
data.rssiId = getTelemetryId("RSSI")
data.gpssatsid = getTelemetryId("Tmp2")
data.headingid = getTelemetryId("Hdg")
data.fuelid = getTelemetryId("Fuel")
--init Telemetry Variables
data.battsum = 0
data.cellnum = 0
data.alt = 0
data.spd = 0
data.current = 0
data.flightmodeNr=0
data.rssi = 0
data.gpssatcount =0
data.heading = 0
 you can s till find the 3dr iris lua script for tanaris,  pixhawk

Here is a lua for fly sky on T16, easy to understand:
https://github.com/StefanoPerinetti/FlySkyRx not getting the reading of D port, but the structure is quite simple to understand.

This is a gps lua on T16: the data info is simple, easy to understand



this is a reference from openTX2.3, there is a simple example.

looking into the difference between taranis and T16/18, it seems for the display, it use the same syntax.
There is no special function for the difference, maybe I can just run the tanaris script on T18...Not sure if I have to define the color.

留言

這個網誌中的熱門文章

Heltec ESP32+OLED+Lora, hardware testing

micro SD card for ESP32, on lolin32 with OLED and heltec 32 lora oled

AIS0. understanding AIS NMEA 0183: How it's coded